16.01.2013 Views

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Ipswitch</strong> <strong>WhatsUp</strong> <strong>Gold</strong> <strong>User</strong> <strong>Guide</strong><br />

Graph a temperature monitor<br />

Note: This example is provided as an illustration only and is not supported. Technical support<br />

is available for the Context object, SNMP API, and scripting environment, but <strong>Ipswitch</strong> does<br />

not provide support for JScript, VBScript, or developing and debugging Active Script<br />

monitors or actions. For assistance with this example or with writing your own scripts, visit<br />

the <strong>WhatsUp</strong> <strong>Gold</strong> user community (http://www.whatsupgold.com/wugspace).<br />

This performance monitor polls an SNMP-enabled temperature sensor using the CurTemp<br />

reference variable.<br />

A typical graph for this script:<br />

// This script is a JScript script that polls the temperature of an snmp-enabled sensor<br />

from "uptime devices" (www.uptimedevices.com).<br />

// It uses an SNMP reference variable named CurTemp defined with an OID of<br />

1.3.6.1.4.1.3854.1.2.2.1.16.1.14<br />

// and an instance of 1.<br />

//<br />

// That device indicates the temperature in degrees Fahrenheit.<br />

var oCurTemp = Context.GetReferenceVariable("CurTemp");<br />

if (oCurTemp == null) {<br />

Context.SetResult(1, "Unable to poll Temperature Sensor");<br />

}<br />

else {<br />

// convert temperature from tenth of degrees to degrees<br />

var nFinalTemp = oCurTemp / 10.0;<br />

// comment out the line below to convert the temperature in Celsius degrees:<br />

933

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!