Windows_exporter: Service state montoring

Created on 25 Feb 2019  路  3Comments  路  Source: prometheus-community/windows_exporter

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

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)

All 3 comments

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

james-m-tubbs picture james-m-tubbs  路  6Comments

finkr picture finkr  路  3Comments

benridley picture benridley  路  5Comments

mango19b picture mango19b  路  4Comments

wizardmatas picture wizardmatas  路  5Comments