Alerting and Actions
IPHost Network Monitor supports different methods of automatic reaction to undesirable changes in the resources and systems being monitored. Alerts are tied to monitors and are activated when a monitor switches to one of the undesirable states, or the resource performance is restored after problem elimination, or monitor triggers an event.
One of the chief tasks of the monitoring system is executing alerts in response to deviations in the operation of resources being watched (origination of problems). Prompt and informative notification of a problem helps you to substantially reduce the downtime of important resources, which as a result decreases the loss of user work time and improves the effectiveness of administrator work.
The basic variant of IPHost Network Monitor reaction to problem states is sending a message with information on the problem: e-mail notification, SMS over GSM modem or e-mail, instant messaging (using AOL messenger, ICQ, or Jabber client such as Google Talk), sending a message to another computer, playing a sound file and displaying a message in the dialogue window are supported. Methods of reaction based on program start provide additional possibilities. With the help of such alerts one can implement any method of reacting to a problem state: ranging from starting/stopping of a service on a remote machine to rebooting.
Alerts
In IPHost Network Monitor all alerts are gathered in one common list of alerts. All alerts are available for work with any monitor. An alert has a name, type, and parameters. The types of alerts are:
Sending an e-mail to persons concerned. In the message template variables may be used, such as $MonitorName, $CurrentState, etc. (see the full list), which allows for instance using one template for any changes of state.
Sending an SMS message directly over the GSM modem or GSM cell phone attached to the computer. This alert allows you to specify one or several phone numbers to send notifications to. To use this alert you need to configure the GSM modem as explained here.
This alert uses a short one-line message template by default to ensure that a single SMS message is enough to deliver the alert.
Sending an SMS message over e-mail to the cell phone. This alert allows you to select a provider from the list; e-mail address stub for this provider is created automatically and you should enter valid user name or phone number in place of content in square brackets there. You can also specify the e-mail address manually. Make sure to enable the e-mail to SMS service for your phone number (this is often done using the provider's web portal).
This alert uses a short one-line message template by default to ensure that a single SMS message is enough to deliver the alert.
Sending a message to an internet pager. Supported IM clients are: AOL, ICQ and all Jabber clients (Google Talk etc.). Generally, you need two accounts when using this alert: the first account represents IPHost Monitor (the sender) and you enter a password fot it in monitor settings; the second account is the destination address for the message (you should start your IM client under this account to receive messages from IPHost).
This alert uses short one-line message template by default to ensure that a single line in IM chat log is enough to represent the alert. Chat log then looks like a normal log file.
A pop-up message.
It is a standard window with a message if the monitoring client is running at the moment of alert activation, or a balloon connected to the application icon in the system tray with the same message.
Net Send.
It is a similar standard window with a message, or a standard dialogue with a message on a remote machine.
Starting a program.
Starting an executable file or executing the code of a script in a language supported by Windows Scripting Host. The path to the file and arguments should be specified. You can specify program arguments using the template variables. You can also specify the custom account to run the program or script as, by default program or script is executed under the current Monitoring Service account (nornally LocalSystem).
Starting a program remotely.
Allows starting any script or command on remote host over SSH. The command and credentials for accessing the remote host should be specified as explained here. You can specify program arguments using the template variables.
Play sound.
This alert plays a sound file either directly on monitoring host or in a web browser on another host. Supported audio format is MP3; .wav files are converted to MP3 'on the fly' when you define the alert. In order to listen to sound alerts in a web browser, you should
- select Play Sound in Web Browser checkbox in alert properties
- open a Dashboard, Reports, or Alerts tab in IPHost Web interface on destination computer
Sample 'rooster cry' sound is found in 'mp3' subdirectory of IPHost data directory; sample alert using this sound is already a part of the default 'Default Alerting Rule' alerting rule but it is not enabled initially (not assigned to any state changes).
SNMP Set
This alert sets a value via SNMP protocol.
SNMP account used by this action should be granted write permissions for the variable to set. Changing some variables (sysName, sysLocation) may be prohibited by SNMP agent even though they are formally writable. 'Value Encoding Type' setting is normally auto detected basing on OID (using an SNMP GET request issued when you click on a 'New Value' property); however you can also select it manually; default value for this setting is 'MIB lookup (auto detect)' and it instructs IPHost to determine the value type using current set of MIB files so SNMP variable should be defined by one of the MIB files.
We plan to add to IPHost Network Monitor additional types of alerts, such as sending an SMS message using the HTTP forms and sending messages to the users of Skype, Yahoo Messenger and MSN Messenger.
The full list of alerts is available for viewing and editing. You can invoke a form with the list of alerts by selecting the menu Alerting > Alerts (or by pressing the Settings button on the toolbar) then by selecting the tab Alerts in the open window. It is important that changes in an alert affect each alerting rule that uses the alert.
In an alerting rule you specify which alerts to perform on which state change or event and at which time. Each alerting rule is a reusable template that tells IPHost service how to react on monitor state changes and events.
For a monitor one may use an alerting rule:
Assigned for the type of this monitor,
Assigned for the host of this monitor,
One of the global rules,
A custom rule specific to this monitor.
The use of rules assigned for the host or the type of monitor as well as of global rules simplifies configuration changes. By default, a monitor uses the alerting rule from its monitor type and, for example, if it is necessary to add a new alert to all the monitors of the HTTP type, it can be done in one place without having to change the alerting rules in all the monitors of this type.
Each alerting rule consists of a number of rows for individual alerts. On each row, you specify what monitor state changes should trigger the alert (Performance Warning, Performance Problem, Down, ExtendedDown). You can also trigger an alert when monitor leaves a particular 'bad' state, such as when your server becomes back online (using a Recovery checkbox). Note, that a state change from Down or Extended Down to Performance Alert or Performance Warning also counts as a kind of recovery.
Another possible option is to specify that alert should be triggered by an arbitrary event generated by monitor (for example upon the SNMP Trap receipt).
Alerts can also be assigned time schedule (by default, all the whole days of the week are assigned. One can choose the time interval and days of the week when alerts may be generated. Time intervals may overlap midnight (say, by specifying 18:00 for a start and 6:30 for the end. Time is measured in 30-minutes intervals.
Global and Custom Alerting Rules
Rules can be global and custom. The global ones have a name and can be used for any monitor, host or monitor type. You can invoke a form with the list of alerting rules by selecting the menu Alerting > Alerting Rules (or by pressing the Settings button on the toolbar), then by selecting the bookmark Alerting Rules in the open window.
A custom alerting rule may be used for only one monitor, host or monitor type. A custom alerting rule can be created on the basis of a global one by selecting in the Alerting Rule Editor dialog the Custom alerting rule option in the radio button at the bottom of the window. Likewise, you can create a global alerting rule on the basis of a custom one.
This chapter presents a collection of some useful alerts.
The following one-line script called log.bat writes state change messages to the textual log file (it assumes that CygWin toolkit is installed on the server):
C:\cygwin\bin\echo.exe %1 | C:\cygwin\bin\tee.exe -a C:\Program Files\NetworkMonitor\logs\custom.log
You should indicate the full path to log.bat as a Program name and specify the string to log using the Arguments property of Execute program alert. Sample arguments might look like:
"[$Time] '$MonitorName' on '$HostName' is $NewState"
A sample log file produced by the script in this case may be as follows:
[22.09.2008 12:59:34] 'PING' on 'bonus.local' is ok
[22.09.2008 12:59:56] 'c: space' on 'devel.local' is ok
[22.09.2008 13:04:30] 'POP3' on 'svn.local' is down
