Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Bridge for Nagios to store plugins results
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.
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.
Reviews (0)
Be the first to review this listing!