Get Robots Based on OS into a CSV File

book

Article ID: 35034

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

Summary: 

You can run an auto-operator script to produce a csv format output file containing a Windows robot list using the script in this procedure.  This example returns Windows robots but this can be changed to get all robots or robots for a different OS type.


Environment:
  

8.x


Instructions:
 

Follow these steps:

  1. In Infrastructure Manager open the GUI for the nas probe.
  2. Click on the Auto-Operator tab. 
  3. Check the Activate Auto-Operator checkbox if not checked already.
  4. Click on the Scripts tab and create a new script.
  5. Paste the following script and adjust for fname path and click on the green arrow to execute.
     
probe = "hub"
callback = "getrobots"
 
fname = "C:\\robots.csv"
file.create(fname)
buff = ""
local args = pds.create()
pds.putString(args,"name","")
rl = nimbus.request(probe,callback,args)
 
for k,v in pairs(rl) do
   if type(v) == "table" then
      for a,b in pairs(v) do
         if b.os_major == "Windows" then
         buff=buff..b.name..",\t"..b.os_major..",\t"..b.os_minor.."\n"         
         file.write(fname,buff)    
          print (b.name," "..b.os_major)
 
       end
      end
   end
end
pds.delete()

Environment

Release:
Component: UIMNAS