scoutapp/scout-client — pull request #26 by itsderek23 (2014-10-10 17:45:12+00:00)
Title: Nagios

![nagios](https://cloud.githubusercontent.com/assets/7880/4596507/1476c41c-50a4-11e4-8444-2438dcbd112f.jpg)

This is the start of adding Nagios plugin support to the agent.

The agent parses `/etc/nagios/nrpe.cfg` for commands:

`command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20`

...and reports them as local plugins w/the plugin_name = the command name (ex: check_load).

Like [Munin Support](https://github.com/scoutapp/scout-client/pull/25), I'm thinking a `--nagios` flag. With no value, commands are fetched from `/etc/nagios/nrpe.cfg`. Otherwise, commands are fetched from the provided config path.

The parsing logic is based off the Nagios Wrapper scout plugin. Note that something looks off with the disk check:

root@51c3b18de511:/scout-client# /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
DISK OK - free space: / 12393 MB (78% inode=-);| /=3468MB;13120;14760;0;16400

Reports fields to Scout as: `/=3468`. Free space and inode usage aren't reported.

## Known issues

* disk parsing issue above
* skip over commands that parse remote arguments
* some error checking to ensure the specified executable exists for each command