Looking to flag service state change. Service successfully flagged as:
wmi_service_state{instance="server:port",job="name",name="service name",state="running"} Value 1
stopping service the wmi_service_state does not change the value to 0.
unknown 0,continue pending 0,pause pending 0,paused 0,running 1,start pending 0,stop pending 0,stopped 0
Running Ver0.6.0 on Server 2016
example; changes(wmi_service_state{name="amazonssmagent",state="start pending"}[5m]) >1
Thanks for the example, but my point was i receive no state change to service state. Service was running "service name",state="running"} Value 1. Now stopped and I still have the same value "service name",state="running"} Value 1
I banged my head around this because I wanted to report on services that are down but are marked for "Automatic" startup.
Came up with the query below which works well in Grafana.
(avg_over_time(wmi_service_state{job="somejob",state="running"}[1m]))and ignoring(state, start_mode)(avg_over_time(wmi_service_start_mode{job="somejob",start_mode="auto"}[1m]) == 1)
Most helpful comment
I banged my head around this because I wanted to report on services that are down but are marked for "Automatic" startup.
Came up with the query below which works well in Grafana.
(avg_over_time(wmi_service_state{job="somejob",state="running"}[1m]))and ignoring(state, start_mode)(avg_over_time(wmi_service_start_mode{job="somejob",start_mode="auto"}[1m]) == 1)