Integrating CitoEngine with 3rd party tools¶
CitoEngine can be easily integrated with existing monitoring systems. All integration scripts mentioned here can be found at integerations tools repository.
Nagios¶
QuickStart¶
- Define an event in CitoEngine UI -> Events -> Define an event
- Add a custom Nagios variable called _CITOEVENTID in the service definition as shown below:
define service {
service_description Total Processes
_CITOEVENTID 666
check_command check_local_procs!250!400!RSZDT
contact_groups +admins
use local-service
}
- Add the citoengine user to your notification group, in this example we will add the contact to the group admins:
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members bofh,citoengine
}
Note
Same logic applies for host definitions.
- Copy citoengine.cfg to your nagios’ directory and include it in nagios.cfg.
- Edit the citoengine.cfg file and replace the server and port to their actual values.
- Copy event_publisher.py script to /usr/local/bin/ and make it executable.
Bulk update of service definitions¶
If you have a lot of service definitions then the above steps may prove very tedious. To help you around this we an use a helper script called cito_config_parser.py. This script runs in two modes, one where it parses an existing service definition file and other where it updates the service definition file with the relevant event_id’s exported from CitoEngine. Here is how you can do it:
- Parse the existing service definition file:
cito_config_parser.py --type nagios -c services.cfg --parse --out my-services.txt
- Copy the output of my-services.txt into CitoEngine -> Tools -> Add events in bulk
- Select your Team, Severity, Category, etc and hit submit.
- The next page shows you a list of forms for each service definition you pasted above. Go through it carefully, modify it and hit submit.
5. Go to CitoEngine UI -> Events, select your Team check the Export CSV checkbox and hit search. The UI will give a CSV file of all your team’s events. Save this locally and have a quick look at it to confirm everything is in order.
- Generate the new services config using the following command:
cito_config_parser.py --type nagios -c services.cfg --events-file events.csv --generate --out new_services.cfg
Note
Do not run the --generate command on a previously configured services.cfg which already has _CITOEVENTID added. Always use the original service definition file.
Note
Sensu support will be released shortly.