I’m trying to get Nagios Web Service Checker to work.
When it runs, nagios reports the status of the service being querried as (null) .
However if I run the script from bash it works
/usr/local/nagios/libexec# ./check_wsc_v12.pl -H 10.10.10.4 -r 10.10.10.4 -t ‘disks’ -p ''
Result: Disk(s) Okay
C:21.16GB/33.91GB (62% free)|
Here is my commands.cfg file:
#Nagios Web Service Checker v. 1.4
define command{
command_name check_wsc_v14
command_line /usr/local/nagios/libexec/check_wsc.pl -H ‘saturn.no$HOSTADDRESS$’ -r 10.10.10.4 -p ‘$ARG2$’ -t ‘$ARG1$’
}
Nagios Web Service Checker v.1.2
define command{
command_name check_wsc
command_line $USER1$/check_wsc_v12.pl -H ‘saturn.no$HOSTADDRESS$’ -r 10.10.10.4 -p ‘$ARG2$’ -t ‘$ARG1$’
}
Here is my entry in my host file:
define host{
use windows-server ; Inherit default values from a template
host_name TEST2 ; The name we’re giving to this host
alias TEST2@wmi ; A longer name associated with the host
address 10.10.10.4 ; IP address of the host
hostgroups windows-wmi2-test1
normal_check_interval 2 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
HOST GROUP DEFINITIONS
###############################################################################
Define a hostgroup for Windows machines
All hosts that use the windows-server template will automatically be a member of this group
define hostgroup{
hostgroup_name windows-wmi2-test1 ; The name of the hostgroup
alias Windows wmi test1; Long name of the group
}
SERVICE DEFINITIONS
###############################################################################
Create a service for monitoring the version of NSCLient++ that is installed
Change the host_name to match the name of the host you defined above
define service{
use generic-service
hostgroups windows-wmi2-test1
service_description disks_v1_4
check_command check_wsc_v14!disks!“1000,250”
}
define service{
use generic-service
hostgroups windows-wmi2-test1
service_description disks_v1_2
check_command check_wsc!disks!“1000,250”
}
define service{
use generic-service
hostgroups windows-wmi2-test1
service_description memory_v12
check_command check_wsc!Memory!“50%, 250, 10, 50%”
}
What am I missing?