|
|
|
Monitoring Custom Services
You can also monitor "custom" services. Custom services include:
- TCP/IP services that are not listed on the Services dialog box (such as Radius or IRC)
- TCP/IP services that use a nonstandard port number
You can define an unlimited number of TCP/IP custom services; these become dynamic, sharable objects that can be monitored on any device on any network map.
WhatsUp Gold is shipped with custom services already defined for you:
You can define additional TCP services. For example, you may want to monitor an IRC (Internet Relay Chat) service, a Lotus Notes server, a Microsoft SQL server, or a Microsoft Exchange service.
Defining a Custom TCP/IP Service
The monitoring of a service always involves a protocol handshake
and can also include some additional information exchange between WhatsUp Gold and the service. You can search the response from
the service for an exact match of a particular text string, or you can use rules expressions to analyze the response for a more generic
text pattern.For example, if you are looking for any error message, and you know that all possible error messages have the word "fail" in common, you can use a rule expression to look for just the word "fail." Or, you can create a rule expression that looks for any number of possible error messages. (You can search for "this," "that," or "the other.").
To define a custom TCP/IP service:
- From the Configure menu, Select Custom Services. You see the following dialog box.
![]()
- Click the New button.
![]()
- From the Service Type list box, select TCP/IP Service.
- In the Service Name text box, enter a unique name for the service. This name will be displayed as a selectable option on the Services dialog box of the device properties. Click OK to return to the "Custom Services" dialog box shown above. The name you entered for the new service now appears in the Name list.
- In the Name list, select the name you just entered.
- The Network Type is TCP (as you established in step #3).
- In the Port Number text box, enter the TCP or UDP port that you wish to monitor. For example, 6667 is the standard port for IRC.
- In the Timeout Seconds text box, set the timeout for the service status, in seconds. Note that this is different than the timeout used for polling a device.
- In the Expect on connect text box, enter a text string or a rule expression that you expect the remote service to send back to you on connect. For information on composing a rule expression, see "Using Rules Expressions" .
- In the Send command on connect text box, enter the command to send to the service's port.
Version\r\nGET /Access/myprogs/dbstat.qry HTTP/1.0\r\nAccept: */*\r\nUser-Agent: Ipswitch_Whatsup/6.0\r\n\r\n(This is for a cgi program named dbstat.qry located in /Access/myprogs/; this program performs a status check of a database.)
- In the Expected command response text box, enter text or a rule expression that represents the expected response to the send command. For example, for IRC, this is
:ircFor the HTTP example above, you might scan for an approximate match by using:
.*(successful|success|ok)You can enter a customized string that you have set up on the service to tell you that everything is OK. For more information, "Using Rules Expressions" below.
- In the Send to disconnect text box, enter a command string to disconnect from the service properly. For most TCP/IP servers, the string QUIT\r\n is proper. If a command string is not specified, the connection is closed by sending a FIN packet and then an RST packet.
- Click OK.
Note: You must click the OK button to save the custom service.
Using Rules Expressions
The rule expression syntax is:
Note that search_text can be any combination of literal text and the text patterns shown below.
- In the "Custom Services" dialog box shown on page 88, click the Browse button next to Expect on connect or Expected command response to view the Rules Expression Editor.
![]()
![]()
- Select the contains option to look for messages that contain the search string; select Doesn't contain to look for messages that do not contain the search string.
- Select Match Case to search for text that matches the case of the search string; to ignore case, make sure Match Case is cleared.
- Enter the expected text by doing one or more of the following:
- Type the literal text that you want to search for. For example, if you want to find the word fail, type fail.
- Type the text and quantifiers you want to search for; see "Rules Expressions Text and Quantifiers Tables".
- Click Insert Expression or Insert Quantifier to insert a generic form of a text pattern or a quantifier. Then edit the inserted expression. See "Rules Expressions Text and Quantifiers Tables" below.
- Click OK to save the rule.
Rules Expressions Text and Quantifiers Tables
Quantifier Expression Match Zero or more * Match One or more + Match n times {n} At least n, but not more than m (where n and m are numbers) {n,m} Note: As shown above, the following characters have special meaning in a rule:
{}()|*+,.:%If you want to use one of these characters in a search string, precede it with a backslash. For example, to search for a plus sign, enter \+ in the search string.
Testing a Rules Expression
To test a rule expression, you use the Rules Expression Editor.
![]()
- If the Rules Expression Editor is not visible, from the Configure menu, select Custom Services. Then, select the rule you want to test. Click the Browse button next to the rule to view the Rules Expression Editor.
![]()
- In the lower text box of the Rules Expression Editor, copy a message that meets your intended search criteria, select Contains, and click Test Expression.
![]()
If the rule expression does what you intended it to, The Comparison Text MATCHED the Pattern Specified is displayed.
If the rule expression doesn't test true, The Comparison text DID NOT MATCH the pattern specified is displayed. Edit the rule expression and test again. For a long or complex rule expression, we recommend you test one part of it at a time.
|
Ipswitch, Inc. http://www.ipswitch.com |
| ©Ipswitch 2001 | |||