Answered by:
Windows Services - wildcard monitoring

Question
-
Hi
We have windows services starting the name in GPS....%
How do I create monitor for this issues , because creating individual is too much
The services is more than 50 with the same naming convention
My I know if possible through wildcard %
GPS001
GPS002
GPS003
GPS00........
Help.Me
Wednesday, July 4, 2018 11:59 AM
Answers
-
Two options :
- Create a custom class and discovery for these services, and use the wildcard in the discovery. That way you will discover all the services as distinct instances of this custom class, and you will be able to target your monitor at these instances and use their "name" variable property in the Service name field.
- Create a scripted monitor with someting like
Get-Service -Name "gps*" | Where-Object {$_.Status -eq "Stopped"}
and trigger an alert if result is not null.
- Proposed as answer by Sameer Mhaisekar Wednesday, July 4, 2018 12:07 PM
- Marked as answer by Stoyan ChalakovMVP Friday, September 14, 2018 2:02 PM
Wednesday, July 4, 2018 12:06 PM -
You could start by reading these articles, they are not exactly what I suggested but close enough and will provide you with quite a lot to understand in the first place.
https://www.bictt.com/blogs/scom-monitoring-multiple-services-running/
https://blogs.technet.microsoft.com/brianwren/2008/03/08/using-wildcards-with-the-windows-service-template/
- Proposed as answer by Sameer Mhaisekar Thursday, July 5, 2018 7:43 AM
- Marked as answer by help.me.please Sunday, January 19, 2020 4:01 PM
Thursday, July 5, 2018 6:55 AM
All replies
-
Two options :
- Create a custom class and discovery for these services, and use the wildcard in the discovery. That way you will discover all the services as distinct instances of this custom class, and you will be able to target your monitor at these instances and use their "name" variable property in the Service name field.
- Create a scripted monitor with someting like
Get-Service -Name "gps*" | Where-Object {$_.Status -eq "Stopped"}
and trigger an alert if result is not null.
- Proposed as answer by Sameer Mhaisekar Wednesday, July 4, 2018 12:07 PM
- Marked as answer by Stoyan ChalakovMVP Friday, September 14, 2018 2:02 PM
Wednesday, July 4, 2018 12:06 PM -
Two options :
- Create a custom class and discovery for these services, and use the wildcard in the discovery. That way you will discover all the services as distinct instances of this custom class, and you will be able to target your monitor at these instances and use their "name" variable property in the Service name field.
- Create a scripted monitor with someting like
Get-Service -Name "gps*" | Where-Object {$_.Status -eq "Stopped"}
and trigger an alert if result is not null.
having said that, just to clear it up - you can't do that with GUI service monitor ;)
Cheers,
Cpt. Obvious ;)
Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar
- Edited by Sameer Mhaisekar Wednesday, July 4, 2018 12:10 PM
Wednesday, July 4, 2018 12:09 PM -
Thanks for Info
Do you have any procedure for that , because I'm just new in SCOM
I highly appreciate if you can provide me a screenshot and step by step
Thanks in Advance
Help.Me
Thursday, July 5, 2018 6:52 AM -
You could start by reading these articles, they are not exactly what I suggested but close enough and will provide you with quite a lot to understand in the first place.
https://www.bictt.com/blogs/scom-monitoring-multiple-services-running/
https://blogs.technet.microsoft.com/brianwren/2008/03/08/using-wildcards-with-the-windows-service-template/
- Proposed as answer by Sameer Mhaisekar Thursday, July 5, 2018 7:43 AM
- Marked as answer by help.me.please Sunday, January 19, 2020 4:01 PM
Thursday, July 5, 2018 6:55 AM -
I ran into this issue just recently. I was able to use Tao Yangs Ops Manager Extended Powershell module . The only downside is that it doesn't create a discovery and so the service must exist on the servers. If it doesn't exist on the server, it will alert.
http://blog.tyang.org/2015/06/24/automating-opsmgr-part-1-introducing-opsmgrextended-powershell-sma-module/
Tuesday, July 10, 2018 1:47 PM