• 0

How can I Monitor Windows Service with Dynamic Display Name?


TSchneider
 Share

Question

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.

image.png.db2450e2664bc5a7b9686feaa9387ebe.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1
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.

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

  • 1

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

Link to comment
Share on other sites

  • 0

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....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share