 vote
 |
|
A Nagios plugin is presented here, along with skeleton code that you can adapt for your own custom module.
The skeleton plug-in is shown in Listing 3. For a simple plug-in, just copy the code, edit the progname, copyright, and email values, and write the get_value() function that returns the value to be checked. The API is similar to str2range(), it returns false (zero) if the value cannot be read, true (non-zero) if it can be read, and sets the value passed by reference. An example get_value() function that reads the ACPI temperature from the /proc psuedo-filesystem is shown in Listing 4.
| | |
| |
|
|