| The script was modified from one of the scripts here that Ambar had provided - it just needed to be modified to use a GetNext instead of Get. It is JScript - the attached document contains instructions and the script. ------------------------------- // Sending log message to the WhatsUp Event Viewer Context.LogMessage("Checking Address=" + Context.GetProperty("Address")); // ---This is the OID of the statistics table we want to monitor. We will use a GetNext as the // IP SLA format is <operation-number><Capture Start Time> which will change every hour. This script //assumes that the device is only keeping the most recent statistics as we are storing them in //WhatsUp Gold. Refer to the CISCO-RTTMON-MIB at // http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&mibName=CISCO-RTTMON-MIB var sOidRTTMon = "1.3.6.1.4.1.9.9.42.1.3.1.1.10" var nValueToGraph = 0; var nDeviceID = Context.GetProperty("DeviceID"); // Initialize the SNMP object var oSnmp = new ActiveXObject("CoreAsp.SnmpRqst"); // SNMP OID and instance to poll var oSnmpResponse = oSnmp.GetNext(sOidRTTMon); var oResult = oSnmp.Initialize(nDeviceID); if(!oResult.Failed) { // Now poll var oSnmpResponse = oSnmp.GetNext(sOidRTTMon); if(!oSnmpResponse.Failed) { ValueToGraph = parseInt(oSnmpResponse.GetPayload); } else { Context.SetResult(1, oSnmpResponse.GetPayload); } } else { Context.SetResult(1, "Unable to initialize SNMP"); } // Set the performance monitor value to graph Context.SetValue(ValueToGraph);
|
0 Replies
Would you like to comment?
You must be a member. Sign In if you are already a member.