To integrate Nagios with st2, we will need to add a nagios event handler which POSTs a HTTP webbhook to st2.
The event handler script is available in etc/st2service_handler.py.
The event handler tries to register a trigger type first before sending any notifications to st2. This trigger type is then referenced in st2 rules. See rules/ for examples.
-
Pick the nagios host where you want the event handler to be placed.
-
Copy st2service_handler.py to /usr/local/nagios/libexec/
cp st2service_handler.py /usr/local/nagios/libexec/
-
Make sure st2service_handler.py is executable.
chmod +x /usr/local/nagios/libexec/st2service_handler.py
-
Handlers require a configuration file (See etc/st2service_handler.conf) containing st2 credentials, st2 API URL and st2 auth URL.