Difference between revisions of "SNMP Access Using Scripts"
From Observer GigaFlow Support | VIAVI Solutions Inc.
Kevin Wilkie (Talk | contribs) (Created page with "Querying a number from an infrastructure device var ip="83.70.199.182" var thisDevice = actions.getDevice(ip); if (thisDevice != null) { var uptime = actions.querySNMPNum...") |
Kevin Wilkie (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | Querying a number from an infrastructure device | + | Querying a number (uptime in this case) from an infrastructure device |
var ip="83.70.199.182" | var ip="83.70.199.182" | ||
var thisDevice = actions.getDevice(ip); | var thisDevice = actions.getDevice(ip); |
Revision as of 09:39, 23 January 2017
Querying a number (uptime in this case) from an infrastructure device
var ip="83.70.199.182" var thisDevice = actions.getDevice(ip); if (thisDevice != null) { var uptime = actions.querySNMPNumber(thisDevice, '.1.3.6.1.2.1.1.3.0', -1); log.warn('Uptime for device ' + ip+" "+thisDevice.getName()+" "+uptime); }else{ log.warn("No such managed device "+ip); }