I¹m trying to finish my crusade in monitoring windows services so I wrote up
the CLI probe that calls the following script (it¹s a draft):

#!/bin/sh
# Expects wmi-service.sh ${ADDRESS} ${Service Name} ${State} ${Domain}
${Username} ${Password}

result=`wmic -U $4/$5%$6 //$1 "Select Name,State from Win32_Service where
name='$2'" | awk -F\| -v msx=$2 '$0 ~ msx {print $2}'`

echo "\{ \$RealState := \"$result\", \$addr := \"$1\" } "

For some reason, the result variable does not get passed back into the
probe. If I take out the first \ in the echo I can actually see what¹s being
passed back into the probe

Reason: { $RealState := "", $addr := "10.1.0.16" }

Changing $result in the echo string to $1 (or any other field variable)
actually passes back the value. Is that a bug or is it designed not to pass
back anything except field variables?

Andrey
__________________________________________________________
Andrey Gordon | Integrity Interactive | Network Engineer | +1.781.398.3518


____________________________________________________________________
List archives:
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]

Reply via email to