Exit code problem with check_mk

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
brst07
Posts: 1
Joined: Mon Jun 29, 2015 4:10 am

Exit code problem with check_mk

Post by brst07 »

Hi,

I'm using check_mk to send check result back to nagios, the powershell script I use is something like this :

try{
$ie = New-Object -com internetexplorer.application
$ie.navigate($url)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.visible = $false
$isError = $ie.LocationName.CompareTo("Index")
$ie.Quit()
Remove-Variable ie
}
catch [Exception] {
return $_.Exception.Message
}

if ( $isError )
{
Write-Host CRITICAL - page KO
[Environment]::Exit(“2”)
}
else
{
Write-Host OK - page OK
[Environment]::Exit(“0”)
}

I tested in local machine , everything works just fine. However, in Nagios it always shows "CRITICAL" no matter what the exit code is.
Anyone has similar problem?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Exit code problem with check_mk

Post by jdalrymple »

No doubt it sounds like there is a disconnect between your plugin (or whatever that is) and Nagios, but too little information here for me to make sense of what's going on. You'll have to be more descriptive about how this information gets to Nagios for us to be able to help.

The check_mk experts would be over here. It might be a better place to start?
Locked