Hello,

I have several custom sensors, that check various things but I was wondering if there was a way of returning the value when the condition is in an error state? When the sensor is up and green, it returns the value to the device overview page with no problems.

Here is an image showing what I mean: https://dl.dropboxusercontent.com/u/3265030/Capture.PNG

The OK check shows the value, but the error state does not. If however, I go into the sensor details I can see the returned value so why doesn't it should on the device summary page?

https://dl.dropboxusercontent.com/u/3265030/Capture2.PNG

Here is the end part of my PowerShell script, which I think should work as they are both the same for exit 0 and exit 2:

if ($daystoExpiry -le "60")
{
    Write-Host $daystoExpiry" days until expired"
    exit 2
}
else
{
    Write-Host $daystoExpiry" days until expired"
    exit 0
}

Article Comments

Hello,

thank you very much for your KB-Post. Instead of returning an error from the script if the value is too high, please try working with Error- or Warning-Limits in the Channel Settings here. So use exit 2 only if the sensor can't get the value at all, and for all numerical results use the limits in the Channel Settings. That should work better.

best regards.


Jul, 2013 - Permalink