[Nagiosplug-help] Status in Nagios Not Changing

Thomas Guyot-Sionnest dermoth at aei.ca
Thu Feb 14 06:24:55 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/02/08 11:45 AM, Kevin Nilsson wrote:
> I am a relative newbie to nagios.  I have written several scripts to
> monitor Windows hardware.  They are written in windows scripting language. 
> 
>  
> 
> 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.
> 
>  
> 
> The exit command I use is this:
> 
>  
> 
> Const intOK = 0
> 
> Const intWarning = 1
> 
> Const intCritical = 2
> 
> Const intError = 3
> 
> Const intUnknown = 3
> 
>  
> 
>  
> 
>  
> 
> Select Case outCode
> 
>             Case 0
> 
>                         outText="OK" & outText
> 
>                         WScript.Echo outText
> 
>                         WScript.Quit(intOK)
> 
>             Case 1
> 
>                         outText="DISK WARNING" & outText
> 
>                         WScript.Echo outText
> 
>                         WScript.Quit(intWarning)
> 
>             Case 2
> 
>                         outText="DISK CRITICAL" & outText
> 
>                         WScript.Echo outText
> 
>                         WScript.Quit(intCritical)
> 
> End Select
> 
>  
> 
>  
> 
> Like I said the status information appears correct, but the status
> remain OK.
> 
>  
> 
> Example:
> 
>  
> 
> Status Information
> 
> 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%), 
> 
>  
> 
>  
> 
> But the status remains OK. 
> 
>  
> 
> I have verified that the WScript.Quit code is correct.  I have Written
> it to the end of the Status Information line. 

You can look at various vbscripts in nagiosexchange.org, I've used the
skeleton of one of them once and it worked fine in NRPE_NT.

I also wrote a batch file recently (run under NC_Net) and it without
testing without it I used EXIT /B which also set %ERRORLEVEL% (There
seems to be two different ways to get the ERRORLEVEL in Windows NT).

Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHs9Cm6dZ+Kt5BchYRAk1jAKD99nwfe8yj2/+NZAhsslFv57ocBQCgqL2D
ZmaHAJT+Uv1JeB8WrNQo5dU=
=oh8E
-----END PGP SIGNATURE-----




More information about the Help mailing list