User Guide > User Guide > Configuring EMA > Examples of Modifying the Nagios EMA Configuration
Was this helpful?
Examples of Modifying the Nagios EMA Configuration
This section summarizes where to look for a specific customization of the EMA. Nagios does not automatically reread the configuration files when it is running, so you must restart Nagios after modifying files. You can restart Nagios at any time because it retains state between restarts.
WARNING!  Rerunning the installation setup script “install.sh” will overwrite changes made to the configuration files automatically generated by the EMA.
Note:  You can also perform the following tasks 1 through 4 by using the EMA web console, as described in Adding a Host and Instance Using the EMA Web Console.
1. Add a host and its corresponding installations to an existing configuration:
Run the “install.sh” command with the -a flag:
./install.sh -a
A dialog is displayed that requests the host name and installation information for the host to be added. The current configuration is updated with the new host information; no existing configuration information is changed. Do not attempt to add an existing host a second time.
2. Add another installation to an existing host:
Run the “install.sh” command with the -i flag:
./install.sh -i hostname
where hostname is an existing host configured in the EMA.
A dialog is displayed that requests new installations to be added to the existing configuration for that host. No currently configured installations on that host are modified, but you can specify an existing installation and the old settings will be replaced by the new settings.
3. Remove a host from the configuration:
Delete the hostname.cfg file and the host directory from …/nagios/etc/objects.
4. Remove an installation from a host:
Delete the installation “.cfg” file from ../nagios/etc/objects/hostname.
5. Delete a single service check:
Find the object definition file containing the service check you want to remove. Open the file and do one of the following:
Delete the text between containing the service check from “define service {“ to the ending “}”
Add a “register 0” property line.
The latter lets you retain the service check in the file for the future, but it will remain dormant.
6. Change the behavior of a specific Ingres service everywhere in the EMA:
You may need to make a site-wide change for a specific service check. For example, a site may want the transaction log usage warning check to alarm at 60% instead of 50%. Edit the ingres.cfg file and change the “check_command” setting to add a custom specification.
Example: Change from the default 50% warning to a 60% warning:
check_command     ema_check_ingres!--logfile
becomes
check_command     ema_check_ingres!--logfile -w 60
7. Change the behavior of a specific Operating System service everywhere in the EMA:
Like the Ingres service checks, the operating system services checks can be changed site-wide also. Edit the os_templates.cfg file and change the “check_command” setting to add a custom specification.
Example: Change the RAM warning from 10% free to 20% free:
check_command     ema_check_memory!-r -w 10 -c 5
becomes
check_command     ema_check_memory!-r -w 20 -c 5
8. Change the frequency of a service check:
To change a Nagios service setting, first find the setting in the Nagios documentation. In this example, the service check frequency is “normal_check_interval.” Individual service checks can specify a setting unique to the service check, inherit a setting from the installation, inherit a setting from the host, or inherit the setting from the generic service check across the entire site. In all cases, you add the “normal_check_interval” setting to the appropriate service definition.
9. Change a specific service:
Edit etc/objects/hostname/installation.code.cfg.
Example of a modified transaction log interval check:
define service{
    use               Generic-transactionlog,ingres-linux-I1
    service_description I1 Transaction Log
    normal_check_interval 5 ;  Set the check interval to 5 minutes
    }
10. Change a setting for every instance of a specific service check:
Edit etc/objects/ingres.cfg or os_templates.cfg.
Changing the template object affects every service that inherits that definition where the individual service check does not have its own setting.
Example:
define service{
        name                           Generic-transactionlog
        use                            generic-service,graphed-service
        servicegroups                  TransactionLogs
        service_description           Transaction Log
        check_command                  ema_check_ingres!--logfile
        event_handler                  ema_log_alarm_event
        normal_check_interval    5;    Set the check interval to 5 minutes
        register                 0
        }
11. Change a setting for every service for an installation:
Edit etc/objects/hostname/installation.code.cfg
This example differs from the previous one in where we place the setting. We use the installation side service template definition.
Example:
define service{    
        name                     ingres-linux-I1
        use                      ingres-linux
        servicegroups            IngresServers
        _II_SYSTEM               /opt/Ingres/IngresI1    ; II_SYSTEM for the remote site
        _PLUGINS                 /opt/Ingres/IngresI1/ingres/iiema/plugins
        normal_check_interval    5;     ; Set the check interval to 5 minutes
        register                 0
}
12. Change a setting for every service on the entire host:
Edit etc/objects/hostname/host.cfg
As before, we set the property in the host definition template.
Example:
define service{
        name                    ingres-linux
        use                     Generic-OS
        host_name               ingres-linux
        _HOSTPLUGINS            /opt/Ingres/IngresI1/ingres/iiema/plugins
        normal_check_interval   5    ; Set the check interval to 5 minutes
        register                0
}
13. Add or remove databases to the Checkpoint Status service for an installation:
Edit etc/objects/hostname/installation.code.cfg
Add or remove database names on the _DATABASE line. Separate each name with a space.
Example:
define service{
        use                     Generic-checkpoint,ingres-linux-GS
        service_description     GS Checkpoint Status
        _DATABASE               imadb newdb olddb
        }
}
14. Create my own commands and service checks:
Create new files in the “object” directory. The EMA uses and may overwrite the configuration files distributed with it, so we recommend that site specific customization be done in completely new “.cfg” files to avoid conflict with the built-in EMA services.
Last modified date: 02/02/2023