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 />

Keep In Mind<br />

You need to include error handling in your monitor script. Your script either needs a<br />

value to graph by using Context.SetValue, or you must use Context.SetResult<br />

to tell <strong>WhatsUp</strong> <strong>Gold</strong> that the script failed.<br />

Context.GetReferenceVariable will return 'null' if the poll fails for any reason.<br />

If you do not have a call to SetValue or SetResult, the script does not report any<br />

errors and no data is graphed.<br />

If SetValue is used, it is not necessary to use SetResult, as SetValue implicitly<br />

sets SetResult to 0, or "good."<br />

Results from this performance monitor are displayed on Custom Performance Monitors<br />

(on page 639) full and dashboard reports.<br />

Errors from this performance monitor are displayed in the Performance Monitor Error<br />

log (on page 691) as well as EventViewer.exe.<br />

Using the Context object with Performance Monitors<br />

The context object provides an interface for your script to interact with <strong>WhatsUp</strong> <strong>Gold</strong>.<br />

All methods and properties are retrieved using the Context namespace.<br />

Note: You may have to remove the copyright information from the cut and paste if it appears<br />

when you copy from this help file.<br />

Methods Method description<br />

LogMessage(sText); This method allows for a message to be written to the<br />

<strong>WhatsUp</strong> <strong>Gold</strong> debug log.<br />

Example<br />

JScript<br />

Context.LogMessage( "Checking Monitor name using<br />

Context.GetProperty()");<br />

VBScript<br />

Context.LogMessage "Checking Address using Context.GetProperty()"<br />

PutProperty(sPropertyName); This method allows you to store a value in the INMSerialize<br />

object. This value is retained across polls.<br />

Example<br />

JScript<br />

var nCount = parselnt(nNum) +1;<br />

Context.PutProperty("MyNumeric",nCount);<br />

SetResult(nCode, sText); This method allows for a result code and result message to<br />

928

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

Saved successfully!

Ooh no, something went wrong!