<?xml version="1.0"?><rss version="2.0"><channel><title>Script Library</title><link>http://ipswitch.hivelive.com/hives/5bf2ab83c3</link><description></description><language>en-us</language><copyright>Copyright 2006, HiveLive Inc.</copyright><pubDate>Wed, 03 Mar 2010 15:48:59 +0000</pubDate><lastBuildDate>Wed, 03 Mar 2010 15:48:59 +0000</lastBuildDate><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Vmware ESXi</title><link>http://ipswitch.hivelive.com/posts/5f5c32f61a</link><description>&lt;p&gt;&lt;em&gt;Active Monitor by &lt;a href=&quot;http://ipswitch.hivelive.com/people/cf31e1174b&quot;&gt;stephen c&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;These directions assume some whatsup knowledge. --ESXi does not support SNMP gets, only TRAPS. Setup&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.python.org/download/&quot; rel=&quot;nofollow&quot;&gt;Install Python 2.6.x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://downloads.sourceforge.net/pywbem/pywbem-0.6.win32.exe?modtime=1193373678&amp;amp;big_mirror=0&quot; rel=&quot;nofollow&quot;&gt;Install pywbem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download &lt;a href=&quot;http://communities.vmware.com/docs/DOC-7170&quot; rel=&quot;nofollow&quot;&gt;check_esx_wbem.py&lt;/a&gt; put it into c:\python26&lt;/li&gt;
&lt;li&gt;In Whatsup create new windows credentials, for the domain use esx. For example use esx\root for the username and the input the password.&lt;/li&gt;
&lt;li&gt;On the node make sure that its configured to use those credentials.&lt;/li&gt;
&lt;li&gt;Create a new active script monitor and paste the code below.&lt;/li&gt;
&lt;li&gt;Assign the active script monitor to your node and your all set.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I didn&apos;t write the python script, if you have any problem please first test the python script from the command line. You have to use the windows installer for pywbem the latest version has a dependency that does not work in windows. I have tested the script on IBM servers. Please let me know if you make any modifications to the script i would love to see them.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;VB Script&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;28&quot;&gt;&amp;#39;Wbem ESX Monitor
&amp;#39;Stephen

Context.SetResult 0, &amp;quot;No Error&amp;quot;

sysAddress = Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41;
sysAdminUser = Context.GetProperty&amp;#40;&amp;quot;CredWindows:DomainAndUserid&amp;quot;&amp;#41;
sysAdminPass = Context.GetProperty&amp;#40;&amp;quot;CredWindows:Password&amp;quot;&amp;#41;
sysAdminUser = replace&amp;#40;sysAdminUser,&amp;quot;esx\&amp;quot;,&amp;quot;&amp;quot;&amp;#41;
sysAddress = &amp;quot;https://&amp;quot; &amp;amp; sysAddress &amp;amp; &amp;quot;:5989&amp;quot;

esxcheck = &amp;quot;c:\python26\check_esx_wbem.py&amp;quot;

Set objShell = CreateObject&amp;#40;&amp;quot;Wscript.Shell&amp;quot;&amp;#41;
command = &amp;quot;python &amp;quot; &amp;amp; esxcheck &amp;amp; &amp;quot; &amp;quot; &amp;amp; sysAddress &amp;amp; &amp;quot; &amp;quot; &amp;amp;  sysAdminUser &amp;amp; &amp;quot; &amp;quot; &amp;amp; sysAdminPass
returncode = objShell.run&amp;#40;command ,0 , True&amp;#41;

Select Case returncode
 Case 0
  context.SetResult 0, &amp;quot;OK! Return Code:&amp;quot; &amp;amp; returncode
 Case 1
  context.SetREsult 1, &amp;quot;Warning!! Return Code:&amp;quot; &amp;amp; returncode
 Case 2
  context.SetResult 1,  &amp;quot;Critical!!! Return Code:&amp;quot; &amp;amp; returncode
 Case 3
  context.SetResult 1,  &amp;quot;Unknown!!! Return Code:&amp;quot; &amp;amp; returncode
End select
&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/5f5c32f61a</guid><pubDate>Wed, 03 Mar 2010 15:49:41 +0000</pubDate></item><item><title>Packet Loss Active Monitor (1 Comment)</title><link>http://ipswitch.hivelive.com/posts/f7b788164f</link><description>&lt;p&gt;&lt;em&gt;Active Monitor by &lt;a href=&quot;http://ipswitch.hivelive.com/people/844e769014&quot;&gt;kevin hickey&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This script is for monitoring packet loss but doing my own calculations for a specified (last - n) time period.&amp;nbsp; You will probably need to increase the Ping Data Collection Iterations as 3 packets every 10 minutes (as default) will probably not give a very accurate look at the network.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;VB Script&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;40&quot;&gt;&amp;#39;Sending log message to the WhatsUp Event Viewer
Context.LogMessage &amp;quot;Checking Address=&amp;quot; &amp;amp; Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41;

&amp;#39;Set the result code of the check &amp;#40;0=Success, 1=Error&amp;#41;
Context.SetResult 0, &amp;quot;No error&amp;quot;

&amp;#39;Percent Loss that will cause down alarm
ThresholdPacketLoss=30


ScriptStartTime=timer&amp;#40;&amp;#41;

nDeviceID = Context.GetProperty&amp;#40;&amp;quot;DeviceID&amp;quot;&amp;#41;
context.LogMessage &amp;quot;DeviceID=&amp;quot; &amp;amp; nDeviceID

&amp;#39; Get WhatsUp Database Instance
set objDatabase = Context.GetDB

&amp;#39; Verify Database Connectivity
If &amp;quot;&amp;quot; = objDatabase Then
  Context.SetResult 1, &amp;quot;Problem connecting to database&amp;quot;
Else
  context.logmessage &amp;quot;Database connectivity verified&amp;quot;

&amp;#39; Get PivotStatisticalMonitorTypeToDeviceID from DeviceID for enabled Ping monitor
strStatisticalID = &amp;quot;SELECT nPivotStatisticalMonitorTypeToDeviceID FROM &amp;quot; &amp;amp; _
&amp;quot; [WhatsUp].[dbo].[PivotStatisticalMonitorTypeToDevice]&amp;quot; &amp;amp;_
&amp;quot; WHERE nDeviceID = &amp;quot; &amp;amp; nDeviceID &amp;amp; &amp;quot; AND nStatisticalMonitorTypeID &amp;quot; &amp;amp; _
&amp;quot; = &amp;#39;3&amp;#39; AND bEnabled = 1&amp;quot;

objStatisticalID = objDatabase.Execute&amp;#40;strStatisticalID&amp;#41;
nStatisticalMonitorTypeToDeviceID = objStatisticalID&amp;#40;&amp;quot;nPivotStatisticalMonitorTypeToDeviceID&amp;quot;&amp;#41;
context.logmessage &amp;quot;nPivotStatisticalMonitorTypeToDeviceID = &amp;quot; &amp;amp; nStatisticalMonitorTypeToDeviceID

 &amp;#39;Retrieve sample range start date, change &amp;#40;&amp;#45;3&amp;#41; to specify hours
 strStartDate = &amp;quot;SELECT DATEADD&amp;#40;hh, &amp;#45;3, dPollTime&amp;#41; AS &amp;#39;StartDate&amp;#39; FROM &amp;quot; &amp;amp; _
 &amp;quot; [WhatsUp].[dbo].[StatisticalPingPacketLoss] where nPivotStatisticalMonitorTypeToDeviceID =&amp;quot; &amp;amp; _
 nStatisticalMonitorTypeToDeviceID &amp;amp; &amp;quot; order by dPollTime desc&amp;quot;

 objStartDate = objDatabase.Execute&amp;#40;strStartDate&amp;#41;
 dStartDate = objStartDate&amp;#40;0&amp;#41;
 context.logmessage &amp;quot;Start of sample date/time range:&amp;quot; &amp;amp; dStartDate 

 &amp;#39;Query to add packets sent and lost during sample date range
 strTotalPackets = &amp;quot;SELECT SUM&amp;#40;nPacketsSent&amp;#41; AS &amp;#39;SUM_PacketsSent&amp;#39;, SUM&amp;#40;nPacketsLost&amp;#41; AS &amp;#39;SUM_PacketsLost&amp;#39; FROM &amp;quot; &amp;amp; _
 &amp;quot; [WhatsUp].[dbo].[StatisticalPingPacketLoss] WHERE nPivotStatisticalMonitorTypeToDeviceID = &amp;quot; &amp;amp; _
  nStatisticalMonitorTypeToDeviceID &amp;amp; &amp;quot; AND dPollTime &amp;gt;= &amp;#39;&amp;quot; &amp;amp; dStartDate &amp;amp; &amp;quot;&amp;#39;&amp;quot; 

 objTotalPacketsSet = objDatabase.Execute &amp;#40;strTotalPackets&amp;#41;
 nTotalPacketsSent = objTotalPacketsSet &amp;#40;0&amp;#41;
 nTotalPacketsLost = objTotalPacketsSet &amp;#40;1&amp;#41;
 context.logmessage &amp;quot;Total Packets Sent = &amp;quot; &amp;amp; nTotalPacketsSent 
 context.logmessage &amp;quot;Total Packets Lost = &amp;quot; &amp;amp; nTotalPacketsLost 


 &amp;#39;Packet Loss Calculation
 If nTotalPacketsLost = 0 Then
  PacketLoss = 0
 Else
  nPacketLossDecimal = nTotalPacketsLost / nTotalPacketsSent
  currPacketLoss = nPacketLossDecimal * 100
  PacketLoss = Round&amp;#40;currPacketLoss,2&amp;#41;
 End If

 &amp;#39;Sample range verification and threshold comparison
 If datediff&amp;#40;&amp;quot;h&amp;quot;, tmpdPollTime, now&amp;#40;&amp;#41;&amp;#41; &amp;lt; 3 Then
  context.logmessage tmpdPollTime &amp;amp; &amp;quot;Sample range is &amp;lt; 3 hours!&amp;quot;
  ScriptEndTime = timer&amp;#40;&amp;#41;
  context.setresult 0,&amp;quot;The sample date range is not valid, Start Date/Time: &amp;quot; &amp;amp; dStartDate &amp;amp; &amp;quot;&amp;quot;
 Else
  context.logmessage tmpdPollTime &amp;amp; &amp;quot;Sample range is 3 hours&amp;quot;
  ScriptEndTime = timer&amp;#40;&amp;#41;
  intScriptTimeTaken = int&amp;#40;&amp;#40;ScriptEndTime &amp;#45; ScriptStartTime&amp;#41;*1000&amp;#41;

  If PacketLoss &amp;lt; ThresholdPacketLoss Then
   context.setresult 0, &amp;quot;Packet Loss = &amp;quot; &amp;amp; PacketLoss &amp;amp; &amp;quot;&amp;#37; &amp;#40;script took = &amp;quot; &amp;amp; intScriptTimeTaken &amp;amp; &amp;quot; ms&amp;#41;&amp;quot;
  Else
   context.setresult 1, &amp;quot;Packet Loss Threshold &amp;#40;&amp;quot; &amp;amp; ThresholdPacketLoss &amp;amp; &amp;quot;&amp;#37;&amp;#41; exceeded. Current packet loss = &amp;quot; &amp;amp; _
   PacketLoss &amp;amp; &amp;quot;&amp;#37;&amp;quot; &amp;amp; &amp;quot; &amp;#40;script took = &amp;quot; &amp;amp; intScriptTimeTaken &amp;amp; &amp;quot; ms&amp;#41;&amp;quot;
  End if
 End if
End if&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/f7b788164f</guid><pubDate>Thu, 07 Jan 2010 22:28:12 +0000</pubDate></item><item><title>Devices with a specific Action PolicyDown</title><link>http://ipswitch.hivelive.com/posts/7b99304949</link><description>&lt;p&gt;&lt;em&gt;Dynamic Group by &lt;a href=&quot;http://ipswitch.hivelive.com/people/34ff20db8c&quot;&gt;Christian Lawson&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This group shows all devices that have a particular action policy assigned to the device.&amp;nbsp; Replace the &quot;My Policy&quot; text with the name of your policy.&amp;nbsp; Note: This only displays devices that have the action policy assigned to the entire device.&amp;nbsp; It will not display devices that have said policy assigned directly to an active monitor assigned to the device.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;SQL&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;6&quot;&gt;SELECT DISTINCT Device.nDeviceID
  FROM Device
  JOIN ActionPolicy
    ON Device.nActionPolicyID = ActionPolicy.nActionPolicyID
 WHERE ActionPolicy.sPolicyName = N&amp;#39;My Policy&amp;#39;
   AND Device.bRemoved = 0&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/7b99304949</guid><pubDate>Wed, 24 Feb 2010 22:23:10 +0000</pubDate></item><item><title>URLMonitor 1.3 (2 Comments)</title><link>http://ipswitch.hivelive.com/posts/1e8416808a</link><description>&lt;p&gt;&lt;em&gt;Active Monitor by &lt;a href=&quot;http://ipswitch.hivelive.com/people/c84b8528ce&quot;&gt;Robert Strandberg&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;Main function:&lt;br /&gt;
For use with Whatsup Gold to monitor web sites.&lt;br /&gt;
The script can be used in four diffrent ways&lt;br /&gt;
#1-As an Active monitor controling a webpage or a web service&lt;br /&gt;
#2-As an Performance Monitor reporting responsetime of a webpage or a web service&lt;br /&gt;
#3-As an Performance Monitor extracting values from a webpage or a web service&lt;br /&gt;
#4-As an Active script action&lt;/p&gt;
&lt;p&gt;The differens between a webpage and web service (SOAP) are the &quot;content-type&quot; when making a HTTP POST.&lt;/p&gt;
&lt;p&gt;The script have a log file function that can be used to logg entrys to specific file.&lt;br /&gt;
If the folders (PATH) to the log file does not exist the script creates it.&lt;br /&gt;
If you have same name on a scripts running as Active Monitor and Performance monitor&lt;br /&gt;
on the same object they will use the same log file.&lt;/p&gt;
&lt;p&gt;It is possible to make several HTTP GET and POST to simulate a user that&lt;br /&gt;
runs a webapplication.&lt;br /&gt;
Note that it have to be a &quot;true&quot; web application in that sense that it have to be&lt;br /&gt;
pure HTTP, no support for webpages that requires JavaScript,VBscript,Java applets,&lt;br /&gt;
Active X,Flash or any other plug-in.&lt;br /&gt;
The script uses WinHTTP 5.1&lt;/p&gt;
&lt;p&gt;Version history&lt;br /&gt;
V1.0 First public release&lt;br /&gt;
V1.1 Added SOAP11 and SOAP12 as URLMethods to be able to make POST to webservices.&lt;br /&gt;
You can use the same MonitorURL parameters as in V1.0 but you have to replace the script.&lt;br /&gt;
V1.2&lt;br /&gt;
-Change the timeout to calculated connectiontime.&lt;br /&gt;
V1.3 New feature&lt;br /&gt;
-Added support to configure WinHttp 5.1 timeouts in the script or calculate connectiontime, Now there are two diffrent timeout modes.&lt;br /&gt;
-Added support to use a status file so that the script can run outside whatsup and not be affected of whatsup timeout of max 60 seconds on active script.The status file can only be used on active monitors.&lt;br /&gt;
This also includes possibility to logg status to windows eventlog (works only in windows prompt mode).&lt;br /&gt;
-Addes exitcode in windows prompt mode.0 = OK, 1 = Fail.&lt;br /&gt;
-Moved scriptname config to global parameter for windows prompt&lt;br /&gt;
-Updated the LogToFile() function&lt;/p&gt;
&lt;p&gt;You can use the same MonitorURL parameters (function call) as in V1.0 and 1.1 but you have to replace the script.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;VB Script&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;40&quot;&gt;&amp;#39;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45; Function of Script 
&amp;#39;URLMonitor script
&amp;#39;Note:This script is provided &amp;quot;as is&amp;quot; with no warranty or support.
&amp;#39;As with many other public script this script is a combination of other scripts out there.
&amp;#39;With reservation for spelling and grammar.
&amp;#39;Version V1.3 2010&amp;#45;02&amp;#45;03/Robert Strandberg Sundsvall Sweden
&amp;#39;
&amp;#39;Main function:
&amp;#39;For use with Whatsup Gold to monitor web sites.
&amp;#39;The script can be used in four diffrent ways
&amp;#39;#1&amp;#45;As an Active monitor controling a webpage or a web service
&amp;#39;#2&amp;#45;As an Performance Monitor reporting responsetime of a webpage or a web service
&amp;#39;#3&amp;#45;As an Performance Monitor extracting values from a webpage or a web service
&amp;#39;#4&amp;#45;As an Active script action
&amp;#39;
&amp;#39;The differens between a webpage and web service &amp;#40;SOAP&amp;#41; are the &amp;quot;content&amp;#45;type&amp;quot; when making a HTTP POST.
&amp;#39;
&amp;#39;The script have a log file function that can be used to logg entrys to specific file.
&amp;#39;If the folders &amp;#40;PATH&amp;#41; to the log file does not exist the script creates it.
&amp;#39;If you have same name on a scripts running as Active Monitor and Performance monitor
&amp;#39;on the same object they will use the same log file.
&amp;#39;
&amp;#39;It is possible to make several HTTP GET and POST to simulate a user that 
&amp;#39;runs a webapplication.
&amp;#39;Note that it have to be a &amp;quot;true&amp;quot; web application in that sense that it have to be 
&amp;#39;pure HTTP, no support for webpages that requires JavaScript,VBscript,Java applets,
&amp;#39;Active X,Flash or any other plug&amp;#45;in.
&amp;#39;The script uses WinHTTP 5.1
&amp;#39;For more info on WinHTTP 5.1 see
&amp;#39;http://msdn.microsoft.com/en&amp;#45;us/library/aa382925&amp;#40;VS.85&amp;#41;.aspx
&amp;#39;
&amp;#39;**** Fundamental understanding when configure the script *****
&amp;#39;Its important to understand the difference between the WinHTTP 5.1 &amp;#40;this script&amp;#41; and a web&amp;#45;browser.
&amp;#39;WinHTTP 5.1 only request the configured URL from the web&amp;#45;server and takes no more action.
&amp;#39;This script makes a very simple analyze of the received content.
&amp;#39;All modern web&amp;#45;pages today consist of several files.
&amp;#39;A web&amp;#45;browser analyze the web&amp;#45;pages and fetch all URL:s &amp;#40;files&amp;#41; that builds the &amp;quot;web&amp;#45;page&amp;quot;.
&amp;#39;You can &amp;#40;in theory&amp;#41; build a web browser with WinHTTP 5.1 but this script is not a browser.
&amp;#39;
&amp;#39;Below is a short summary of WinHTTP 5.1
&amp;#39;************ Start Microsoft text 
&amp;#39;WinHTTP 5.1 Features
&amp;#39;
&amp;#39;The following features have been added in version 5.1 of WinHTTP:
&amp;#39;
&amp;#39;IPv6 support. 
&amp;#39;AutoProxy capabilities. 
&amp;#39;HTTP/1.0 protocol, including support for keep&amp;#45;alive &amp;#40;persistent&amp;#41; connections and session cookies. 
&amp;#39;HTTP/1.1 chunked transfer support for HTTP responses. 
&amp;#39;Keep&amp;#45;alive pooling of anonymous connections across sessions. 
&amp;#39;Secure Sockets Layer &amp;#40;SSL&amp;#41; functionality, including client certificates. Supported SSL protocols include the following:
&amp;#39;SSL 2.0, SSL 3.0, and Transport Layer Security &amp;#40;TLS&amp;#41; 1.0. 
&amp;#39;Support for server and proxy authentication, including integrated support for Microsoft Passport 1.4 and the 
&amp;#39;Negotiate/ Kerberos package. 
&amp;#39;Automatic handling of redirects unless suppressed. 
&amp;#39;Scriptable interface in addition to the API. 
&amp;#39;Trace utility to help troubleshoot problems. 
&amp;#39;A number of WinINet features are not supported in WinHTTP, including URL caching and persistent cookies, autoproxy,
&amp;#39;autodialing, offline support, File Transfer Protocol &amp;#40;FTP&amp;#41;, and the Gopher protocol.
&amp;#39;************ End Microsoft text 
&amp;#39;
&amp;#39;Script function in detail:
&amp;#39;#1&amp;#45;Active Monitor
&amp;#39;A URL is monitored if it responds with a configurable textstring.
&amp;#39;When a URL is monitored its configurable if the HTTP method should be GET or POST,
&amp;#39; when POST the posted data is also added.
&amp;#39;The script supports HTTP login.
&amp;#39;Its also possible to extract a dynamic textstring from the reveived webpage, this text
&amp;#39; string can be used as a a dynamic part of the next URL to be monitored &amp;#40;or as a 
&amp;#39;variable in performance monitor&amp;#41;.
&amp;#39;If the dynamic textstring couldt be found the script reports the URLMonitor to have
&amp;#39;failed the same way as if the received webpage dosent have the expected textstring.
&amp;#39;This means that with the textstring extraction the script actually makes three 
&amp;#39;textstring controls of ths received webpage,the first is the actual control, the 
&amp;#39;two following are the text before and after the dynamic textstring.
&amp;#39;All search of text in the received webpage is done from the beginning of the page. 
&amp;#39;To simplify the URLs in the script and to handle diffrent charactersets the received
&amp;#39; webpage are &amp;quot;cleaned&amp;quot;.
&amp;#39;The cleaning process makes the following changes of the received webpagestring: 
&amp;#39;&amp;#45;NewLine,Carrige Return,Quotation,Horizontal and Vertical TAB are removed. 
&amp;#39;&amp;#45;Characters with ASCII 128 to 255 are replaced with character &amp;quot;x&amp;quot;.
&amp;#39;
&amp;#39;#2&amp;#45;Performance Monitor responsetime
&amp;#39;When used in performance monitor the same controls as when the script are used as a 
&amp;#39;#1&amp;#45;active monitor are done plus that the script reports the resonsetime in 
&amp;#39;milliseconds &amp;#40;1000 = 1 Second&amp;#41; of receiving the webpage.
&amp;#39;If the URLMonitor fails then the script reports to whatsup that the value 
&amp;#39;reported is invalid.
&amp;#39;Its possible to use the same script as in active monitor, just change the global 
&amp;#39;parameter &amp;quot;sintTypOfMonitor&amp;quot; from &amp;quot;sintTypOfMonitor=0&amp;quot; to &amp;quot;sintTypOfMonitor=1&amp;quot;.
&amp;#39;
&amp;#39;#3&amp;#45;Performance Monitor extract value
&amp;#39;The script makes the same control as in #2 but instead of reporting the responstime
&amp;#39;it converts the extracted textstring to a value and reports it to whatsup.
&amp;#39;If the extracted textstring is not numeric then the script reports the value 
&amp;#39;invalid as if the URLMonitor fails.
&amp;#39;When handeling values its possible to change the value separators like 
&amp;#39;100.000 , 100,000 or 100 000.
&amp;#39;
&amp;#39;#4&amp;#45;Action
&amp;#39;Run the script as an active monitor, see #1 for details.
&amp;#39;
&amp;#39;Statement:
&amp;#39;I have tried to keep the code to VBScript Coding Conventions
&amp;#39; http://msdn.microsoft.com/en&amp;#45;us/library/ektke1b0&amp;#40;VS.85&amp;#41;.aspx
&amp;#39;Since it is a script I have made extensive use of global variables to simplify
&amp;#39;configuration and reduce processor time.
&amp;#39;
&amp;#39;Global variabels
&amp;#39;The script makes extensive use of global parameter in a effort to simplify the 
&amp;#39;configuration of the script.
&amp;#39;The variabel &amp;quot;sstrFromHost&amp;quot; contains the extracted textstring from the received
&amp;#39;webpage, sstrFromHost holds the latest URLMonitor that have extracted a 
&amp;#39;textstring &amp;#40;with strPreStringsstrFromHost and strPostStringsstrFromHost configured&amp;#41;.
&amp;#39;To speed up the &amp;quot;character&amp;quot; cleaing process of the monitored URL the 
&amp;#39;sintMaxPageLengthKB variable is set, if a received webpage are longer then the
&amp;#39;script only control the received webpage up to the sintMaxPageLengthKB value.
&amp;#39;The script receives all the webpage but only clean and controll the page up
&amp;#39;to sintMaxPageLengthKB.
&amp;#39;The parameters strTextToFind,strPreStringsstrFromHost and strPostStringsstrFromHost
&amp;#39;in the MonitorURL function call MUST be within the sintMaxPageLengthKB range
&amp;#39;
&amp;#39;Use the Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41; if you have a monitor that can be used on
&amp;#39;several objects.
&amp;#39;Note that the Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41; only works in Whatsup mode.
&amp;#39;
&amp;#39;Global parameters
&amp;#39;sintScriptMode = Controls how the script report, to windows commandprompt or to whatsup
&amp;#39;sintScriptMode = 0 = Whatsup
&amp;#39;sintScriptMode &amp;lt;&amp;gt; 0 = Windows commandprompt
&amp;#39;
&amp;#39;sintTypOfMonitor = Controls if the script should run as Active Monitor or Performance Monitor
&amp;#39;sintTypOfMonitor = 0 = Active Monitor
&amp;#39;sintTypOfMonitor = 1 = Performance Monitor responsetime
&amp;#39;sintTypOfMonitor = 2 = Performance Monitor extract value
&amp;#39;
&amp;#39;When used to extract value from webpage set number handeling
&amp;#39;Example 100000 kan be express as 100.000 or 100 000 or 100.000
&amp;#39;For example
&amp;#39;strNumberSeparatorToReplace = &amp;quot;,&amp;quot;
&amp;#39;strNewNumberSeparator = &amp;quot;&amp;quot;
&amp;#39;
&amp;#39;Two different timeouts modes 
&amp;#39;In whatsup there a limitation that a script only can have a timeout at 60 seconds.
&amp;#39;1&amp;#45;Standard as URLMonitor 1.0 and 1.1
&amp;#39;2&amp;#45;Calculated connetion time
&amp;#39;
&amp;#39;Statusfile
&amp;#39;URLMonitor can run as a standalone script and update a status file that whatsup can read.&amp;#40;started in windows schedule&amp;#41;
&amp;#39;The script will bee run in windows prompt mode.&amp;#40;sintScriptMode = 1&amp;#41;
&amp;#39;This means that the script can run longer than 60 seconds.
&amp;#39;The script updates a status file that Whatsup reads and triggers alarms.
&amp;#39;You can use any type of timeout mode.
&amp;#39;Logg script reasult to windows eventlog &amp;#40;only in windows prompt mode&amp;#41;
&amp;#39;
&amp;#39;Details of the diffrent timeouts modes
&amp;#39;&amp;#45;Standard
&amp;#39;In this mode Whatsup will close the script if its longer then the script timeout.
&amp;#39;When Whatsup terminates the script then no entry in the URLMonitor log file will be made.
&amp;#39;This mode is the simpliest and is the standard setting.
&amp;#39;
&amp;#39;&amp;#45;Calculated connection time
&amp;#39;In this mode the script calculates the remaining script time and calculates &amp;#40;and sets&amp;#41; the connection time.
&amp;#39;The script will terminate and log to the log file before whatsup terminates the script.
&amp;#39;You have to configure serveral timeout values and sometimes finetune the settings.
&amp;#39;
&amp;#39;This gives the script a possibility to report resault to whatsup and end in a normal way.
&amp;#39;When whatsup terminates the script you never really know if it whas the script that failed or the monitored URL:s.
&amp;#39;Note that ALL timeouts are in milliseconds
&amp;#39;A value of 0 sets a time&amp;#45;out to wait infinitely. A value greater than 0 
&amp;#39;sets the time&amp;#45;out value in milliseconds. For example, 30,000 would set the time&amp;#45;out to 30 seconds.
&amp;#39;
&amp;#39;slngResolveTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;Time&amp;#45;out value applied when resolving a host name &amp;#40;such as www.microsoft.com&amp;#41; to an IP address &amp;#40;such as 192.168.131.199&amp;#41;, in milliseconds. The default value is zero, meaning no time&amp;#45;out &amp;#40;infinite&amp;#41;. If DNS timeout is specified using NAME_RESOLUTION_TIMEOUT, there is an overhead of one thread per request.
&amp;#39;This value can normaly be fixed
&amp;#39;
&amp;#39;slngConnectTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;Time&amp;#45;out value applied when establishing a communication socket with the target server.
&amp;#39;This value is calculated as slngConnectTimeout = sScriptTimeOut &amp;#45; &amp;#40;slngSendTimeout &amp;#43; slngResolveTimeout &amp;#43; &amp;#40;slngReceiveTimeout * sintNumberOfReceivedpackets&amp;#41; &amp;#43; ScriptRunTime&amp;#41;
&amp;#39;This mean that the total time of every MonitorURL call never should exceed the sScriptTimeOut.
&amp;#39;
&amp;#39;slngSendTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;Time&amp;#45;out value applied when sending an individual packet of request data on the communication socket to the target server. A large request sent to an HTTP server are normally be broken up into multiple packets; the send time&amp;#45;out applies to sending each packet individually.
&amp;#39;This value can normaly be fixed
&amp;#39;
&amp;#39;slngReceiveTimeout = Timeout for every received packet
&amp;#39;Time&amp;#45;out value applied when receiving a packet of response data from the target server. Large responses are be broken up into multiple packets; the receive time&amp;#45;out applies to fetching each packet of data off the socket.
&amp;#39;This value can normaly be fixed, however it will be multiplyed with sintNumberOfReceivedpackets when timeout is calculated.
&amp;#39;50 packets and 100 milliseconds receivetimeout givew a total timeout calculation of 5000 milliseconds
&amp;#39;
&amp;#39;sintNumberOfReceivedpackets = The number of received packets in the longest MonitorURL being monitored.
&amp;#39;The MonitorURL only receives one URL, so even if our web aplication consist of several pages the MonitorURL only fetch the one
&amp;#39;you configured.
&amp;#39;This means that if you take the size of the largest URL that you monitor within a script and divide it with 1400 you get
&amp;#39;an estimate of the number of packets the URL will consist of.
&amp;#39;A URL of 28.000 bytes will need 28.000/1400=20 pakets to receive.
&amp;#39;
&amp;#39;sScriptTimeOut = timeout for the total of the script, should be lower than the active script timeout in whatsup.
&amp;#39;
&amp;#39;Character compability
&amp;#39;To handle different character sets only ASCII 1 to 127 is used in string.
&amp;#39;Ascii &amp;gt; 127 numbers are change to &amp;quot;x&amp;quot;
&amp;#39;
&amp;#39;Tips on how to configure the script using simple tools
&amp;#39;
&amp;#39;******** Working in Windows commandprompt
&amp;#39;
&amp;#39;Tool #1&amp;#45;FireFox with plug&amp;#45;in &amp;quot;Live HTTP Headers&amp;quot;
&amp;#39;This shows the HTTP GET and POST including POST&amp;#45;data &amp;#40;on HTTP and HTTPS&amp;#41;.
&amp;#39;From this information you find the following:
&amp;#39;&amp;#45;Which URL to check
&amp;#39;&amp;#45;Which GET or POST method and POST data.
&amp;#39;&amp;#45;When to use HTTP login
&amp;#39;A more advanced tool is &amp;quot;FireBug&amp;quot;
&amp;#39;
&amp;#39;Tool #2&amp;#45;Microsoft script editor
&amp;#39;This tool have three main advantage compared to notepad.
&amp;#39;&amp;#45;It shows code,command and comments in different colors.
&amp;#39;&amp;#45;It have row,column and characther counter
&amp;#39;&amp;#45;It is aware of the MonitorURL functions parameters.
&amp;#39;The Microsoft script editor comes with office11/Office 2003
&amp;#39;You can start it from any office program, for example Excel choose Tools&amp;#45;&amp;gt;Macro or you can start it direct
&amp;#39;with the command &amp;quot;PATH_TO_OFFICE11&amp;quot;\mse7.exe.
&amp;#39;
&amp;#39;Example on workflow to configure a script
&amp;#39;To start the script in windowsprompt type &amp;quot;cscript URLMonitor_1_0.vbs&amp;quot;
&amp;#39;
&amp;#39;#1 Configure the script for windowsprompt with parameter &amp;quot;sintScriptMode=1&amp;quot; in the script editor and the parameter &amp;quot;sintTypOfMonitor&amp;quot; to
&amp;#39;0,1 or 2 depending on your need.
&amp;#39;#2 Use Firefox and LiveHTTP headers to find the URL and HTTP parameters.
&amp;#39;#3 Configure the script in the script editor.
&amp;#39;#4 Start the script in a commandprompt
&amp;#39;#5 Find the text to monitor and if extraction of textstring find the surrounding static text.
&amp;#39;An alternativ to #3&amp;#45;#5 is to use view source in IE &amp;#40;not Firefox for this,I have experience problems with HTTPS&amp;#41; to find the text,
&amp;#39;remember that the script &amp;quot;cleans&amp;quot; the webpage.
&amp;#39;#6 Configure the script with the parameters.
&amp;#39;#7 Start the script again in a commandprompt, if it succeeds you have finished with the first URLMonitor.
&amp;#39;#8 Add a new MonitorURL line in the script and repeat step #2 to #7 until you have simulated a user.
&amp;#39;#9 Copy the script to whatsup and change the parameter &amp;quot;sintScriptMode=0&amp;quot;.
&amp;#39;#10 Configuiration finished.
&amp;#39;
&amp;#39;Use the Whatsup eventviewer in debug mode &amp;#40;right mouse click&amp;#41; to see the log message.
&amp;#39;
&amp;#39;Configuration example
&amp;#39;Please note that the www.whatsupgold.com websites is used in the examples so that you can test that the script works,
&amp;#39;however use your own sites when you start making changes.
&amp;#39;This script examples below worked against the URL when this script was released.
&amp;#39;
&amp;#39;Check page and extract value
&amp;#39;sintTypOfMonitor = 0 or 1  
&amp;#39;MonitorURL &amp;quot;http://www.whatsupgold.com&amp;quot;,&amp;quot;&amp;lt;title&amp;gt;Network Management with Network Monitoring | Know Your Network with WhatsUp Gold&amp;lt;/title&amp;gt;&amp;quot; ,&amp;quot;GET&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,0
&amp;#39;
&amp;#39;Version history
&amp;#39;V1.0 First public release
&amp;#39;V1.1 Added SOAP11 and SOAP12 as URLMethods to be able to make POST to webservices.
&amp;#39;You can use the same MonitorURL parameters as in V1.0 but you have to replace the script.
&amp;#39;V1.2
&amp;#39;&amp;#45;Change the timeout to calculated connectiontime.
&amp;#39;V1.3 New feature
&amp;#39;&amp;#45;Added support to configure WinHttp 5.1 timeouts in the script or calculate connectiontime, Now there are two diffrent timeout modes.
&amp;#39;&amp;#45;Added support to use a status file so that the script can run outside whatsup and not be affected of whatsup timeout of max 60 
&amp;#39;seconds on active script.The status file can only be used on active monitors.
&amp;#39;This also includes possibility to logg status to windows eventlog &amp;#40;works only in windows prompt mode&amp;#41;.
&amp;#39;&amp;#45;Addes exitcode in windows prompt mode.0 = OK, 1 = Fail.
&amp;#39;&amp;#45;Moved scriptname config to global parameter for windows prompt
&amp;#39;&amp;#45;Updated the LogToFile&amp;#40;&amp;#41; function
&amp;#39;
&amp;#39;You can use the same MonitorURL parameters &amp;#40;function call&amp;#41; as in V1.0 and 1.1 but you have to replace the script.
&amp;#39;
&amp;#39;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45; Init of script 
Option Explicit
Public sobjWinHttp51 &amp;#39;WinHTTP 5.1 object
Public sintMonitorResault &amp;#39;Overall URL resault
Public sintFirstErrorFlag &amp;#39;Used to detect and log only the first error
Public sintTimeOutFlag &amp;#39;Used to detect Timeout
Public sstrFromHost &amp;#39;Extracted textstring from URL
Public sintMaxPageLengthKB &amp;#39;Max length of received page in Kbyte
Dim tmResponseTimeURL 
Dim tmStartTimeURLCheck
Public sintScriptMode &amp;#39;Whatsup or Windows mode
Public sintTypOfMonitor &amp;#39;Active or performance monitor
Dim strNumberSeparatorToReplace 
Dim strNewNumberSeparator
Public sstrScriptName
Public sintLogMode
Public sintLogFileSizeKB
Public sstrLogFilePath
Public sintStatusFileMode
Public sstrStatusFilePath
Public sstrLogTextToFile
Public sintTimeoutMode
Public slngResolveTimeout
Public slngConnectTimeout 
Public slngSendTimeout
Public slngReceiveTimeout
Public sScriptTimeOut
Public sintNumberOfReceivedpackets
Public sVersion
sVersion = &amp;quot;ver 1.3&amp;quot;
&amp;#39;URL Check correct
sintMonitorResault = 0
sintFirstErrorFlag = 0
sintTimeOutFlag = 0
sstrFromHost = &amp;quot;&amp;quot;
sstrLogTextToFile =&amp;quot;&amp;quot;
&amp;#39;Create objects
Set sobjWinHttp51 = CreateObject&amp;#40;&amp;quot;WinHttp.WinHttpRequest.5.1&amp;quot;&amp;#41;

&amp;#39;Start timer
tmStartTimeURLCheck =Timer&amp;#40;&amp;#41;
&amp;#39;//////////////////////// G l o b a l &amp;#45; C o n f i g u r a t i o n
&amp;#39;sstrScriptName string below are only used in windows prompt mode.
&amp;#39;In whatsup mode the sstrScriptName will be calculated from monitorname and object IP configured in whatsup.
sstrScriptName = &amp;quot;URL Monitor 1.3 example&amp;quot;
&amp;#39;sintScriptMode = 0 = Whatsup
&amp;#39;sintScriptMode &amp;lt;&amp;gt; 0 = Windows commandprompt
sintScriptMode = 1
&amp;#39;sintTypOfMonitor = 0 = Active Monitor
&amp;#39;sintTypOfMonitor = 1 = Performance Monitor responsetime
&amp;#39;sintTypOfMonitor = 2 = Performance Monitor extract value
sintTypOfMonitor = 1
&amp;#39;When used to extract value from webpage set number handeling
&amp;#39;Example 100000 kan be express as 100.000 or 100 000 or 100.000
strNumberSeparatorToReplace = &amp;quot;,&amp;quot;
strNewNumberSeparator = &amp;quot;&amp;quot;
&amp;#39;sintLogMode sets the logging mode
&amp;#39;sintLogMode = 0 = No logging to file &amp;#40;Normal Setting&amp;#41;
&amp;#39;sintLogMode = 1 = Logging overall failures to log file
&amp;#39;sintLogMode = 2 = Logging everything to log file
sintLogMode = 1
&amp;#39;Logfile path where the script stores logfiles when sintLogMode &amp;lt;&amp;gt; 0
&amp;#39;The logfile will have the name &amp;quot;sstrScriptName&amp;quot; &amp;#43; &amp;quot;HostName&amp;quot; in whatsup, when testing in windows pormpt it will be sstrScriptName string below
&amp;#39;The script create the log folders
sstrLogFilePath =&amp;quot;C:\URLMonitor\Log&amp;quot;
&amp;#39;sintLogFileSizeKB max size of logfile, if logfile reach that size loggning to file stops until
&amp;#39;logfile are renamed,moved or deleted
sintLogFileSizeKB = 1000
&amp;#39;sintMaxPageLengthKB max length of the received webpage in every MonitorURL function call.
&amp;#39;The script will receive all the webpage but to speed up the cleaning process a max size is recommended.
&amp;#39;This max size is for every separate MonitorURL function call, If you make 10 calls of MonitorURL simulating a user
&amp;#39;the script will only check every webpage to sintMaxPageLengthKB.
&amp;#39;The strTextToFind and variable sstrFromHost must be within the sintMaxPageLengthKB range
sintMaxPageLengthKB = 10
&amp;#39;sintStatusFileMode = 0 = No status file in use
&amp;#39;sintStatusFileMode = 1 = Status file in sstrStatusFilePath.
&amp;#39;The statusfile will have the name &amp;quot;Status&amp;#45;&amp;quot; &amp;#43; &amp;quot;sstrScriptName&amp;quot; &amp;#43; &amp;quot;HostName&amp;quot;.txt in whatsup, when testing in windows pormpt it will be sstrScriptName.
&amp;#39;The script create the status folders
&amp;#39;The text in the status file will be OK or ERROR.
&amp;#39;In you can use whatsup File monitor monitor that the sice of the file is less then 5 byte.
&amp;#39;use this settning when you run the script outside whatsup.
&amp;#39;sintStatusFileMode = 2 = Same as &amp;quot;1&amp;quot; but now an entry in the event log will be created.&amp;#40;works only in windows prompt mode, not in whatsup&amp;#41;
&amp;#39;The event entry will have the name &amp;quot;Failure:&amp;quot; or &amp;quot;Success:&amp;quot; &amp;#43; &amp;quot;sstrScriptName&amp;quot; &amp;#43; &amp;quot;HostName&amp;quot;.txt in whatsup, when testing in windows pormpt it will be sstrScriptName string below
sintStatusFileMode = 0
&amp;#39;sstrStatusFilePath only valid when sintStatusFileMode &amp;lt;&amp;gt; 0
sstrStatusFilePath = &amp;quot;C:\URLMonitor\Status&amp;quot;
&amp;#39;sintTimeoutMode = 0 = standard, the script uses the values below.
&amp;#39;sintTimeoutMode &amp;lt;&amp;gt; 0 = Calculated connectiontime, the script calculates the connectiontime and timeout values below have to be
&amp;#39;configured 
sintTimeoutMode = 0
&amp;#39;slngResolveTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;A value of 0 sets a time&amp;#45;out to wait infinitely.
&amp;#39;URLMonitor default value 59000 milliseconds
&amp;#39;In sintTimeoutMode &amp;lt;&amp;gt; 0 use 5000 as start value
slngResolveTimeout = 59000
&amp;#39;slngSendTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;Only one packet is sent on every MonitorURL&amp;#40;&amp;#41; call
&amp;#39;A value of 0 sets a time&amp;#45;out to wait infinitely.
&amp;#39;URLMonitor default value 59000 milliseconds
&amp;#39;In sintTimeoutMode &amp;lt;&amp;gt; 0 use 2500 as start value
slngSendTimeout = 59000
&amp;#39;slngConnectTimeout = Timeout set for every MonitorURL&amp;#40;&amp;#41; function call
&amp;#39;Only one packet is sent on every MonitorURL&amp;#40;&amp;#41; call
&amp;#39;A value of 0 sets a time&amp;#45;out to wait infinitely.
&amp;#39;URLMonitor default value 59000 milliseconds
&amp;#39;In sintTimeoutMode &amp;lt;&amp;gt; 0 this values is calculated by the script.
slngConnectTimeout = 59000
&amp;#39;slngReceiveTimeout = Timeout for every received packet
&amp;#39;Time&amp;#45;out value applied when receiving a packet of response data from the target server. Large responses are be broken up into multiple packets; the receive time&amp;#45;out applies to fetching each packet of data off the socket.
&amp;#39;URLMonitor default value 59000 milliseconds
&amp;#39;In sintTimeoutMode &amp;lt;&amp;gt; 0 this values is calculated together with sintNumberOfReceivedpackets as the total receivetimeout.
&amp;#39;50 packets and 100 milliseconds receivetimeout givew a total timeout calculation of 5000 milliseconds
&amp;#39;A value of 0 sets a time&amp;#45;out to wait infinitely.
slngReceiveTimeout = 59000
&amp;#39;sintNumberOfReceivedpackets are only valid when In sintTimeoutMode &amp;lt;&amp;gt; 0
&amp;#39;This means that if you take the size of the largest URL that you monitor within a script and divide it with 1400 you get
&amp;#39;an estimate of the number of packets the URL will consist of.
&amp;#39;A URL of 28.000 bytes will need 28.000/1400=20 pakets to receive.
sintNumberOfReceivedpackets = 10
&amp;#39;sScriptTimeOut are only valid when In sintTimeoutMode &amp;lt;&amp;gt; 0
&amp;#39;sScriptTimeOut = timeout for the total of the script, should be equal to active script timeout in whatsup.
sScriptTimeOut = 59000
&amp;#39;//////////////////////// E n d &amp;#45; o f &amp;#45; G l o b a l &amp;#45; C o n f i g u r a t i o n
&amp;#39;Scriptname
&amp;#39;This name is used to find the specific script and host combination in the whatsup eventviewer
If sintScriptMode = 0 Then
        If sintTypOfMonitor = 1 or sintTypOfMonitor = 2 then
            sstrScriptName = Context.GetProperty&amp;#40;&amp;quot;PerformanceMonitorTypeName&amp;quot;&amp;#41; &amp;amp; &amp;quot;&amp;#45;&amp;quot; &amp;amp; Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41;
        else
            sstrScriptName = Context.GetProperty&amp;#40;&amp;quot;ActiveMonitorTypeName&amp;quot;&amp;#41; &amp;amp; &amp;quot;&amp;#45;&amp;quot; &amp;amp; Context.GetProperty&amp;#40;&amp;quot;Address&amp;quot;&amp;#41;
        end if
end if
&amp;#39;////////////////////// Start the URL monitor configuration 
&amp;#39;One row with MonitorURL for every URL to monitor
MonitorURL &amp;quot;http://www.whatsupgold.com&amp;quot;,&amp;quot;&amp;lt;title&amp;gt;Network Management with Network Monitoring | Know Your Network with WhatsUp Gold&amp;lt;/title&amp;gt;&amp;quot; ,&amp;quot;GET&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,0
&amp;#39;
&amp;#39;////////////// End of URL monitor configuration &amp;#45; No changes below are needed 
&amp;#39;Count responetime
tmResponseTimeURL = CLng&amp;#40;TrueTimer&amp;#40;tmStartTimeURLCheck&amp;#41;*1000&amp;#41;
&amp;#39;Terminate object
Set sobjWinHttp51 = Nothing

If sintTypOfMonitor = 2 Then &amp;#39;Performance monitor extract value
    If IsNumeric&amp;#40;sstrFromHost&amp;#41; = True Then
        sstrFromHost=Replace&amp;#40;sstrFromHost,strNumberSeparatorToReplace,strNewNumberSeparator&amp;#41;
        sstrFromHost=CLng&amp;#40;sstrFromHost&amp;#41;
    else
        sintMonitorResault = 1
        Log&amp;#40;&amp;quot;Error, Value is not numeric for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; value=&amp;quot; &amp;amp; sstrFromHost&amp;#41;
    end if
end if

&amp;#39;Check overall resault
if sintMonitorResault = 0 then
    &amp;#39;Set the result code of the check &amp;#40;0=Success, 1=Error&amp;#41;
    &amp;#39;Update Whatsup
    If sintScriptMode = 0 Then
        If sintTypOfMonitor = 1 Then
            Context.SetValue tmResponseTimeURL
        end if
        If sintTypOfMonitor = 2 Then
            Context.SetValue sstrFromHost
        end if
        Context.SetResult 0, &amp;quot;SetResult to success for script=&amp;quot; &amp;amp; sstrScriptName
    End if
    &amp;#39;Log message    
    If sintTypOfMonitor = 1 Then
        Log&amp;#40;&amp;quot;URLCheck for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; took &amp;quot; &amp;amp; tmResponseTimeURL &amp;amp; &amp;quot; ms to complete&amp;quot;&amp;#41;
    end if
    If sintTypOfMonitor = 2 Then
        Log&amp;#40;&amp;quot;Converted variable for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; value= &amp;quot; &amp;amp; sstrFromHost&amp;#41;
    end if
    Log&amp;#40;&amp;quot;Completed with success for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,All URL checks have responded correctly&amp;quot;&amp;#41;
else
    If sintScriptMode = 0 Then
        Context.SetResult 1, &amp;quot;SetResult to failure for script=&amp;quot; &amp;amp; sstrScriptName
    end if    
    Log&amp;#40;&amp;quot;Completed with error for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,the overall URL checks failed&amp;quot;&amp;#41;
end if
&amp;#39;Update status file
StatusFile&amp;#40;&amp;#41;
LogToFile&amp;#40;&amp;#41;
If sintScriptMode = 1 Then &amp;#39;windows prompt
    if sintMonitorResault = 0 then
        WScript.Quit&amp;#40;0&amp;#41;
    else
        WScript.Quit&amp;#40;1&amp;#41;
    end if
end if
&amp;#39;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45; End Script &amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;&amp;#45;

&amp;#39;************************************ Start of functions ************************************************

Function MonitorURL&amp;#40;strURLToCheck,strTextToFind,strURLMetod,strUserName,strUserPassword,strURLPostData,strPreStringsstrFromHost,strPostStringsstrFromHost,intDebugInfo&amp;#41;
&amp;#39;================== Parameters for every URL 
&amp;#39;MonitorURL strURLToCheck,strTextToFind,strURLMetod,strUserName,strUserPassword,strURLPostData,strPreStringsstrFromHost,strPostStringsstrFromHost,intDebugInfo
&amp;#39;strURLToCheck = URL to check
&amp;#39;strTextToFind = Text string to seach for in received URL
&amp;#39;strURLMetod = GET,POST,SOAP11 or SOAP12, When POST then strURLPostData should contain the text to POST*
&amp;#39;When SOAP11 or SOAP12 the HTTP method is still POST but with diffrent content&amp;#45;types
&amp;#39;Content&amp;#45;type on POST,SOAP11&amp;#40;SOAP 1.1&amp;#41; and SOAP12&amp;#40;SOAP 1.2&amp;#41;
&amp;#39;POST = application/x&amp;#45;www&amp;#45;form&amp;#45;urlencoded
&amp;#39;SOAP11 = text/xml
&amp;#39;SOAP12 = application/soap&amp;#43;xml
&amp;#39;strUserName = Username when URL request login
&amp;#39;strUserPassword = Password when URL request login
&amp;#39;strURLPostData = String to POST,used togeter with strURLMetod=POST
&amp;#39;strPreStringsstrFromHost = String before extracted textstring &amp;#40;variable sstrFromHost&amp;#41; in the received HTML page
&amp;#39;strPostStringsstrFromHost = String after extracted textstring &amp;#40;variable sstrFromHost&amp;#41; in received HTML page
&amp;#39;intDebugInfo = 0 = No debug, 0 &amp;lt;&amp;gt; = echo webpage after characther cleaing
&amp;#39;If an error is received from the web server and intDebugInfo &amp;lt;&amp;gt; 0 the webpage are returned before cleaning
&amp;#39;
&amp;#39;The MonitorURL function checks and reports if error.
&amp;#39;The sstrFromHost contains the extract textstring from the receive webpage &amp;#40;when PreStringsstrFromHost and strPostStringsstrFromHost are defined&amp;#41;
&amp;#39;============================================
Dim strWebPage,intActionResault
Dim intPreVarStart,intPostVarEnd
&amp;#39;strURLToCheck = strURLMetod GET or POST

if sintTimeoutMode &amp;lt;&amp;gt; 0 then &amp;#39;Check the timeout
    if sintTimeOutFlag = 1 then &amp;#39;Timeout
        Log&amp;#40;&amp;quot;Timeout reached for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp;&amp;quot; ,no control made for MonitorURL=&amp;quot; &amp;amp; strURLToCheck &amp;amp; &amp;quot; with string=&amp;quot; &amp;amp; strTextToFind &amp;amp; &amp;quot; POSTdata: &amp;quot; &amp;amp; strURLPostData&amp;#41;    
        exit function
    end if
    if sScriptTimeOut &amp;gt; &amp;#40;slngSendTimeout &amp;#43; slngResolveTimeout &amp;#43; &amp;#40;slngReceiveTimeout * sintNumberOfReceivedpackets&amp;#41; &amp;#43; &amp;#40;TrueTimer&amp;#40;tmStartTimeURLCheck&amp;#41;*1000&amp;#41;&amp;#41; then
        &amp;#39;Still time to make a other MonitorURL&amp;#40;&amp;#41; check
        &amp;#39;Calculate new timeout value
        slngConnectTimeout = sScriptTimeOut &amp;#45; &amp;#40;slngSendTimeout &amp;#43; slngResolveTimeout &amp;#43; &amp;#40;slngReceiveTimeout * sintNumberOfReceivedpackets&amp;#41; &amp;#43; &amp;#40;TrueTimer&amp;#40;tmStartTimeURLCheck&amp;#41;*1000&amp;#41;&amp;#41;    
        else
        &amp;#39;Timeout reached
        &amp;#39;Set Error
        sintMonitorResault=1
        sintTimeOutFlag = 1
        Log&amp;#40;&amp;quot;Not enough time to complete script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; ,MonitorURL=&amp;quot; &amp;amp; strURLToCheck &amp;amp; &amp;quot; with string=&amp;quot; &amp;amp; strTextToFind &amp;amp; &amp;quot; POSTdata: &amp;quot; &amp;amp; strURLPostData &amp;amp; &amp;quot;,timeout after &amp;quot; &amp;amp; &amp;#40;TrueTimer&amp;#40;tmStartTimeURLCheck&amp;#41;*1000&amp;#41; &amp;amp; &amp;quot; milliseconds&amp;quot;&amp;#41;
        sintFirstErrorFlag = 1 &amp;#39; set first error detected
        exit function
    end if
end if

&amp;#39;Sending log message to the WhatsUp Event Viewer
Log&amp;#40;&amp;quot;Checking URL&amp;#40;&amp;quot; &amp;amp; sVersion &amp;amp; &amp;quot;&amp;#41;=&amp;quot; &amp;amp; strURLToCheck &amp;amp; &amp;quot; with string=&amp;quot; &amp;amp; strTextToFind &amp;amp; &amp;quot; POSTdata: &amp;quot; &amp;amp; strURLPostData&amp;#41;

strWebPage=GetDataFromURL&amp;#40;sobjWinHttp51,strURLToCheck,strURLMetod, strUserName,strUserPassword,strURLPostData,intActionResault&amp;#41;

if Len&amp;#40;strWebPage&amp;#41; &amp;gt; &amp;#40;sintMaxPageLengthKB * 1000&amp;#41; then &amp;#39;receive Webpage &amp;gt; sintMaxPageLengthKB
    Log&amp;#40;&amp;quot;Script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; strURLToCheck=&amp;quot; &amp;amp; strURLToCheck &amp;amp; &amp;quot; received a webpage that exceeds sintMaxPageLengthKB, the check will only be within the first &amp;quot; &amp;amp; sintMaxPageLengthKB &amp;amp; &amp;quot; Kbytes, actual received length was &amp;quot; &amp;amp; Len&amp;#40;strWebPage&amp;#41; &amp;amp; &amp;quot; bytes.&amp;quot;&amp;#41;
    strWebpage = Left&amp;#40;strWebpage,sintMaxPageLengthKB * 1000&amp;#41;
End if

strWebPage = CleanString&amp;#40;strWebPage&amp;#41;

&amp;#39;If error from web server
If intActionResault = &amp;quot;ERROR&amp;quot; Then
    &amp;#39;Set Error
    sintMonitorResault=1
    &amp;#39;Set error detected
    Log&amp;#40;&amp;quot; URL Error from WinHTTP Requester 5.1&amp;quot;&amp;#41;
    If sintFirstErrorFlag = 0 or intDebugInfo &amp;lt;&amp;gt; 0 Then
        Log&amp;#40;&amp;quot;=== Start error message ===&amp;quot; &amp;amp; vbNewLine &amp;amp; strWebPage &amp;amp; vbNewLine &amp;amp; &amp;quot;=== End error message ===&amp;quot;&amp;#41;
        Log&amp;#40;&amp;quot;Calculated ConnectTimeout for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp;&amp;quot; and MonitorURL=&amp;quot; &amp;amp; strURLToCheck &amp;amp; &amp;quot; with string=&amp;quot; &amp;amp; strTextToFind &amp;amp; &amp;quot; ,was &amp;quot; &amp;amp; slngConnectTimeout &amp;amp; &amp;quot; milliseconds&amp;quot;&amp;#41;    
        sintFirstErrorFlag = 1 &amp;#39; set first error detected
    end if    
    exit function
End If

If intDebugInfo &amp;lt;&amp;gt; 0 Then
    Log&amp;#40;&amp;quot;========== Start of WebPage ============&amp;quot; &amp;amp; vbNewLine &amp;amp; strWebPage &amp;amp; vbNewLine &amp;amp; &amp;quot;========== End of WebPage ==============&amp;quot;&amp;#41;
    End if

&amp;#39;Received String check
if Instr&amp;#40;strWebPage,strTextToFind&amp;#41; &amp;gt; 0 then
    Log&amp;#40;&amp;quot;Success, &amp;quot;  &amp;amp; strURLToCheck &amp;amp; &amp;quot; returns the text=&amp;quot; &amp;amp; strTextToFind&amp;#41;
    else
    &amp;#39;Set Error
    sintMonitorResault=1
    Log&amp;#40;&amp;quot;Error, &amp;quot;  &amp;amp; strURLToCheck &amp;amp; &amp;quot; failed to return the text=&amp;quot; &amp;amp; strTextToFind&amp;#41;
    If sintFirstErrorFlag = 0 Then &amp;#39;log received string
        Log&amp;#40;&amp;quot;=== Start received web page ===&amp;quot; &amp;amp; vbNewLine &amp;amp; strWebPage &amp;amp; vbNewLine &amp;amp; &amp;quot;=== End received web page ===&amp;quot;&amp;#41;
        sintFirstErrorFlag = 1 &amp;#39; set first error detected
    end if    
    exit function
end if
&amp;#39;Find variable in page
If strPreStringsstrFromHost &amp;lt;&amp;gt; &amp;quot;&amp;quot; and strPostStringsstrFromHost &amp;lt;&amp;gt; &amp;quot;&amp;quot; then
    intPreVarStart = Instr&amp;#40;strWebPage,strPreStringsstrFromHost&amp;#41;
    intPostVarEnd = Instr&amp;#40;strWebPage,strPostStringsstrFromHost&amp;#41;
    if intPreVarStart &amp;gt; 0 and intPostVarEnd &amp;gt; intPreVarStart then
        &amp;#39;Add the lenth of the string as starting point to fetch variable 
        intPreVarStart = intPreVarStart &amp;#43; Len&amp;#40;strPreStringsstrFromHost&amp;#41;
        sstrFromHost = Mid&amp;#40;strWebPage,intPreVarStart,intPostVarEnd&amp;#45;intPreVarStart&amp;#41;
        Log&amp;#40;&amp;quot;Success for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;, found variable: &amp;quot;  &amp;amp; sstrFromHost&amp;#41;
        else
        &amp;#39;Set Error
        sintMonitorResault=1
        Log&amp;#40;&amp;quot;Error for script=&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;, failed to find varible between strings: &amp;quot; &amp;amp; strPreStringsstrFromHost &amp;amp; &amp;quot; and &amp;quot; &amp;amp; strPostStringsstrFromHost&amp;#41;
        If sintFirstErrorFlag = 0 Then &amp;#39;log received string
            Log&amp;#40;&amp;quot;=== Start received web page ===&amp;quot; &amp;amp; vbNewLine &amp;amp; strWebPage &amp;amp; vbNewLine &amp;amp; &amp;quot;=== End received web page ===&amp;quot;&amp;#41;
            sintFirstErrorFlag = 1 &amp;#39; set first error detected
        end if    
        exit function
    End if
End if
End Function

&amp;#39;*****************************************************

Function CleanString&amp;#40;strSource&amp;#41;
strSource=Replace&amp;#40;strSource,Chr&amp;#40;9&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Horizontal Tab
strSource=Replace&amp;#40;strSource,Chr&amp;#40;10&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Line Feed
strSource=Replace&amp;#40;strSource,Chr&amp;#40;11&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Vertical Tab
strSource=Replace&amp;#40;strSource,Chr&amp;#40;12&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Form Feed
strSource=Replace&amp;#40;strSource,Chr&amp;#40;13&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Carriage Return
strSource=Replace&amp;#40;strSource,Chr&amp;#40;34&amp;#41;,&amp;quot;&amp;quot;&amp;#41; &amp;#39;Quotation
Dim i
For i = 128 to 255 
strSource=Replace&amp;#40;strSource,Chr&amp;#40;i&amp;#41;,&amp;quot;x&amp;quot;&amp;#41; &amp;#39;Replace all 8&amp;#45;bit characters
Next 
CleanString=strSource
End Function 

&amp;#39;******************************************************

Function GetDataFromURL&amp;#40;objWinHttp,strURL, strMethod, strLogin, strPassword, strPostData,ActionCode&amp;#41;
&amp;#39;strmethod have GET,POST,SOAP11 and SOAP12
&amp;#39;When SOAP11 or SOAP12 the HTTP method is still POST but with diffrent content&amp;#45;types
&amp;#39;Content&amp;#45;type on POST,SOAP11 and SOAP12
&amp;#39;POST = application/x&amp;#45;www&amp;#45;form&amp;#45;urlencoded
&amp;#39;SOAP11 = text/xml
&amp;#39;SOAP12 = application/soap&amp;#43;xml
&amp;#39;
&amp;#39;SOAP11 = SOAP 1.1 and SOAP12 = SOAP 1.2
&amp;#39;100120/Robert Strandberg
&amp;#39;Change timeouts value to global parameter

  Dim strUserAgentString
  Dim intSslErrorIgnoreFlags
  Dim blnEnableRedirects
  Dim blnEnableHttpsToHttpRedirects
  Dim strHostOverride
  Dim strResponseText
  Dim strContentType
    strUserAgentString = &amp;quot;http_requester_whatsup/1.2&amp;quot;
  intSslErrorIgnoreFlags = 13056 &amp;#39; 13056: ignore all err, 0: accept no err
  blnEnableRedirects = True
  blnEnableHttpsToHttpRedirects = True
  strHostOverride = &amp;quot;&amp;quot;
  objWinHttp.SetTimeouts slngResolveTimeout, slngConnectTimeout, slngSendTimeout, slngReceiveTimeout
  &amp;#39;Set content&amp;#45;type
  &amp;#39;Rewriting strMethod to be compliant with previuos versions
  If strMethod = &amp;quot;POST&amp;quot; Then
    strContentType = &amp;quot;application/x&amp;#45;www&amp;#45;form&amp;#45;urlencoded&amp;quot;
  End If
  If strMethod = &amp;quot;SOAP11&amp;quot; Then
    strContentType = &amp;quot;text/xml&amp;quot;
     strMethod = &amp;quot;POST&amp;quot;
  End If
  If strMethod = &amp;quot;SOAP12&amp;quot; Then
     strContentType = &amp;quot;application/soap&amp;#43;xml&amp;quot;
     strMethod = &amp;quot;POST&amp;quot;
  End If
    objWinHttp.Open strMethod, strURL
  If strMethod = &amp;quot;POST&amp;quot; Then
    objWinHttp.setRequestHeader &amp;quot;Content&amp;#45;type&amp;quot;, _
    strContentType
  End If  
  If strHostOverride &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then
    objWinHttp.SetRequestHeader &amp;quot;Host&amp;quot;, strHostOverride
  End If
  objWinHttp.Option&amp;#40;0&amp;#41; = strUserAgentString
  objWinHttp.Option&amp;#40;4&amp;#41; = intSslErrorIgnoreFlags
  objWinHttp.Option&amp;#40;6&amp;#41; = blnEnableRedirects
  objWinHttp.Option&amp;#40;12&amp;#41; = blnEnableHttpsToHttpRedirects
  If &amp;#40;strLogin &amp;lt;&amp;gt; &amp;quot;&amp;quot;&amp;#41; And &amp;#40;strPassword &amp;lt;&amp;gt; &amp;quot;&amp;quot;&amp;#41; Then
    objWinHttp.SetCredentials strLogin, strPassword, 0
  End If    
  On Error Resume Next
  objWinHttp.Send&amp;#40;strPostData&amp;#41;
  If Err.Number = 0 Then
    If objWinHttp.Status = &amp;quot;200&amp;quot; Then
      GetDataFromURL = objWinHttp.ResponseText
     ActionCode=&amp;quot;OK&amp;quot;
    Else
      GetDataFromURL = &amp;quot;HTTP &amp;quot; &amp;amp; objWinHttp.Status &amp;amp; &amp;quot; &amp;quot; &amp;amp; _
        objWinHttp.StatusText &amp;amp; &amp;quot; &amp;quot; &amp;amp; objWinHttp.ResponseText
     ActionCode=&amp;quot;ERROR&amp;quot;
    End If
  Else
    GetDataFromURL = &amp;quot;Error &amp;quot; &amp;amp; Err.Number &amp;amp; &amp;quot; &amp;quot; &amp;amp; Err.Source &amp;amp; &amp;quot; &amp;quot; &amp;amp; _
      Err.Description
     ActionCode=&amp;quot;ERROR&amp;quot;
  End If
  On Error GoTo 0
End Function

&amp;#39;******************************************************

Function TrueTimer&amp;#40;StartTime&amp;#41;
&amp;#39;This function corrected the Timer&amp;#40;&amp;#41; function &amp;quot;feature&amp;quot; of reporting time since midnight.
&amp;#39;Script that uses the Timer&amp;#40;&amp;#41; function that runs over midnight will show wrong time.
&amp;#39;This script expect that the StartTime parameter contanins the Timer&amp;#40;&amp;#41; values when the Time measure started.
&amp;#39;The script will return the corrected elapsed time over midnight.
Dim iTimer,ElapsedTime
iTimer = Timer&amp;#40;&amp;#41;    &amp;#39;Timer&amp;#40;&amp;#41; to variable for faster processing
if iTimer &amp;#45; StartTime &amp;lt; 0 then &amp;#39; Measure have passed midnight.
ElapsedTime = 86400 &amp;#45; StartTime
TrueTimer = ElapsedTime &amp;#43; iTimer
    else
    TrueTimer = &amp;#40;iTimer &amp;#45; StartTime&amp;#41;
end if
End Function

&amp;#39;******************************************************

Function StatusFile&amp;#40;&amp;#41;
&amp;#39;Updates the statusfile and create eventlog message is thats configured in global parameter sintStatusFileMode &amp;lt;&amp;gt; 0
&amp;#39;Uses the Log functions, reads the sstrScriptName,sstrStatusFilePath,sintStatusFileMode,sintMonitorResault global variable.
Dim strStatusFile &amp;#39;Path and filename
Dim objStatusFile &amp;#39;Fileobject &amp;#40;handle&amp;#41;
Dim strTempStatus &amp;#39;previous status
Dim strTxtFile &amp;#39;Working file object
Dim fsoStatusTxtFile &amp;#39;Filesystem object
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = &amp;#45;2, TristateTrue = &amp;#45;1, TristateFalse = 0
strTempStatus =&amp;quot;&amp;quot;
strStatusFile = sstrStatusFilePath &amp;amp; &amp;quot;\&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;.txt&amp;quot;

if sintStatusFileMode &amp;lt;&amp;gt; 0 then &amp;#39; use status file
    &amp;#39;Create folder in first run of the script and log the folder creation
    CreateFolder sstrStatusFilePath,1    &amp;#39;Create file in first run of the script
    Set fsoStatusTxtFile = CreateObject&amp;#40;&amp;quot;Scripting.FileSystemObject&amp;quot;&amp;#41;
    If fsoStatusTxtFile.FileExists&amp;#40;strStatusFile&amp;#41; = False then
        Set objStatusFile = fsoStatusTxtFile.CreateTextFile&amp;#40;strStatusFile, True&amp;#41;
        Log&amp;#40;&amp;quot;Created status file:&amp;quot; &amp;amp; strStatusFile &amp;amp; &amp;quot; for script=&amp;quot; &amp;amp; sstrScriptName&amp;#41;
    end if
    
    Set objStatusFile = fsoStatusTxtFile.GetFile&amp;#40;strStatusFile&amp;#41;
    &amp;#39;Read previous status
    Set strTxtFile = objStatusFile.OpenAsTextStream&amp;#40;ForReading, TristateUseDefault&amp;#41;
    if strTxtFile.AtEndOfStream = False then
        strTempStatus = strTxtFile.readall
    end if
    strTxtFile.close
    &amp;#39;Update the statusfile
    Set strTxtFile = objStatusFile.OpenAsTextStream&amp;#40;ForWriting, TristateUseDefault&amp;#41;
        if sintMonitorResault = 0 then 
        strTxtFile.write&amp;#40;&amp;quot;OK&amp;quot;&amp;#41;
        else
        strTxtFile.write&amp;#40;&amp;quot;ERROR&amp;quot;&amp;#41;
    end if
    Log&amp;#40;&amp;quot;Updated the statusfile, &amp;quot; &amp;amp; strStatusFile&amp;#41;
    strTxtFile.close
    &amp;#39;Update eventlog
    if sintStatusFileMode = 2 then &amp;#39; if eventlog should be updated control previus status
        if sintMonitorResault = 0 and strTempStatus &amp;lt;&amp;gt; &amp;quot;OK&amp;quot; then &amp;#39;Log Status ok
        LogEvent 0,&amp;quot;Success:&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,All URL checks have responded correctly&amp;quot;
        Log&amp;#40;&amp;quot;Logged event normal &amp;quot; &amp;amp; chr&amp;#40;34&amp;#41;&amp;amp; &amp;quot;Success:&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,All URL checks have responded correctly&amp;quot; &amp;amp; chr&amp;#40;34&amp;#41; &amp;amp; &amp;quot; in the windows eventlog&amp;quot;&amp;#41;
        end if
        if sintMonitorResault = 1 and strTempStatus = &amp;quot;OK&amp;quot; then &amp;#39;Log Status error
        LogEvent 1,&amp;quot;Faliure:&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,the overall URL checks failed&amp;quot;
        Log&amp;#40;&amp;quot;Logged event error &amp;quot; &amp;amp; chr&amp;#40;34&amp;#41;&amp;amp; &amp;quot;Faliure:&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;,the overall URL checks failed&amp;quot; &amp;amp; chr&amp;#40;34&amp;#41; &amp;amp; &amp;quot; in the windows eventlog&amp;quot;&amp;#41;
        end if
    end if
end if
End Function

&amp;#39;*******************************************************

Function Log&amp;#40;strTextToLog&amp;#41;
&amp;#39;This Logs information to windows prompt or whatsup eventlog,it also logs to a file if logging are enable
&amp;#39;function reads global variable sintScriptMode and updates the sstrLogTextToFile.
If sintScriptMode = 0 Then
    Context.LogMessage strTextToLog
    else
    Wscript.Echo&amp;#40;strTextToLog&amp;#41;
end if
&amp;#39;Update the sstrLogTextToFile 
sstrLogTextToFile = sstrLogTextToFile &amp;amp; date&amp;#40;&amp;#41; &amp;amp; &amp;quot; &amp;quot; &amp;amp; time&amp;#40;&amp;#41; &amp;amp; &amp;quot; &amp;quot; &amp;amp; strTextToLog &amp;amp; vbNewLine
End Function

&amp;#39;**********************************************************

Function LogToFile&amp;#40;&amp;#41;
&amp;#39;This Logs information to windows prompt or whatsup eventlog,it also logs to a file if logging are enable
&amp;#39;function reads global variable sintLogMode,sstrLogFilePath,sintLogFileSizeKB,sstrScriptName and sstrLogTextToFile.
&amp;#39;When logging to file the logging stops when the logfile reach max limit, to continue with loggning to file the
&amp;#39;existing logfile have to be renamed,moved or deleted.
&amp;#39;uses the Log&amp;#40;&amp;#41; and CreateFolder&amp;#40;&amp;#41; Function.
If sintLogMode &amp;lt;&amp;gt; 0 then
    Dim strLogFileName
    Dim fso
    Dim strLogFile
    Const ForAppending = 8
    strLogFileName = sstrLogFilePath &amp;amp; &amp;quot;\&amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot;.log&amp;quot;
    Set fso = CreateObject&amp;#40;&amp;quot;Scripting.FileSystemObject&amp;quot;&amp;#41;
    &amp;#39;Check if file exist
    If fso.FileExists&amp;#40;strLogFileName&amp;#41; then
        &amp;#39;Control size
        Set strLogFile = fso.GetFile&amp;#40;strLogFileName&amp;#41;
        &amp;#39;Logfile size exceeds max size
        If strLogFile.size/1000 &amp;gt; sintLogFileSizeKB then
            Log&amp;#40;&amp;quot;Failed to write to logfile for script &amp;quot; &amp;amp; sstrScriptName &amp;amp; &amp;quot; ,file exceeds sintLogFileSizeKB value=&amp;quot; &amp;amp; sintLogFileSizeKB &amp;amp; &amp;quot;KB for logfile &amp;quot; &amp;amp; strLogFileName&amp;#41;
            Exit function    
            else
            &amp;#39;File open
            set strLogFile = fso.OpenTextFile&amp;#40;strLogFileName,ForAppending&amp;#41;
        End if
    else
        &amp;#39;Control if folders exist
        CreateFolder sstrLogFilePath,1 &amp;#39;Log folder creation
            &amp;#39;create file
            Set strLogFile = fso.CreateTextFile&amp;#40;strLogFileName, True&amp;#41;
            Log&amp;#40;&amp;quot;Created logfile &amp;quot; &amp;amp; strLogFileName&amp;#41;
        end if
        &amp;#39;File ready for use
        &amp;#39;Log level
        If sintLogMode  = 1  and sintMonitorResault = 1 or sintLogMode  &amp;gt;= 2 then
        strLogFile.Write&amp;#40;sstrLogTextToFile&amp;#41;
        Log&amp;#40;&amp;quot;Added entry to logfile &amp;quot; &amp;amp; strLogFileName&amp;#41;
        end if
strLogFile.Close
End if
End Function

&amp;#39;*********************************************************

Function LogEvent&amp;#40;iEventType,strEventMessage&amp;#41;
&amp;#39;Valid event types:
&amp;#39;0=SUCCESS
&amp;#39;1=ERROR
&amp;#39;2=WARNING
&amp;#39;4=INFORMATION
&amp;#39;8=AUDIT_SUCCESS
&amp;#39;16=AUDIT_FAILURE
Dim WshShell
Set WshShell = WScript.CreateObject&amp;#40;&amp;quot;WScript.Shell&amp;quot;&amp;#41;
    Select case iEventType
        Case 0,1,2,4,8,16
            WshShell.LogEvent iEventType,strEventMessage
        end Select
End Function

&amp;#39;********************************************************

Function CreateFolder&amp;#40;strFolderPath,intLog&amp;#41;
&amp;#39;This Function Creates folders,it also logs to a file if logging are enable
&amp;#39;strFolder should end with a \
&amp;#39;uses the Log&amp;#40;&amp;#41; Function and sstrScriptName global variable.
&amp;#39;intLog = 0 = No logging of folder creation and first line
&amp;#39;intLog &amp;lt;&amp;gt; 0 = Logging of folder creation and first line
    &amp;#39;Control if folders exist
    Dim i,strTempPath,intLoopEnd
    i = 3
    intLoopEnd = 0
    Dim fso
    Set fso = CreateObject&amp;#40;&amp;quot;Scripting.FileSystemObject&amp;quot;&amp;#41;
    &amp;#39;Loop until all folders in the path are created
    Do until intLoopEnd &amp;lt;&amp;gt; 0
    &amp;#39;No more &amp;quot;\&amp;quot; in the string 
        If instr&amp;#40;i&amp;#43;1,strFolderPath,&amp;quot;\&amp;quot;,0&amp;#41; = 0 then 
            strTempPath = strFolderPath
            intLoopEnd = 1 &amp;#39;all folders are extracted from string and created if nessesary
            else
            strTempPath = Mid&amp;#40;strFolderPath,1,instr&amp;#40;i&amp;#43;1,strFolderPath,&amp;quot;\&amp;quot;,0&amp;#41;&amp;#41;
            i = instr&amp;#40;i,strFolderPath,&amp;quot;\&amp;quot;,0&amp;#41;
        end if
        If fso.FolderExists&amp;#40;strTempPath&amp;#41; = False then
            Dim fsoFolder
            &amp;#39;Create folders
            Set fsoFolder = fso.CreateFolder&amp;#40;strTempPath&amp;#41;
            if intLog &amp;lt;&amp;gt; 0 then
                Log&amp;#40;&amp;quot;Created folder path &amp;quot; &amp;amp; strTempPath &amp;amp; &amp;quot; script=&amp;quot; &amp;amp; sstrScriptName&amp;#41;
            end if
        end if
        i = instr&amp;#40;i&amp;#43;1,strFolderPath,&amp;quot;\&amp;quot;,0&amp;#41;
    loop    
End Function

&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/1e8416808a</guid><pubDate>Fri, 12 Feb 2010 08:11:02 +0000</pubDate></item><item><title>SSHMonitor 1.0</title><link>http://ipswitch.hivelive.com/posts/1271c9c069</link><description>&lt;p&gt;&lt;em&gt;Active Monitor by &lt;a href=&quot;http://ipswitch.hivelive.com/people/c84b8528ce&quot;&gt;Robert Strandberg&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;#Statement&lt;br /&gt;
As the developer of this script I have to admit that the script is more complex then my goal was when I started to work with it.&lt;br /&gt;
The reason for this can be found in behavior in Microsoft scripting host .Exec,whatsup active script support&lt;br /&gt;
or lack of knowlege from my side, in whatever combination.&lt;br /&gt;
In the whatsup 14.2 IPswitch will finally have a SSH monitor that will make the this script obsolete on all&lt;br /&gt;
single commands SSH active monitors.&lt;/p&gt;
&lt;p&gt;#Main function:&lt;br /&gt;
For use with WhatsupGold to monitor SSH and telnet hosts.&lt;br /&gt;
The script can be used in four diffrent ways&lt;br /&gt;
1-As an Active monitor controling the output of commands&lt;br /&gt;
2-As an Performance Monitor reporting responsetime to execute commands&lt;br /&gt;
3-As an Performance Monitor extracting values from the output of commands&lt;br /&gt;
4-As an Actice script action.&lt;/p&gt;
&lt;p&gt;The script measure the execution time of the script and terminate before the active script timeout in whatsup.&lt;/p&gt;
&lt;p&gt;The script can (configurable)&lt;br /&gt;
-Logg resault in log file.&lt;br /&gt;
-Run as a script outside whatsup (windows prompt mode,sintScriptMode = 1,started in windows schedule) and update a status file, whatsup monitor the status file that it exist and are &amp;lt;5 byte&lt;br /&gt;
then the reasult of the script i successful.This means that the script can run longer than 60 seconds.&lt;br /&gt;
-Logg script reasult to windows eventlog (only in windows prompt mode)&lt;br /&gt;
-Signal status as exit code 0 = OK, 1 = Fail (only in windows prompt mode)&lt;/p&gt;
&lt;p&gt;This script uses Plink.exe as SSH and Telnet client.&lt;br /&gt;
Plink.exe is the commandline version of the Putty SSHclient for windows.&lt;/p&gt;
&lt;p&gt;#Long story&lt;br /&gt;
We are using the Orsenna plugin for acive monitor for SSH and telnet and this script does not replace&lt;br /&gt;
the Orsenna SSH-plugin, the simple reason is that the Orsenna plugin are much easier to work with and uses&lt;br /&gt;
less CPU then this script.&lt;br /&gt;
However we have on some hosts replaced the Orsenna SSH with this script dune to false alarms from the Orsenna SSH plugin.&lt;br /&gt;
I started the work with this script after I made the URLMonitor script,trying to reuse as much as possible.&lt;br /&gt;
We use this script when we need to extract values or when simulation a user uning a SSH or Telnet session, during longer sessions even the response time can be intresting.&lt;/p&gt;
&lt;p&gt;#Problem #1&lt;br /&gt;
The reason that the responsetime also includes the whatsup server disk I/O delay is beacuse a known limitation in Windows scripting host Wscript.Exec method and the AtEndOfStream properties (and .Read() method) in combination with the TextStream object.&lt;br /&gt;
What does this limitation look like?&lt;br /&gt;
The .Exec method is build for the usage of calling a commandline program and after its finished receive the output.&lt;br /&gt;
Fair enough, that could work... However when using code like: (direct from Microsoft web)&lt;/p&gt;
&lt;p&gt;If Not oExec.StdOut.AtEndOfStream Then&lt;br /&gt;
&amp;nbsp;&amp;nbsp; input = input &amp;amp; oExec.StdOut.Read(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If InStr(input, &quot;Press any key&quot;) &amp;lt;&amp;gt; 0 Then Exit Do&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/p&gt;
&lt;p&gt;The script will halt at the line &quot;If Not oExec.StdOut.AtEndOfStream Then&quot; if there are no more characters to receive&lt;br /&gt;
and will only continue when the started command program terminates or a new character arrives.&lt;br /&gt;
The .read(1) method will behave the same (this behavior is used when calling wait2.vbs when getting the script to sleep).&lt;br /&gt;
The AtEndOfStream dosent work proporly if you ask me, at least I havent been able to use it.&lt;/p&gt;
&lt;p&gt;#Problem #2&lt;br /&gt;
Since Plink.exe in SSH stores the server SHA key it will prompt the user if the key should be stored in registry, Plink.exe sends&lt;br /&gt;
the key update prompt via StdErr and since the script dont know if it will be a normal login via StdOut or a prompt via StdErr the script needs to control both, resaulting in that the script will halt on one of them since no charachter will arrive (see Problem#1).&lt;br /&gt;
The solution to this is to redirect StdErr to StdOut, this functionallity exist in command prompt and thats why the script uses a .bat file with the 2&amp;gt;&amp;amp;1 entry when starting plink.exe.&lt;/p&gt;
&lt;p&gt;Problem#1 in Windows scripting host also means that the script have to use a configured &quot;end&quot; character when reading the StdOut.&lt;br /&gt;
The &quot;end&quot; character makes it possible for the script to detect when there is no more character to expect from host and can stop reading the stdout.&lt;/p&gt;
&lt;p&gt;However in real life production enviroment there will be times when the end characher are missing and the script will then halt causing a &quot;dead-lock&quot; situation, in theory this situation should be able to be handle by terminate the process tree of the specific script but as far as I have seen when testing it seems that Whatsup dosent restore polling of the monitors after missing a &quot;end&quot; character&quot;.&lt;/p&gt;
&lt;p&gt;The workaround I found was to redirect StdOut to a file (the .txt file),read the size of the file and then detect when&lt;br /&gt;
a new characer have been sent from plink.exe.&lt;br /&gt;
The script specific .txt file acts as the StdOut buffer and are read by the MonitorSSH() function call.&lt;br /&gt;
Thats the reason that the response time also inludes the delay in the sripting host file system.&lt;br /&gt;
I use a ramdrive to store the .txt files since it increases speed,offloads the HD and erases the files on startup.&lt;/p&gt;
&lt;p&gt;Since the active scripts in Whatsup dosent seem to support the wscript.sleep method the script uses Wait function within the script to make seconds delay and Wait2.vbs script to reduce CPU time when waiting on characters from Plink.exe, the usage of Wait2.vbs (via wait2.bat) uses the behavior described in Problem#1 above to halt the script for 300 ms until the Wait2() process ends.&lt;/p&gt;
&lt;p&gt;A better solution whould to have a command line wrapper, however I have not found any one useful and I have no plans of make my own.&lt;/p&gt;
&lt;p&gt;Hope you find this script (or parts of it) useful&lt;br /&gt;
/Robert&lt;/p&gt;
&lt;p&gt;Script are attached in a tread as a zip file since its to long to fit the code section.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href=&quot;http://ipswitch.hivelive.com/posts/e5ebb24484&quot; rel=&quot;nofollow&quot;&gt;http://ipswitch.hivelive.com/posts/e5ebb24484&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;VB Script&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/1271c9c069</guid><pubDate>Fri, 12 Feb 2010 08:34:13 +0000</pubDate></item><item><title>Devices with a Specific Monitor Down</title><link>http://ipswitch.hivelive.com/posts/a52082c84a</link><description>&lt;p&gt;&lt;em&gt;Dynamic Group by &lt;a href=&quot;http://ipswitch.hivelive.com/people/34ff20db8c&quot;&gt;Christian Lawson&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;A dynamic group that shows all devices who have a particular monitor assigned and that monitor is in a non-responding state.&amp;nbsp; Replace the monitor name in between the % symbols to choose a different monitor.&amp;nbsp; Be sure to leave the % symbols.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;SQL&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;13&quot;&gt;SELECT DISTINCT Device.nDeviceID   
 FROM Device   
     JOIN PivotActiveMonitorTypeToDevice ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID   
     JOIN ActiveMonitorType ON ActiveMonitorType.nActiveMonitorTypeID = PivotActiveMonitorTypeToDevice.nActiveMonitorTypeID
     JOIN MonitorState ON PivotActiveMonitorTypeToDevice.nMonitorStateID = MonitorState.nMonitorStateID
 WHERE Device.bRemoved = 0 
     AND PivotActiveMonitorTypeToDevice.bRemoved = 0
     AND PivotActiveMonitorTypeToDevice.bDisabled = 0
     AND MonitorState.nInternalMonitorState = 1
     AND ActiveMonitorType.sMonitorTypeName LIKE &amp;#39;&amp;#37;Ping&amp;#37;&amp;#39;&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/a52082c84a</guid><pubDate>Tue, 02 Feb 2010 13:39:44 +0000</pubDate></item><item><title>Generic Show Version</title><link>http://ipswitch.hivelive.com/posts/c8723f4d68</link><description>&lt;p&gt;&lt;em&gt;WhatsConfigured Script by &lt;a href=&quot;http://ipswitch.hivelive.com/people/2ed7216ceb&quot;&gt;Jason Williams&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This script will capture the results of running the &apos;show version&apos; command.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;WhatsConfigured&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;5&quot;&gt;@login

[version] show version

[&amp;#45;] exit&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/c8723f4d68</guid><pubDate>Mon, 18 Jan 2010 20:24:13 +0000</pubDate></item><item><title>Generic Show Spanning-Tree</title><link>http://ipswitch.hivelive.com/posts/567e67d2a8</link><description>&lt;p&gt;&lt;em&gt;WhatsConfigured Script by &lt;a href=&quot;http://ipswitch.hivelive.com/people/2ed7216ceb&quot;&gt;Jason Williams&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This script will capture the results of running the &apos;show spanning-tree&apos; command.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;WhatsConfigured&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;7&quot;&gt;@login

@enable

[stp] show spanning&amp;#45;tree

[&amp;#45;] exit
        &lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/567e67d2a8</guid><pubDate>Mon, 18 Jan 2010 20:21:33 +0000</pubDate></item><item><title>Generic Show Interfaces</title><link>http://ipswitch.hivelive.com/posts/efbe648dae</link><description>&lt;p&gt;&lt;em&gt;WhatsConfigured Script by &lt;a href=&quot;http://ipswitch.hivelive.com/people/2ed7216ceb&quot;&gt;Jason Williams&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This script will capture the result of running the &apos;show interfaces status&apos; command.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;WhatsConfigured&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;7&quot;&gt;@login

@enable

[if&amp;#45;status] show interfaces status

[&amp;#45;] exit&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/efbe648dae</guid><pubDate>Mon, 18 Jan 2010 20:19:21 +0000</pubDate></item><item><title>Cisco Show VLANs</title><link>http://ipswitch.hivelive.com/posts/1ca9b90b73</link><description>&lt;p&gt;&lt;em&gt;WhatsConfigured Script by &lt;a href=&quot;http://ipswitch.hivelive.com/people/2ed7216ceb&quot;&gt;Jason Williams&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;p&gt;This script will capture the results of the &apos;show vlans&apos; command.&lt;/p&gt;
&lt;h3&gt;Language&lt;/h3&gt;WhatsConfigured&lt;h3&gt;Code&lt;/h3&gt;&lt;div style=&quot;width:100%;&quot;&gt;&lt;textarea class=&quot;HL_Form-InputStyle_Full&quot; readonly=&quot;readonly&quot; spellcheck=&quot;false&quot; rows=&quot;5&quot;&gt;@login

[vlans] show vlans

[&amp;#45;] exit&lt;/textarea&gt;&lt;/div&gt;&lt;h3&gt;Disclaimer&lt;/h3&gt;All scripts found on wugSpace are provided as&amp;#45;is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.</description><guid isPermaLink="true">http://ipswitch.hivelive.com/posts/1ca9b90b73</guid><pubDate>Mon, 18 Jan 2010 20:15:45 +0000</pubDate></item></channel></rss>