Home Directory Addons Performance Bridge for Nagios to store plugins results

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Bridge for Nagios to store plugins results

Rating
0 votes
Favoured:
0
Hits
98899
Files:
FileDescription
check_any.php.gzbridge script

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

Do you need to store your plugin results and return status anywhere? Its a simple PHP script to use as a bridge between nagios and the final plugin.
Its usage is very simple:

Put the script check_any.php on the libexec nagios directory (review the owner, permissions, ...)
Edit the nagios checkcommands.cfg file and change the definition for all plugins for which you want to store the results as the example does:

Example:


Original definition:

define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}


New definition:

define command{
command_name check_ping
command_line $USER1$/check_any.php $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}


Logging

By default, this php script will log all plugin results at /usr/local/nagios/var/nagactiv.log.
Of course, you can use this script to store all results as you need (Data Base, RRD systems, ...)

The log file structure is:

DATE: 2005-05-30 17:12:43
COMMAND: /usr/local/nagios/libexec/check_ping -H 10.0.0.1 -w 100.0,20% -c 500.0,60% -p 5
RETURNED: 2
CRITICAL - Plugin timed out after 10 seconds

DATE: 2005-05-30 17:12:58
COMMAND: /usr/local/nagios/libexec/check_ping -H 10.0.0.2 -w 100.0,20% -c 500.0,60% -p 5
RETURNED: 2
CRITICAL - Plugin timed out after 10 seconds

DATE: 2005-05-30 17:13:12
COMMAND: /usr/local/nagios/libexec/check_ping -H 10.0.0.3 -w 100.0,20% -c 500.0,60% -p 5
RETURNED: 0
PING OK - Packet loss = 0%, RTA = 1.30 ms


The behaviour of Nagios is not affected.