<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name="Microsoft Theme 2.00" content="capsules 011">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri","sans-serif";
color:black;}
h1
{mso-style-priority:9;
mso-style-link:"Heading 1 Char";
margin-top:24.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:16.0pt;
font-family:"Calibri","sans-serif";
color:black;}
h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h3
{mso-style-priority:9;
mso-style-link:"Heading 3 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h4
{mso-style-priority:9;
mso-style-link:"Heading 4 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h5
{mso-style-priority:9;
mso-style-link:"Heading 5 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
h6
{mso-style-priority:9;
mso-style-link:"Heading 6 Char";
margin-top:10.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
font-weight:normal;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#000099;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#339966;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Calibri","sans-serif";
color:black;}
span.EmailStyle17
{mso-style-type:personal-compose;
color:black;}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-priority:9;
mso-style-link:"Heading 1";
font-family:"Arial","sans-serif";
color:black;
font-weight:bold;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Arial","sans-serif";
color:black;}
span.Heading3Char
{mso-style-name:"Heading 3 Char";
mso-style-priority:9;
mso-style-link:"Heading 3";
font-family:"Arial","sans-serif";
color:black;}
span.Heading4Char
{mso-style-name:"Heading 4 Char";
mso-style-priority:9;
mso-style-link:"Heading 4";
font-family:"Arial","sans-serif";
color:black;}
span.Heading5Char
{mso-style-name:"Heading 5 Char";
mso-style-priority:9;
mso-style-link:"Heading 5";
font-family:"Arial","sans-serif";
color:black;}
span.Heading6Char
{mso-style-name:"Heading 6 Char";
mso-style-priority:9;
mso-style-link:"Heading 6";
font-family:"Arial","sans-serif";
color:black;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white background="cid:image001.gif@01C86E25.37D4AFF0" lang=EN-US
link="#000099" vlink="#339966">
<img src="cid:image001.gif@01C86E25.37D4AFF0"
v:src="cid:image001.gif@01C86E25.37D4AFF0" v:shapes="_x0000_Mail" width=0
height=0 class=shape style='display:none;width:0;height:0'><!--[if gte mso 9]><xml>
<v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="800,600">
<v:fill src="cid:image001.gif@01C86E25.37D4AFF0" o:title="captext" type="frame" />
</v:background></xml><![endif]-->
<div class=Section1>
<p class=MsoNormal>I am a relative newbie to nagios. I have written
several scripts to monitor Windows hardware. They are written in windows
scripting language. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>When the scripts exit I get the correct warnings and
critical messages sent out but the exit code that is returned will not change
the status of the nagios screen. It always appears as OK.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>The exit command I use is this:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Const intOK = 0<o:p></o:p></p>
<p class=MsoNormal>Const intWarning = 1<o:p></o:p></p>
<p class=MsoNormal>Const intCritical = 2<o:p></o:p></p>
<p class=MsoNormal>Const intError = 3<o:p></o:p></p>
<p class=MsoNormal>Const intUnknown = 3<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Select Case outCode<o:p></o:p></p>
<p class=MsoNormal>
Case 0<o:p></o:p></p>
<p class=MsoNormal>
outText="OK" & outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Echo outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Quit(intOK)<o:p></o:p></p>
<p class=MsoNormal>
Case 1<o:p></o:p></p>
<p class=MsoNormal>
outText="DISK WARNING" & outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Echo outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Quit(intWarning)<o:p></o:p></p>
<p class=MsoNormal>
Case 2<o:p></o:p></p>
<p class=MsoNormal>
outText="DISK CRITICAL" & outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Echo outText<o:p></o:p></p>
<p class=MsoNormal>
WScript.Quit(intCritical)<o:p></o:p></p>
<p class=MsoNormal>End Select<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Like I said the status information appears correct, but the
status remain OK.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Example:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Status Information<o:p></o:p></p>
<p class=MsoNormal>DISK CRITICAL - C: Disk Size: 34GB, Free Space: 27GB (80%),
D: Disk Size: 31GB, Free Space: 31GB (100%), E: Disk Size: 3GB, Free Space: 0GB
(3%), <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>But the status remains OK. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I have verified that the WScript.Quit code is correct.
I have Written it to the end of the Status Information line. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Any clues??<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thank you<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Kevin<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>