Page 1 of 1

Exit code problem with check_mk

Posted: Mon Jun 29, 2015 4:18 am
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?

Re: Exit code problem with check_mk

Posted: Mon Jun 29, 2015 9:02 am
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?