Many network probes such as interface_traffic, snmpget and others
support various methods of import like formatted text or a /etc/hosts
formatted file. Unfortunately this is not supported by the
cisco_monitor. I looked over the proposals for the next version and it
will support this feature.
You may, however, create a small NAS
script that will generate the configuration for you, or at least help
you speed up the process abit. Note that this requires nas version 3.x.
-- cisco_monitor (host,snmpversion,params,...)
-- usage:
-- version=1 => cisco_monitor("myhost",1,"mycommunity")
-- version=2c => cisco_monitor("myhost",2,"mycommunity")
-- version=3 => cisco_monitor("myhost",3,"myuser","mypassword","SHA")
--
-- returns status-code, 0=ok
function cisco_monitor (name,version,p1,p2,p3)
pname = "/profiles/"..name
community = "public"
user = ""
pass = ""
auth = "none"
cfg = pds.create ()
if version ~= 3 then
community = p1
else
user = p1
community = p2
auth = p3
end
if community == nil then
community = "public"
end
pds.putString (cfg,pname.."/active","yes")
pds.putString (cfg,pname.."/name",name)
pds.putString (cfg,pname.."/host",name)
pds.putString (cfg,pname.."/group","Default Group")
pds.putString (cfg,pname.."/interval","5min")
pds.putString (cfg,pname.."/retries","3")
pds.putString (cfg,pname.."/timeout","30")
pds.putString (cfg,pname.."/version",version)
if version ~= 3 then
pds.putString (cfg,pname.."/community",community)
else
pds.putString (cfg,pname.."/user",user)
pds.putString (cfg,pname.."/community",community)
pds.putString (cfg,pname.."/auth",auth)
end
args = pds.create()
pds.putString(args,"name","cisco_monitor")
pds.putPDS (args,"as_pds",cfg)
rs,rc = nimbus.request (target_robot,"probe_config_set",args)
pds.delete(args)
pds.delete(cfg)
return rc
end
-- !! Remember to change target robot address !!
target_robot = "/Domain/Hub/Robot/controller" -- eg /MyDomain/MyHub/xptest/controller
cisco_monitor ("casetest1",1,"public")
cisco_monitor ("casetest2",3,"myuser","mypass","SHA")