Problems with check_wsc


#1

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?


#2

Ok, I got it to work now. I needed to use version v1_1 of the check_wsc.pl script. When I run it I it send this request to the web-server (from my IIS weblog).

2008-11-13 07:50:55 W3SVC1 HK04 10.10.10.4 GET /nagios/service1.asmx/disks server=10.10.10.4&param=1000,250 80 - 10.10.10.83 nagios-check_wsc+1.1.0 - 10.10.10.4 200 0 0

However when I run version 1.2 or 1.4 of the script the “params” (parameters) have a “%22” added to it. My guess is that this could be number 22 in the ASCII table which is a quotation mark.

  • by removing the ’ sign around the variables in the “checkcommands.cfg”/“commands.cfg” i got it to work.