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

Directory Tree

Bridge for Nagios to store plugins results

Rating
0 votes
Favoured:
0
Hits
102955
Files:
FileDescription
check_any.php.gzbridge script
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
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.