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

Post device status to Twitter<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 action posts the status of the device to which it's applied to the microblogging service<br />

Twitter. This is useful for creating an externally viewable and off-site list of device status.<br />

Dim xml<br />

Set xml = createObject("Microsoft.XMLHTTP")<br />

'Update to include your account's username and password.<br />

s<strong>User</strong> = "username"<br />

sPass = "password"<br />

sStatus = "<strong>WhatsUp</strong> <strong>Gold</strong> says, '%Device.DisplayName %Device.State at %System.Time on %System.Date'"<br />

xml.Open "POST", "http://" & s<strong>User</strong> & ":" & sPass & "@twitter.com/statuses/update.xml?status=" & sStatus, False<br />

xml.setRequestHeader "Content-Type", "content=text/html; charset=iso-8859-1"<br />

xml.Send<br />

Context.SetResult 0, xml.responseText<br />

Set xml = Nothing<br />

940

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

Saved successfully!

Ooh no, something went wrong!