One of the most exciting new features to me in SaltStack 2014.7 is the nagios module. This module supports remote execution of nagios-plugins on your minions. It can also execute pre-defined lists of checks and targets defined (and targeted) in a Pillar. Jinja templating and Grains can of course be used as well, making for an extremely versatile monitoring and testing solution.
I haven’t implemented anything crazy with it yet, but I am really seeing the power of this. A couple ideas off the top of my head:
- Service configuration best practices checklists
- Distributed connectivity tests
- Distributed latency reporting
I would like to build a very simple internal help desk service status page with no Nagios back-end requirement, perhaps even just running out of a
*/5 * * * * ... cron with the JSON output from
salt --out=json -s -G roles:monitoring nagios.run_all_pillar nagios_test redirected to a file in a web directory, then displayed to help desk techs via jQuery/HTML5 generated page with nice green/yellow/red statuses for each item monitored based on the return codes of the checks.
** Update: ** My doc changes have been committed! I’ve got one commit in SaltStack!
Below is a working simple sample nagios check Pillar and some output from when it is run.
This check Pillar can then be run with
salt nagios.\* nagios.run_pillar nagios_test, and produces output like below: