List all the Devices running specific service

From Zenoss Wiki
Revision as of 13:56, 20 November 2013 by Crouthamela (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

We might come across a scenario where we wish to list all the devices which are running certain service. One can tackle such request with few lines of codes.

for d in dmd.Devices.getSubDevices():   
   for s in d.os.winservices():      
     if"XXXXX": ,s.getStatusString()

Replace XXX with desired service name. Use above code with ZenDMD and get the desired list.