IP Custom Services

For

 

White Paper

 

September 22, 2000

 

Updated: July 5, 2001

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table of Contents

 

Introduction.............................................................................................................................................................. 3

Basic HTTP Availability...................................................................................................................................... 4

Page Content Availability............................................................................................................................... 9

Page Availability with Login........................................................................................................................ 13

POP3 Login Custom Service........................................................................................................................ 15

Basic Application Custom Service......................................................................................................... 16

Cold Fusion to Oracle:..................................................................................................................................... 17

Monitoring ASP...................................................................................................................................................... 20

Monitoring Citrix.................................................................................................................................................. 21

Question on “get”  in custom services:............................................................................................. 22

Monitoring a Cisco 3640 Router that is synced to an Internet time source........... 23

Conclusion................................................................................................................................................................ 24


Introduction

WhatsUp Gold has become an important part of our management solution.  Both Phil and I have worked with several enterprise class network monitoring solutions.  We have found WhatsUp Gold to be the best overall solution for monitoring devices, basic web site/page availability and WindowsNT services. Because of our experience with different alternatives we thought this paper might help evaluators of WhatsUp Gold “cut to the chase” and quickly realize the flexibility of this product and better expedite the process of determining whether WhatsUp Gold fits the unique needs of each environment. 

 

Phil and I enjoyed putting this paper together and would appreciate any additions.  If you are interested, please follow our format and send Michael Patterson the instructions for your custom service as outlined in this paper.   Please indicate if we have permission to list your name with the service.

 

Because we both have demanding occupations, we don’t want to become an alternative to the IPSWITCH Telephone Support Organization.  They can be reached at (781) 676-5700.  Have your service contract number (e.g. SWG1111) ready or be prepared to purchase one for a few hundred dollars.  Their support is phenomenal and well worth adding to your purchasing decision.  The team at IPSWITCH was instrumental in helping us create this paper.

 

Good luck with your copy of WhatsUp Gold and don’t forget to join the WhatsUp Gold forum.  Phil and I can be reached there as well.

 

Sincerely,

 

Phil Morneault

Central Maine Power Company

philip.morneault@cmpco.com

 

Michael Patterson

Somix Technologies, Inc.

Mike@somix.com

---------------------

July 5, 2001 added sections on: Cold Fusion to Oracle, ASP, Citrix, “get” question and Cisco Sync Internet Time.

---------------------

 

 

 


Basic HTTP Availability

A common request on the forum is for WhatsUp Gold to monitor the availability of a web server.  This service demonstrates WhatsUp Golds ability to monitor the root page of a web site with a simple HEAD request.

 

To figure out what you need to send to the web server from WhatsUp Gold, launch the telnet program, turn on local echo and configure a connection as shown below using the port the host is serving the application on:

 

Once the connection is made, a request needs to be sent to the server for the root page (index.html).  This is done to see the server’s standard response and is executed with the HEAD command which will query the server for the availability of the page but not actually return the content of the entire page. 

 

HEAD is leveraged because it will not count as a HIT against the web server in the statistics.  NOTE:  while performing this test no TYPOS can be made!! If a typo is made, simply close the session and restart.

 

Upon connection to the server type:

HEAD / HTTP/1.0

Hit enter twice after completing the above.

 

The web server should respond with something similar to what is shown below:

 

This server responded with the following and then closed the connection:

HTTP/1.1 200 OK

Server: Netscape-Enterprise/3.6 SP1

Date: Tue, 25 Apr 2000 12:54:52 GMT

Content-type: text/html

Connection: close

 

“HTTP/1.1 200 OK” is all that is needed in WhatsUp Gold to make our custom service work.

 

Create a custom TCPIP service in WhatsUp Gold and enter the following:

Remember, the \n\n must be entered to signify completion of the request after the “HEAD / HTTP/1.0\n\n” text in the “Send command on connect” box.

\n = line feed

\r = carriage return

 

Save the new custom service and apply it to your server icon as show below:

It is often a good idea to watch the debug log after your custom service has been applied to an icon to watch for any errors.  See below:

 

If an error had been made in the creation of the custom service the error would be shown above in the debug log.  For example, if we had used /r/n in lieu of /n/n in the custom service an error would have occurred.  Please see below for an incorrect configuration:

The consequences of the \r error made above can be seen immediately when the Save button is pressed.  The debug log will show the error as follows:

The debug log is a valuable resource when configuring custom services.  It also helps to temporarily increase the polling interval of the icon to 10 seconds during the creation of the custom service.

 

 


Page Content Availability

Next we will monitor a specific web page for content.   This will require using the GET command, remember this will now cause hits in the statistics.  The following is the page we want to ensure the availability of.

Using TELNET again, send a GET request to the server specifying the full path to the page.

 

 

Now send the command with two returns and you should see the HTML code returned to you.  If it is a long page, it may scroll off the top.  NOTE:  Resize the terminal buffer size to allow viewing of a full page of response (remember the Windows telnet window will not allow scroll back!)

 

If the goal is to ensure that the telephone number listed on a web page is correct for the support organization, WhatsUp Gold will need to look for {207 324-8805}.   To have WhatsUp Gold perform this function, we need to configure the following in the “Send command on connect” box:

“GET /reports/inventory/inventory_index.html HTML/1.0\n\n”.

 

In the “Expected command response” box put in: 207 324-8805

Again, use the debug log to trouble shoot any anomalies.

 

 


Page Availability with Login

The following example describes how to configure a custom service in WhatsUp Gold using login authentication.  For simplicity, we will use the same web page using “HEAD” in lieu of “GET”.

 

We need to capture the encrypted login authorization string sent from a browser with a packet analyzer. 

 

Login to the web page:

We captured our PC sending the following authentication to the WebNM web server with a packet analyzer:

Notice: “Authorization: Basic d2Vibm06d2Vibm0=” is the encrypted password.

 

Now the custom service needs to be configured. The following needs to be placed in the “Send command on connect” box:

HEAD /reports/inventory/inventory_index.html HTTP/1.0\nAuthorization: Basic d2Vibm06d2Vibm0=\n\n

 

NOTICE: The structure of the above command, the 1st half is the same as the Basic HTTP Availability example.  The \n is separates the request from the authorization. 

 

In the  “Expected command response” box type in: HTTP/1.1 200 OK

 

NOTICE: The HTTP version is 1.1, this needs verified on every server platform.

 

 

 POP3 Login Custom Service

The next example explains how to configure a custom service in WhatsUp Gold to monitor a POP3 service.  The default POP3 TCPIP port is 110.  To build the “Send command on connect” string a telnet session must be establish to determine some of the variables.  The telnet session in most cases will be established on port 110:

 

Enter “USER <userID>”

In the above window, we confirm that the POP3 server is requesting a password.

 

In the custom service for  “Expect on connect” enter “+OK” and in the  “Send command on connect” box enter “USER <userID> \n” (e.g. USER attention\n).  In the “Expected command response” box put in “+OK Password”.

 

Because this actually initiates a session it is best to close the session by placing “QUIT\n”.

 


Basic Application Custom Service

The following is an example of setting up WhatsUp Gold to monitor a standards based paging server using SNPP.  Most users use the paging system which comes with WhatsUp Gold however, a good number of installations use a 3rd party paging system (e.g. Attention, TeleAlert, AlarmPoint, etc.). 

 

To configure this custom service the telnet application is generally the application of choice to collect the necessary information.

Above is the information received upon initially connecting to the paging server (i.e. no keys have been pressed). 

 

When “quit” is typed in followed by the enter key, “221 OK, goodbye” is received as outlined below:

 

Because the above response from simply initiating a telnet confirms that the application is running, to configure the service is very simple.

 


Cold Fusion to Oracle:

 

We have set up a WhatsUp Gold custom service that calls a small Cold Fusion (CF) script which, tries to find a record in the Dual table.  The script returns a WHATSUPOK if it's been successful, so WhatsUp will trigger off alarms if it receives any reply but "WHATSUPOK".

 

Below is the CF script that must be configured on the Cold Fusion server:

 

The Cold Fusion script must be present on the server you’re monitoring, as it’s that WhatsUp object that calls the Custom Service.  The script doesn’t have to be in any specific place on the server, as long as the path is specified in the GET command in the Custom Service, but the server does need to have Cold Fusion running on it, so that the Cold Fusion tags can be interpreted.

<----------Begin CF script -----------ŕ

 

<CFTRY>

The below is contained within the CFTRY tag.  See below for details of what this tag does.

 

  <CFQUERY NAME="TEST"

Test is an arbitrary name given to this particular CF query.

 

           DATASOURCE="DEVELOP">

Data sources (ie. Databases – eg. an Oracle, or Access database) are set up in Cold Fusion Studio.  This line tells the query that it’s Data source is “Develop”, which points to our Oracle database.

 

         select * from DUAL

In here are any SQL commands that you want the query to run.  In our case, it’s simply going to try to select everything from the Dual table, which will always have a record in it.        

 

 

  </CFQUERY>

        

  <CFCATCH TYPE="Any">

The CFCATCH tag will catch errors.  We set it up so that CF will try to run the commands contained within the CFTRY tags.  If there are ANY errors (ie. CFCATCH TYPE=”ANY”) then CF will perform whatever is contained within the CFCATCH tags.  In our case, this is nothing, simply to finish the query.

We did this so that if there were any errors trying to run the SQL command above, the query would quit nicely, without returning any errors, or trying to resubmit the commands.

 

 

  </CFCATCH>

 

</CFTRY>

 

 

 

<CFSET result="NO">

The only purpose of the script is to return this variable, ‘result’ to WhatsUp via the HTTP GET request.  We have taken a pessimistic view, and initially set this variable to “NO”.  WhatsUp is only set to look for the value “WHATSUPOKAY”, but we had to set it to something, so it made sense to set it as “NO”, and let a successful outcome of this query change it to “WHATSUPOKAY”

 

 

 

<CFIF isdefined("test.recordcount")>

IF there is a query called test.recordcount, then the test above was successful.  And:

 

  <CFIF test.recordcount gt 0>

  IF the query test.recordcount is greater than 0 (ie. Test contains at least one record), then:

 

    <CFSET result="WHATSUPOKAY">

          set ‘result’ to “WHATSUPOK”

 

  </CFIF>

</CFIF> 

 

<HTML><BODY><CFOUTPUT>#result#</CFOUTPUT></BODY></HTML>

Outputs a simple html page, containing only the value of ‘result.’

 

 


In our custom service, the Whatsup object sends:

GET /whatsuptest.cfm HTTP/1.0\r\nAccept: */*\r\nUser-Agent: Ipswitch_Whatsup/4.0\r\n\r\n

 

And expects to receive:

~.*WHATSUPOKAY

 

If not, then it starts the notification process.

 

 

I hope this makes sense - if you have any queries please feel free to get back

in touch.

 

Andrew Bollington CF Script Writter

Gareth Tupper WhatsUp Gold Administrator  <garetht@ibo.org>

International Baccalaureate Organization

 


Monitoring ASP

I have a problem with an ASP failing occasionally on one of our servers, returning:

 

 "error 0115"

 

We are using WhatsUp 5.1.  In "custom services" what are the correct instructions for checking that ASP is still working?

 

Place a file (e.g. test.asp) on the web server.  Its contents could contain:

 

<%

response.write ("ASPOKAY")

%>

 

Setup WhatsUp Gold to perform a TCP custom service.  Connect to port 80 on the target server and ask for:

 

 HTTP GET /test.asp

 

and content scan for

 

ASPOKAY

 

Whatever you choose to use as your string in the page and to test for, make sure it's something that doesn't appear in either headers or error messages.

 

Mike T email: webdvlpr@hotmail.com

 

 


Monitoring Citrix

Setup a custom service “TCP” connection to the server on port 1494. You should get a response of:

 

  ICA

 

or similar.

Peter Moss email: moss_peter@hotmail.com

 


Question on “get”  in custom services:

I am running a website called www.shopClearviewMall.com.  It is running on Windows2000 Advanced Server and IIS 5.0.  I need to monitor it to make sure that the Microsoft Active Server Pages do not fail in the middle of the night. 

 

The server has one IP address -- 216.3.250.16.  I am using "Host Headers" to have the four following sites bind to the same single IP address:

 

Do you know the syntax of a "Get" in the custom service for an NT web

server running IIS so that the correct web service will "fire" and the default.asp page will be "fetched" from the web server? 

 

I also need to know if you can specify the UserAgent in WhatsUp as well.  If that page gives an error message pertaining to a "cookie", then /test.asp will work as well.

 

Answer:

In Whatsup create a custom service for each domainname you

want to monitor.  In the "Send command on connect" field enter:

 

GET / HTTP/1.1/nAccept: */*/nUser-Agent: Ipswitch_Whatsup/4.0/nHost:www.shopclearviewmall.com/nConnection: Keep-Alive/nCookie:SITESERVER=ID=f4358ced9cca340f686b78c5f0e8/n/n

 

Do not put any spaces.  This one is for shopclearviewmall.  Change the

user-agent to emulate what ever host you want.  You may want to try it without a cookie.  This command worked for me.  Then in the "Expect on command response" you can just put the header response of

 

HTTP/1.1 200 OK 

 

or specify something in the page like  </html> which would wait till the entire page is loaded before considering the page UP.  Do not forget to specify port 80 and the timeout value.

 

This worked for me and gave me a UP status on your page.  I did this by using a packet tracing tool to capture the request I sent and then copied and pasted it into a telnet session.

 

Phil Morneault

philip.morneault@cmpco.com

Central Maine Power Company


Monitoring a Cisco 3640 Router that is synced to an Internet time source

 

Here is what I use to monitor one of our Cisco 3640 routers that is synced to an Internet time source.

 

The custom service monitors the router by checking if it is a NTP time

server and that its stratum level is 2.

 

Custom service NTP

Port 123

timeout 5

Expect on connect (leave blank)

Send command on connect (enter the string below)

%27%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%0%

0%0%0%0%0%0%0%0%0%0%0

UDP

Expected command response %28%2

Send to Disconnect (leave blank)

 

Hope that this is somewhat helpful.  Del  dthompson@bepc.com

 


Conclusion

The Custom Services option in WhatsUp Gold is a powerful utility that is often under utilized or not used at all.  If you are still having trouble with your custom service, consider asking the WhatsUp Gold forum or purchasing a service agreement to take advantage of the Support Organization at IPSWITCH.

 

Warm Regards,

 

Phil Morneault

philip.morneault@cmpco.com

Central Maine Power Company

 

Michael Patterson

Somix Technologies, Inc.

Mike@somix.com

 

If you are looking for a way to extend the monitoring capabilities of WhatsUp Gold and need to provide utilization and service level reports, check out Denika and WebNM.  It is an enterprise solution that can be integrated with WhatsUp Gold http://www.somix.com