Get a list of stopped windows services

Hi,

is there a way to get a list of all stopped windows services via LiveProxy? The windows services names should be generated from the detail information of Service Summary-Check.

Story behind:
After reboot some windows servers don’t start randomly windows services. That means, when a windows update reboot was done, I have to connect manually to 10…20 windows hosts to start 1…6 services.

To get this done automatically I would need a simple CSV-List with hostname/service name.

It’s not an option to create a single check for every windows service, as this would increase the number of service checks by 30%.

Many thanks in advance,
Thomas

To get a list of all hosts with stopped autostart services i would do something like this.

lq "GET services\nFilter: description = Service Summary\nColumns: host_name long_plugin_output\n" | grep -v "Stopped services: 0"

If there is a stopped service you get one line per host like this

HOST1;Autostart services: 86\nServices found in total: 304\nStopped services: edgeupdate, gupdate, MapsBroker, SCardSvr, sppsvc, WbioSrvc
HOST2;Autostart services: 86\nServices found in total: 304\nStopped services: SCardSvr, sppsvc, WbioSrvc
HOST3;Autostart services: 86\nServices found in total: 304\nStopped services: edgeupdate, gupdate, MapsBroker, SCardSvr

Now a little bit of AWK magic like this

-F "[-,:; ]+" '{print $1; s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print s}'

result

HOST1
edgeupdate gupdate MapsBroker SCardSvr sppsvc WbioSrvc 
HOST2
SCardSvr sppsvc WbioSrvc 
HOST3
edgeupdate gupdate MapsBroker SCardSvr 

This should be a good start for some scripting.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.