News:

We really need your input in this questionnaire

Main Menu

SNMPSet

Started by AB3AI, March 25, 2018, 02:22:00 AM

Previous topic - Next topic

AB3AI

GE All,

I have a reset OID that i want to send to a node. The node sits behind a server with an agent running on it. All the DCIs are working fine. How would I send SNMPSet OID to the node to reset (or any other Set command)? I've searched this forum and Google. I've tried different Object Tools and Server Scripts and I can get it to work. Any help would be greatly appreciated.

Thanks!

Tursiops

You can create a script, which can then be called via Object Tools.
For example the following works to reboot Cisco routers:
snmpTransport = CreateSNMPTransport($node);
if ( snmpTransport == null ) return "Unable to connect";
returnValue = SNMPSet(snmpTransport,"1.3.6.1.4.1.9.2.9.9.0","2","INTEGER");
if ( returnValue == null ) return "No response. Something went wrong.";
if ( returnValue == 0 ) return "Unable to initiate reload. No SNMP Write Access?";
if ( returnValue == 1 ) return "Reload triggered.";


In the Object Tools configuration, you create a new Tool of type Server Script and call the script you saved by name. So if the above was called "ReloadCisco" in your Script Library, then that's what you'd call.
You will probably also want to filter the Object Tool to ensure it doesn't show against systems that can't handle it.
And of course you have to have SNMP Set/Writes enabled on the device and have that community configured on the node in NetXMS.


AB3AI

Tursiops,

Thanks for the reply! I had a chance to try your script. I followed the instructions to implement the script and I all received was a message that it executed successfully. The camera did not reset and I also tried it on a switch. I double checked the write community string. I'm going to have to double check again and make sure I have everything set up correctly.

Thanks!!