Primary Navigation
Update Device Description
| Description: | [Originally posted by Stanley Johnson] Updates a device's description with the SNMP description, contact and location information that resides on the device. We use a syslog passive monitor to trigger this whenever we receive a message that says "configured from console". | |
| Language: | VB Script/JScript | |
| Code: |
|
-----
- 1,364 views
- $obj.VersionIndex versions
- 10 replies
- 5 followers
- Post Date:
- February 23, 2011
- Posted By:
- Brittany Ross
About this forum
- 21,991 views
- 19 topics
- 4 followers
Viewed 1,364 times
Page Options
10 Replies
Merci !!
thanks !!
Can anyone currently using this confirm that it still works? It appears to execute properly, but does not actually update any attributes.
Hello,
Yes it still works, the attributes are updated .
The script must be added as active monitor
If we set it up as an active monitor what is used to trigger it?
As noted above, we use it as an action on a passive monitor so that we update the device details whenever somebody makes a change to the server. This seems to make the most sense as the "configured from console" syslog message only shows up when there has been a change to the actual device.
Thanks Stanley, I go that part, but when I tested it I get an initialization error.
If I set it up as an active monitor, as Nicolas stated, the test works but I do not know what would activate it under the active monitor.
Hello,
If you want to set it up as an active monitor, you need to add it to the active monitor library (Configure => Active Monitor Library => New => select Active Script Monitor => then you paste this code and select JSscript
then you can add this active monitor to all devices at the same time and 'use a different poll frequency' for this monitor (86400 sec for ex.)
or you activate it once for all devices and then deactivate it for all devices..
Nicolas.
Thanks everyone, we got it working last night on the passive "up" monitor.
I think I will include both so I can activate as needed when necessary.
Thanks heaps!
Thanks to Stanley for the script and Brittnay for posting it here. I do have one question about the attributes and if there is a possibility to add the attributes on the device automatically.
We needed to list the serial numbers of all our Cisco Switches (3560G's & a few 3500's). I was able to get the OID & Instance for the serial number from one of the 3560G's and below is what I've added to the original script to get this information:
-------------------------------------------------------------------------------------------------------------
//-------Do the Serial Number Attribute SNMP Get and DB updates.
var entPhysicalSerialNum = GetSNMPAttrib(nDeviceID,"1.3.6.1.2.1.47.1.1.1.1.11.1001","SerialNumber");
if (entPhysicalSerialNum != 1) {
if (SetDBAttrib(nDeviceID,"SerialNumber",entPhysicalSerialNum)==1) sSuccess=1;
}
else {
sSuccess=1;
}
-------------------------------------------------------------------------------------------------------------
The only issue I had with this was that when the script ran as an active monitor, I did not add the "SerialNumber" attribute on the device attributes and I was not able to see the device S/N. I had to manually add the SerialNumber attribute on the device and then apply the above script as an active monitor which then populated the SerialNumber Value.
Has anyone been able to use this script and at the same time create the attribute defined in the jscript if it was not already on the device.
I do know that I can select multiple devices and add the attribute I wanted using the buld field change; but I'm curious to see if anyone was able to get this working so that the attirbute gets created and populated with its respective value when the script pools for the OID's defined in it.
Would you like to comment?
You must be a member. Sign In if you are already a member.