Guys
I made the changes and not getting any where
My commands
Code: Select all
define command{
command_name check_uptime
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c CheckUpTime -a MaxCrit=90d
}
define command{
command_name cpu_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c CheckCPU -a warn=80 crit=90 time=1m time=5m time=15m
}
define command{
command_name mem_check
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c CheckMEM -a warn=80 crit=90 time=1m time=5m time=15m
}
define command{
command_name check_servicestate
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c CheckServiceState -a ShowAll=$ARG1$
}
define command{
command_name check_explorer
command_line $USER1$/usr/local/nagios/libexec/check_procs -c 1:30 -C explorer
}
My services
Code: Select all
define service{
use generic-service
host_name TGCS011
service_description Uptime
check_command check_nrpe!check_uptime
}
define service{
use generic-service
host_name TGCS011
service_description CPU Load
servicegroups CPULoad
check_command check_nrpe!cpu_load
}
define service{
use generic-service
host_name TGCS011
service_description Memory Usage
servicegroups MemUsage
check_command check_nrpe!mem_check
}
define service{
use generic-service
host_name TGCS011
service_description W3SVC
servicegroups WEBServices
check_command check_nrpe!check_servicestate! W3SVC
}
define service{
use generic-service
host_name TGCS011
service_description Explorer
servicegroups explorer
check_command check_nrpe!check_explorer
}
This is my test machine once I get the check_nrpe commands set then I can modify the others.
In Nagios I get these as unknowns
TGCS011 Notifications for this host have been disabled
CPU Load Notifications for this service have been disabled UNKNOWN 02-17-2017 21:06:04 0d 0h 37m 26s 3/3 No handler for command: cpu_load
Explorer Notifications for this service have been disabled UNKNOWN 02-17-2017 21:07:49 0d 0h 37m 41s 3/3 No handler for command: check_explorer
Memory Usage Notifications for this service have been disabled UNKNOWN 02-17-2017 21:07:59 0d 0h 37m 31s 3/3 No handler for command: mem_check
Uptime Notifications for this service have been disabled UNKNOWN 02-17-2017 21:08:03 0d 0h 37m 22s 3/3 ERROR: Missing argument exception.
W3SVC Notifications for this service have been disabled UNKNOWN 02-17-2017 21:08:03 0d 0h 37m 27s 3/3 No handler for command: check_servicestate
When I run these from command line they all work
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGCS011 -t 30 -c CheckUpTime -a MaxCrit=90d
OK all counters within bounds.|'uptime'=5445810000;0;7776000000
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGCS011 -t 30 -c CheckCPU -a warn=80 crit=90 time=1m time=5m time=15m
OK CPU Load ok.|'1m'=0%;80;90 '5m'=1%;80;90 '15m'=1%;80;90
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGCS011 -t 30 -c CheckMEM -a ShowAll=long type=physical MinWarn=20% MinCrit=10%
OK: physical memory: Total: 4G - Used: 2.01G (50%) - Free: 1.99G (50%)|'physical memory %'=50%;20;10 'physical memory'=2061.89M;819.07;409.53;0;4095.36
root@tgcs017:/usr/local/nagios/etc/objects# /usr/lib/nagios/plugins/check_nrpe -H TGCS011 -t 30 -c CheckServiceState -a Showall=W3SVC
OK: All services are in their appropriate state.
Any ideas
Thanks