Menu Close

How to discover and monitor a service with a wildcard for the service name

There are times when an application installs a Windows Service that uses inconsistent naming.  There might be a scenario where the Computer Name is inserted into the service name, or where random characters get generated in the service name.

I wrote about this previously here:


Now, I have a Visual Studio fragment to make this even easier.   This fragment will use a WMI based discovery that supports a partial name match with a wildcard, to discover instances of your service name as a property.  Then it includes a monitor which uses this class property and monitors the discovered service name.


You can download the fragment library here:

You can see fragments in action here:


In this scenario, I am going to use a built in service that uses random data in the service name.



You can use Silect MP Author or Visual Studio with VSAE for fragments.   I’ll be using Visual Studio in this example.

Create a new MP:



Add an existing item, and choose my new fragment “Combo.Class.Discovery.ServiceMonitor.Wildcard.WMIQuery.mpx”



In this fragment, we will need to replace the following items:


CompanyID and AppName are standard across all fragments. 

##ServiceNameWildcard## is what will go into the WMI query, that supports the operator for wildcards “%”.

In this example, since I want to discover and monitor any services that start with “UserDataSvc_”.  Therefore I will replace ServiceNameWildcard with “UserDataSvc_%”



For the UniqueID, this just needs to be something to keep this workflow unique, in case we want to reuse the fragment multiple times in the same MP.  Since this is my User Data Svc  service monitor, I will just use that.  (NO SPACES OR SPECIAL CHARACTERS ALLOWED)



That’s it!   Save it and Build it, and we are ready to deploy this MP.


If you look at Discovered Inventory, change target type to our new Demo App class view, you will begin to see new instances showing up:




Note the ServiceName property, with different names in each.  Also note they are monitored – because the built in service monitor in the fragment is enabled.



And we are generating good quality alerts:


Leave a Reply

Your email address will not be published. Required fields are marked *