| | | Junior Member
       
Group: Forum Members Last Login: 3/11/2008 11:05:03 AM Posts: 13, Visits: 8 |
| One of my locations has 50+ switches and they decided to change their hostname naming convention. Now I have a bunch of misnamed devices in whatsup. The display name is typically discovered during the initial discovery if SNMP is configured; however, is there a way to "re-discover" the display name of the device while still maintaining all of its monitors, actions, etc such as through a polling script? I can obviously manually change each individual switch display name, but that would be time consuming.
Thanks, -Andy |
| | | | 
Time Traveler
       
Group: Forum Members Last Login: Today @ 1:50:07 PM Posts: 348, Visits: 6,611 |
| Hi! Download the script "Update Name" from the Ipswitch Active Script page ( http://www.ipswitch.com/support/whatsup_professional/scripts/index.asp ), or just cut and paste it into WhatsUp ;-) : // Name: Update device name // Description: Update device name based on SNMP sysName variable // Language: JScript var oSnmpRqst = new ActiveXObject("CoreAsp.SnmpRqst") ; var nDeviceID = Context.GetProperty("DeviceID") ; var oResult = oSnmpRqst.Initialize(nDeviceID) ; if (oResult.Failed) { Context.SetResult(1, "Initialization error " ) ; } else { var oResult = oSnmpRqst.Get("1.3.6.1.2.1.1.5.0"); // sysName.0 if (oResult.Failed) { Context.SetResult(1, "Couldn't get sysName.0 variable" ) ; } else { var oDb = Context.GetDB ; if (oDb == null) { Context.SetResult(1, "DB Connection error" ) ; } else { var oRs = new ActiveXObject("ADODB.Recordset"); var sSql = "UPDATE Device SET sDisplayName='" + oResult.GetPayload + "' WHERE nDeviceID = " + nDeviceID; oDb.Execute (sSql) ; } } } Regards, LLS71
--- Leonardo Schieder A. PORR AG - http://www.porr.at System Managementhttp://www.xing.com/go/invita/7686498 |
| | | | Junior Member
       
Group: Forum Members Last Login: 3/11/2008 11:05:03 AM Posts: 13, Visits: 8 |
| Perfect, that did exactly what I needed it to. Very helpful little script. Thank you. |
| |
|
|