dustin.lawler

Lua script to change probe intervals...

Discussion created by dustin.lawler on Dec 2, 2011

A couple of years ago I had a customer who needed to run the Interface Traffic probe at 2 second intervals during business hours but then wanted it to run at 30 second intervals outside of those times. To meet this request I reached out to Jim Christensen and had him throw together a script that would insert new times into the probe based off a schedule I defined in the NAS.

 

With the script below I had two copies, one for each desired interval change:

 

-- Script to change the polling interval of a probe -- Replace the NimBUS address here with the correct one for the customer addr = "/YOUR_DOMAIN/YOUR_HUB/YOUR_ROBOT/controller"  cmd = "probe_config_set"  -- the required arguments to a nimbus.request() are required to be sent in a PDS object -- the probe_config_set command needs the probe name, config file section, the key, and the value myArgs=pds.create() -- probe name pds.putString(myArgs,"name", "interface_traffic") -- config file section pds.putString(myArgs,"section", "setup") -- key pds.putString(myArgs,"key", "interval") -- value pds.putString(myArgs,"value", "30")   nimbus.request(addr,cmd,myArgs)  pds.delete (myArgs)  -- Deactivate the probe  cmd = "probe_deactivate"  myArgs=pds.create() -- probe name pds.putString(myArgs,"name", "interface_traffic")  nimbus.request(addr,cmd,myArgs)  --Active the probe cmd = "probe_activate" nimbus.request(addr,cmd,myArgs)  pds.delete(myArgs)

 

I've had three requests for this script (or something similar to it) within the last two weeks and figured I'd post it here so everyone could benefit!

 

Dustin

Outcomes