This utility will serve the purpose of being a watchdog on the health of the servers and components and take corrective actions if a crash is detected. The peer server and all the separate components which are launched as a separate JVM Process may crash due to of many reasons.
The utility on detecting such a crash executes a corrective action like restarting the components / servers or notifying administrator about it. This utility can be run in two different modes. 'Event Process' monitoring which monitors the state of the component JVM processes and restart the components if a crash is detected and 'Server Monitoring' which monitors the state of the servers and execute a script file if the server is not running.
Overview
This is a separate utility and files needed for this utility will be found under $Fiorano_home/esb/tools/monitor.
The following is the directory structure present under the above mentioned directory:
- monitor/conf –contains the configurations to be used by the utility
- monitor/lib – contains the necessary jars to run the utility
- monitor/bin – contains the scripts to run the utility
Configuration Types
Logging configuration
The utility uses the 'java.util.logging.Logger' class for logging. The properties file 'logging.logging.properties' is located under the conf directory. Log levels/ Log Handlers can be configured for the utility in this file. The logs go into the $Fiorano_home/esb/tools/monitor/bin/logs directory which is created at runtime.
Monitoring configuration
The monitoring.conf file is the configuration file for the utility. It is located under the conf directory. The file 'fiorano.conf' is the configuration file for the utility to run as a service using the Taunki Wrapper. Also present in the conf directory are the sample configuration files which contain details of the servers which need to be monitored (server1.conf and server2.conf).
Utility Scripts
The scripts to run this utility are located under bin directory. Following scripts are used to run the utility:
utility.bat/sh
Execute this script to run the utility in a console.
FioranoMonitorService.bat/sh
Use these scripts to run as a service.
Server1.bat/sh
andserver2.bat/sh
These scripts are sample scripts provided with the utility to be executed once a server is detected to be not running.
Event Process Monitoring
To run the utility in Event Process Monitoring mode, the MONITORING_MODE property should be set to EVENT_PROCESS_MONITORING in the monitoring.conf.
The following properties present in monitoring.conf are applicable to Event Process Monitoring and are explained below:
Property Name | Description |
---|---|
MONITORING_MODE | Specifies the mode in which the utility will be run. Two valid values are SERVER_MONITORING and EVENT_PROCESS_MONITORING |
Context_PROVIDER_URL | The External URL of the Enterprise Server as used by the Fiorano Studio to connect. |
Context_INITIAL_CONTEXT_FACTORY | The Initial context factory implementation to use |
FIORANO_USER | The username of the authenticated principal |
FIORANO_PASSWORD | The credentials of the authenticated principal |
EVENT_PROCESS_LIST | The list of Event Process GUID separated by commas which needs to be monitored. Special values like $ALL_RUNNING (All currently running event processes will be monitored) and $ALL_SAVED (All event processes saved in the repository) can be used. |
EVENT_PROCESS_MONITOR_INTERVAL | The interval at which the status of the components will be checked. |
Server Monitoring
To run the utility in Server Monitoring mode, the MONITORING_MODE property should be set to 'SERVER_MONITORING' in the monitoring.conf file.
The following properties present in monitoring.conf are applicable to Server Monitoring:
Property Name | Description |
---|---|
MONITORING_MODE | Specifies the mode in which the utility will be run. Two valid values are SERVER_MONITORING and EVENT_PROCESS_MONITORING. |
The list of space separated server configuration files to monitor. | |
SERVER_MONITOR_INTERVAL | The interval at which the health of the servers will be checked. |
The properties present inside these configuration files are explained below:
Property Name | Description |
---|---|
SERVER_MODE | The mode in which the server is run. It could be in STANDALONE mode and HA Mode. |
PROVIDER_URL | The internal JMS Server URL of the server. |
INITIAL_CONTEXT_FACTORY | The implementation of the initial context to be used. |
SECURITY_PRINCIPAL | The Username of the principal to authenticate. |
SECURITY_CREDENTIALS | The credentials of the principal to authenticate. |
BACKUP_PROVIDER_URL | If the server is run in HA Mode, the URL of the backup server. |
BACKUP_INITIAL_CONTEXT_FACTORY | If the server is run in HA Mode, the initial context implementation to use |
BACKUP_SECURITY_PRINCIPAL | If the server is run in HA Mode, the username of the principal to authenticate |
BACKUP_SECURITY_CREDENTIALS | If the server is run in HA Mode, the credentials of the principal to authenticate |
COMMAND_PATH | The Script File to execute the corrective actions. The script file could start the server up/start an event process using the CLI/execute notification with custom written code and so on. |
Running the Utility
After configuring the utility, it can be run via the shell using the utility.bat/sh script file.
The fiorano.conf file is the configuration file for the utility to run as a service using the Taunki Wrapper. To run the utility as a Windows service or as a Linux Daemon service, follow the steps given below.
On Windows
- Execute the script FioranoMonitorService.bat present in the bin directory with the argument install to install the utility as a service.
- Execute the script FioranoMonitorService.bat present in the bin directory with the argument uninstall to uninstall the utility as a service.
On Linux
- Edit the script FioranoMonitorService.sh to set the absolute path of FIORANO_HOME and JAVA_HOME and save.
- Copy the file FioranoMonitorService.sh to /etc/init.d directory.
- Execute command
chkconfig
–add FioranoMonitorService.sh - Assign executable permissions to /etc/int.d/FioranoMonitorService.sh start/stop/status and so on.
- To uninstall the utility as service, go to '/etc/init.d' directory and type the following commands:
- chkconfig --del FioranoMonitorService.sh
- unlink FioranoMonitorService.sh
On Mac OS X
- Edit the script FioranoMonitoringService to set the absolute path of FIORANO_HOME and JAVA_HOME and save.
- Open com.fiorano.monitorservice.plist.
- Give the absolute path of FioranoMonitorService.sh for the first <string> node of <ProgramArguments> key.
- Copy the com.fiorano.monitorservice to /System/Library/LaunchAgents.
- To start FioranoMonitoringService, restart the system or Type "Launchctl load /System/Library/LaunchAgents/com.fiorano.monitorservice.plist"
- To check status run "./FioranoMonitorService.sh status" in %FIORANO_HOME%/esb/tools/monitor/bin.
- To stop run "./FioranoMonitorService.sh stop" in %FIORANO_HOME%/esb/tools/monitor/bin.
- To uninstall as service type "Launchctl unload /System/Library/LaunchAgents/com.fiorano.monitorservice.plist" in terminal and remove com.fiorano.monitorservice.plist from /System/Library/LaunchAgents.