SSH and Windows

Ralf Wigand Ralf.Wigand at rz.uni-karlsruhe.de
Thu Jun 1 12:13:10 CEST 2006


Hi Laura!

Try to start a command shell on the windows machine like:

check_by_ssh -H testserver -C "cmd.exe /c \"cscript //nologo (...) -c 90\""

this will start a cmd-shell and execute (/C) the command given in "", so
take care to escape the "" correct (not sure if my example works with
escaping by backslash). maybe using other ticks...

BTW: which WIN-SSH-Deamon do you use?

Ciao, ralf
________________________________________
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Goodburn,
Laura
Sent: Wednesday, May 31, 2006 10:25 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] SSH and Windows

Please forgive me as I am fairly new to Nagios and the world of plugins. 

I have a Windows box that is running ssh and I would like to connect via
ssh, run a wmi vbs script, and pass the result back to Nagios. I know that I
can call the check_by_ssh plugin and pass the script name for the command
parameter but I don't know how to pass the result back to the check_by_ssh
plugin.

When I ssh into the box and run the .vbs script for CPU by executing the
following command:
cscript //nologo c:\nrpe_nt\check_cpu.vbs -H testserver -w 80 -c 90

I get the following:
OK - Total CPU Utilization 2% | 'CPU_Utilization'=2%;80%;90%;;

However, if I try the following command:
./libexec/check_by_ssh -H testserver -C "cscript //nologo
c:\nrpe_nt\check_cpu.vbs -H testserver -w 80 -c 90"

I get nothing returned, the prompt just comes back like it ran the script
but returned no result.

Has anyone else ever written a custom plugin to pull the result back in via
ssh? For security concerns and traffic control, I would prefer to use ssh
instead of nrpe for running wmi scripts. Especially since we are trying to
make it so that the wmi scripts will only report the statistics for that box
instead of branching out to other Windows boxes on the subnet.

Any help would be greatly appreciated.

Thanks.
Laura

Laura Goodburn
SMC Manager
Information and Technology Services
The University of North Carolina at Charlotte
9201 University City Boulevard
Charlotte, NC 28223
Phone (704) 687-8988
lmgoodbu at uncc.edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7493 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060601/dcf2c48f/attachment.bin>


More information about the Users mailing list