Send email when service is in unknown state

my understanding is alerts get triggered on “ok” “warning” “critical”… is it possible to alert email for a service when in “unknown” state…

context: In this case the array has an impending disk failure. So the array health is optimal (disk not yet failed), but the service shows as unknown.

assuming to do this would need db query for service_status = 3 on the relevant device/service

I’m not familiar with services having a state of “unknown” instead of the regular ok, warning or critical, but the default service alerts which I use for warning and critical (from the example alerts) simply test for services.service_status equal to 1 for warning or 2 for critical.

In that case you should just be able to test if services.service_status equalling 3, if that is indeed the correct value for “unknown”.

Alerts “recover” when the triggers no longer match.

Was overthinking it.

That’s done the trick thanks.