Forum Discussion

TSchneider's avatar
5 years ago

How can I Monitor Windows Service with Dynamic Display Name?

I have a windows service that the Display name is dynamically appended with the PID each time the service restarts.

I need to monitor this service, however, every time the service is started the Display name changes as the process PID changes.  

Is there a way to monitor the service by service name and NOT by display name?  All I can get to work is the display name.

  • I believe we might be doing what you want in our environment (it uses the service name & not its display name).
    Another reason for creating this custom data source was to don't consume so many WMI resources for each box (since it was doing pretty much 1 query per service/instance) on the out of box DS.
    We've came up with a custom one that does a single WMI query (via groovy) to get all the services & then process the output... 

    This reduced the WMI load substantially since we discover all the services running on a server (as an MSP this is way easier in terms of management).
    We can then use AD filters to filter stuff globally and/or make use of the token to filter stuff individually (group level/resource level).

    Not sure if it helps you out but, here you go

  • 5 minutes ago, mnagel said:

    The normal way I monitor services is via AD, but you would end up with a new instance wildvalue each time it was changed if you use the normal option (WMI-based datasource).  If you use Groovy script DS instead, you could strip the PID portion to build the wildvalue so that the data is stable.  There should be some examples of that in the existing datasource repo, need to dig around....

    Many examples of using WMI from Groovy, none that select from Win32_Service, but should be simple enough to adjust the query.  See Microsoft_LyncServer_StorageService as one example.

  • The normal way I monitor services is via AD, but you would end up with a new instance wildvalue each time it was changed if you use the normal option (WMI-based datasource).  If you use Groovy script DS instead, you could strip the PID portion to build the wildvalue so that the data is stable.  There should be some examples of that in the existing datasource repo, need to dig around....