Easy Infrastructure Monitoring is configured through a simple JSON file. By default it looks for a file called "eim.conf" in the same directory from where it was launched. However, it is also possible to specify the file to look for as the first parameter to the program, when it is launched.
The configuration file covers 3 areas: general settings, host definitions, services associated with each host (as a sub-section of each host definition).
An example of the latest configuration file is always present in the trunk, or can be accessed here. Some configuration options may be missing if they are not needed (the optional ones are indicated below).
The following options are available:
{
"version":"1.0",
This specifies the intended version for running the configuration file. Usually newer versions will build on existing ones, by adding new features. Therefore a configuration from an older version should run ok on a newer version (however, this is not guaranteed and you should check it). Nevertheless, a configuration from a newer version will most likely not work on an older version. If it does work, then some functionality may be missing. It is advisable to check your configuration when migrating to a newer version.
"serviceThreads":10,
The number of service threads specifies the number of checks that can be performed at the same time. However, since there may be a single network connection established to a particular host, the actual number of simultaneous checks is closely tied to the number of hosts.
"storage":{
"folder":"./storage"
},
The storage section specifies where statistical data will be stored. This will allow later to produce reports and charts for different periods of time. The specified folder must be granted write access by the user running the Easy Infrastructure Monitoring application.
"email":{
"servers":[
{
"name":"gmail",
"type":"smtp",
"host":"smtp.gmail.com",
"username":"username",
"password":"password",
"port":587,
"tls":true,
"from":"from@server.com",
"debug":true,
}
],
The email section contains two sub-sections: servers and groups. The email / servers sub-section contains information regarding the available email servers. These can be used to send alerts via email. It is possible to leave the servers sub-section empty if the email sending feature is not used.
"groups":[
{
"name":"email_group_1",
"to":"email1@email.com,email2@email.com"
}
]
},
The email / groups sub-section includes address lists that can be used when sending email alerts. An email group can contain either one or multiple email addresses separated by commas. It is possible to leave the groups sub-section empty if the email sending feature is not used.
"webServer":{
"port":8080,
"listenAddress":"127.0.0.1"
},
The "webServer" sub-section, if present, instructs the Easy Infrastructure Monitoring application to start a web server on a specified address/port combination. If this sub-section is missing, the web interface will be unavailable (nevertheless, the monitoring and alerting processes will still be running). The "listenAddress" is optional (default to "127.0.0.1"). If specified, it can allow the web interface to be accessed from different computers by specifying a valid IP address of the server (or the "0.0.0.0" = all addresses).
"alert":{
"error": {
"interval":60,
"action":"print('ALERT ERROR GENERAL');",
},
"warn": {
"interval":60,
"action":"print('ALERT WARN GENERAL');",
},
"fault": {
"interval":60,
"action":"print('ALERT FAULT GENERAL');",
},
"recovery": {
"interval":60,
"action":"print('ALERT RECOVERY GENERAL');",
}
},
The alert section is optional. Placed at this level, specifies how to handle an alert status at global level, regardless of the host or service where it occured. More information about alerts can be found in the page [Understanding Alerts]. The various alert types handlers are optional. Only those needed should be specified.
"hosts":[
{
"name":"HOST1",
"connections":[
{
"name":"default",
"url":"ssh://user:pass@server.domain.com/default/directory",
"username":"username",
"password":"password",
"debugLevel":0
}
],
The hosts section specifies the hosts to be monitored with their associated services (see below). Every host must have a name and services attached. Depending on how you are monitoring the services, it is usually required to have one or more connections defined. A connection is a way to connect to the host. This is used by services in order to run various checks. If the connection requires a username/password this can be specified either in the URL or in the corresponding properties "username"/"password". These are optional, but if used the properties take precedence over the URL specification.
"services":[
{
"name":"Memory",
"schedule":1,
"check":"Linux_getMemoryPercent('default');",
"alert":{
......
}
}
]
The services sub-section allows the specification of host services to be monitored. There can be any number of services associated with a host. More about configuring services in the [Understanding Services] page.