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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Determine invalid user account activity<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 active monitor will change a device's state to Down if an invalid, or unexpected user<br />

account logs on. The monitor will stay up if the valid, expected account is logged on, or if no<br />

one is logged on.<br />

sComputer = Context.GetProperty("Address")<br />

nDeviceID = Context.GetProperty("DeviceID")<br />

'Assuming ICMP is not blocked and there's a ping monitor on the device, we want to<br />

'perform the actual check only if the Ping monitor is up. Connect<strong>Server</strong> method of<br />

'the SWbemLocator has a long time out so it would be good to avoid unnecessary tries.<br />

'Please note: there's no particular polling order of active monitors on a device.<br />

'During each polling cycle, it's possible that this monitor could be polled before<br />

'Ping is polled. If the network connection just goes down but Ping is not polled yet,<br />

'and therefore still has an up state, this active monitor will still do an actual<br />

'check and experience a real down. But for the subsequent polls, it won't be doing a<br />

'real check (Connect<strong>Server</strong> won't be called) as Ping monitor has a down state, and this<br />

'monitor will be assumed down.<br />

If IsPingUp(nDeviceID) = false Then<br />

Else<br />

Context.SetResult 1,"Actual check was not performed due to ping being down. Automatically set to down."<br />

sAdminName = Context.GetProperty("CredWindows:DomainAnd<strong>User</strong>id")<br />

sAdminPasswd = Context.GetProperty("CredWindows:Password")<br />

sLogin<strong>User</strong> = GetCurrentLogin<strong>User</strong>(sComputer, sAdminName, sAdminPasswd)<br />

sExpected<strong>User</strong> = "administrator"<br />

916

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

Saved successfully!

Ooh no, something went wrong!