<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="" xmlns:ns1="urn:schemas-microsoft-com:office:smarttags">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceName"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PostalCode"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Please forgive me as I am fairly new to Nagios and the world
of plugins. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>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.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>When I ssh into the box and run the .vbs script for CPU by
executing the following command:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>cscript //nologo c:\nrpe_nt\check_cpu.vbs -H testserver -w
80 -c 90<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I get the following:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>OK - Total CPU Utilization 2% |
'CPU_Utilization'=2%;80%;90%;;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>However, if I try the following command:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>./libexec/check_by_ssh –H testserver –C “cscript
//nologo c:\nrpe_nt\check_cpu.vbs -H testserver -w 80 -c 90”<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I get nothing returned, the prompt just comes back like it
ran the script but returned no result.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>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.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Any help would be greatly appreciated.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Laura<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p style='margin:0in;margin-bottom:.0001pt'><strong><b><font size=2
face="Times New Roman"><span style='font-size:10.0pt'>Laura Goodburn</span></font></b></strong><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>SMC Manager</span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>Information and Technology Services</span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>The <ns1:PlaceType w:insAuthor="lmgoodbu"
 w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
 w:endInsDate="2006-05-31T16:12:00Z"><st1:PlaceType w:st="on">University</st1:PlaceType></ns1:PlaceType>
of <ns1:PlaceName w:insAuthor="lmgoodbu" w:insDate="2006-05-31T16:12:00Z"
 w:endInsAuthor="lmgoodbu" w:endInsDate="2006-05-31T16:12:00Z"><st1:PlaceName
 w:st="on">North Carolina</st1:PlaceName></ns1:PlaceName> at <ns1:place
 w:insAuthor="lmgoodbu" w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
 w:endInsDate="2006-05-31T16:12:00Z"><ns1:City w:insAuthor="lmgoodbu"
  w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
  w:endInsDate="2006-05-31T16:12:00Z"><st1:City w:st="on"><st1:place w:st="on">Charlotte</st1:place></st1:City></ns1:City></ns1:place></span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'><ns1:Street w:insAuthor="lmgoodbu"
 w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
 w:endInsDate="2006-05-31T16:12:00Z"><ns1:address w:insAuthor="lmgoodbu"
  w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
  w:endInsDate="2006-05-31T16:12:00Z"
  ns0:style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x"
  ns0:tabIndex="0"><st1:Street w:st="on"><st1:address w:st="on">9201 University
    City Boulevard</st1:address></st1:Street></ns1:address></ns1:Street></span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'><ns1:place w:insAuthor="lmgoodbu"
 w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
 w:endInsDate="2006-05-31T16:12:00Z"><ns1:City w:insAuthor="lmgoodbu"
  w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
  w:endInsDate="2006-05-31T16:12:00Z"><st1:place w:st="on"><st1:City w:st="on">Charlotte</st1:City></ns1:City></st1:place>,
 <ns1:State w:insAuthor="lmgoodbu" w:insDate="2006-05-31T16:12:00Z"
  w:endInsAuthor="lmgoodbu" w:endInsDate="2006-05-31T16:12:00Z"><st1:State
  w:st="on">NC</st1:State></ns1:State> <ns1:PostalCode w:insAuthor="lmgoodbu"
  w:insDate="2006-05-31T16:12:00Z" w:endInsAuthor="lmgoodbu"
  w:endInsDate="2006-05-31T16:12:00Z"><st1:PostalCode w:st="on">28223</st1:PostalCode></ns1:PostalCode></ns1:place></span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>Phone (704) 687-8988</span></font><o:p></o:p></p>

<p style='margin:0in;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>lmgoodbu@uncc.edu</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>