Windows_exporter: Windows Services - Report against Degraded State

Created on 15 Mar 2018  路  12Comments  路  Source: prometheus-community/windows_exporter

Hi,

How can I query windows services in a "degraded" state? Nagios is able to do this which I am trying to replace with Prometheus :) Not found any values that would tell me a windows service is running in a degraded status.

Thanks :)

Pete

feature-request help wanted question

Most helpful comment

I feel helping to reduce number of nagios installs is a good cause. I have had my share of troubles with nagios in my days, too.

All 12 comments

Well, I guess the question is what Nagios means by "degraded"? This is, as far as I am aware, not a state which Windows itself has. So Nagios must be combining multiple points of information?

Okay, this should be easy to implement.

We already have collector/service.go exporting some values from Win32_Service.

We just need to extend it to also include the value of Status:

    Data type: string
    Access type: Read-only
    Qualifiers: MaxLen (10), DisplayName ("Status")

    Current status of the object. Various operational and nonoperational statuses can be defined.
Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-
enabled hard disk drive, may be functioning properly but predicting a failure in the near future).
Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service",
could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative
work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other
states.

That would be great.

We have a few in house services that randomly fall over but still appear to be running.

Historically we see this from the status of the service with what nagios is reporting so we can take the appropriate action.

Cheers

Pete

I feel helping to reduce number of nagios installs is a good cause. I have had my share of troubles with nagios in my days, too.

Ah, I misunderstood. I was thinking about State, not Status. Obviously different things (naming things is hard, right?).
The cardinality of the service metrics will get pretty high if we add all the listed ~states~ statuses, though, and I'm not sure how many of them overlap with the state already. Should we start with just a gauge wmi_service_degraded{name="<service-name>"} 0/1, or is there value in having the others too?

I would see the behaviour inline with how Service state operates.

example:

wmi_service_status{name=",status="OK"} 0
wmi_service_status{name=",status="Degraded"} 1
wmi_service_status{name=",status="Error"} 0

Possible values:

OK ("OK")
Error ("Error")
Degraded ("Degraded")
Unknown ("Unknown")
Pred Fail ("Pred Fail")
Starting ("Starting")
Stopping ("Stopping")
Service ("Service")
Stressed ("Stressed")
NonRecover ("NonRecover")
No Contact ("No Contact")
Lost Comm ("Lost Comm")

Yes, that is the other option. It does increase the number of metrics rather a lot, though, so I just wanted to have the discussion on if the data is valuable, or if it largely mirrors the service_state metric anyway.

Is there anything further that needs discussion before a decision can be made on how this is implemented ? Cheers Pete

Are there any plans for this being in the 0.3.0 release? Just trying to plan ahead updating of the exporter.

It was not included in 0.3.0 (which was released on Friday last week). When I or someone else can find time to implement it, it will get included in the next version.

Looking forward to this being unplanted.

My nagios monitoring is all but decommissioned and only monitoring sub service states.

Would love to be able turn it off :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fischerman picture fischerman  路  4Comments

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

amitsaha picture amitsaha  路  5Comments

carlpett picture carlpett  路  7Comments

szymon3 picture szymon3  路  5Comments