Failure Action Manager

Failure Actions are performed when an alarm changes state. These can be visual effects or they can be scripts. The visual effects are referred to as Front-End Actions. The scripts are called Back-End Actions.

The 'Failure Action Manager' window is located under the 'Alarms' menu item. Actions are added either manually or with the help of wizards. The wizards are launched from the 'Add Action' toobar item.

Figure 9.12. Failure Action Manager

Failure Action Manager

Once the Action has been created, it can be added to an alarm through the properties window. From the workspace, click on the device which has the alarm attached. Find the target in the properties window. Towards the bottom of the target's properties you will see 'No Actions'. Right click and select add Action. A window allowing you to select an action will open. Any number of actions can be added to an alarm target in this way. Actions can be deleted by right clicking on the Action name. The option to delete will be shown. The properties window will also show the 'Action State'. This can either be enabled or disabled. A disabled action will not be performed.

Figure 9.13. Adding an Action to an Alarm Target

Adding an Action to an Alarm Target

Figure 9.14. Selecting which Action to add to the Target

Selecting which Action to add to the Target

Front-End Actions

Front-End actions are Actions that are shown on the workspace. There are three types:

  • Lines
  • Host Circles
  • Sounds

When adding one of these actions through the wizard, your first task is to select which one you want added, and also to name the action. Additional steps required to complete the creation are unique to the type of Action.

Figure 9.15. Front-End Action Wizard - Select Type

Front-End Action Wizard - Select Type

Lines

Lines are drawn on the workspace. The color of the lines can be defined for each of the 4 main states:

  • OK
  • Critical
  • Warning
  • Unknown

When using the wizard to create a new Action, you will be shown the following screen after the type has been selected.

Figure 9.16. Front-End Action Wizard - Lines

Front-End Action Wizard - Lines

At this point select the color you want the line/s drawn in for each of the states. You also need to 'Select Points' which make up the line. Click on the button to do this. The wizard and the Failure Action Manager will hide themselves, and the workspace will be shown. Using the mouse select the start point of the line. A blue cross will be placed at the point selected. Then again, using the mouse, select the second point. This will also add a blue cross. A line linking the two points will also be added. You can continue like this until all lines required have been made. All lines in an action are joined. If two separate lines are required then use two Actions.

To end the process of constructing the lines press any key. This will bring back the wizard. While selecting the points you can use the arrow keys to modify the position of the last point. You can also use the delete key to remove the last point.

Host Circles

This Action draws circles around hosts (devices) in a pre-selected color depending on the state of the alarm target monitoring the host. The wizard will show the following screen after the type has been selected.

Figure 9.17. Front-End Action Wizards - Host Circles

Front-End Action Wizards - Host Circles

It is common to select the OK color to be transparent. This minimizes unneeded clutter on the workspace.

Sounds

The sound action plays the selected sound files when any alarm in the displayed workspace has one of these Actions selected. Only one sound will be played based on the following order:

  • Critical
  • Warning
  • Unknown
  • OK

In other words, if any alarm is in a warning state on the selected workspace (and it has a sound alarm selected and enabled) then the warning sound is played regardless of how many targets are in OK or Unknown status. Most situations will have the OK sound set to 'none'.

Figure 9.18. Front-End Action Wizards - Sound

Front-End Action Wizards - Sound

Text

This action allows specified text to be added to the workspace depending on the state of an alarm.

When a new text action is created with the wizard the first requirement is that you select the location on the workspace where the text will be displayed. Click on the 'Select Rect' button to do this. This button will hide the wizard while you select the rectangle. Once selected, press any key to get back to the wizard. Before you add your text make sure you are entering the right text for the selected state. The option to select any of the four states can be found beneath the 'Location' button. The text entered is only applicable to the selected state. The formatting options for the text, bold, italics, underline, font, align etc. are offered. The Hide option allows the text to be hidden in a specified state.

Multiple alarm targets can be assigned the same text action. The 'worst' state of all alarms is used to select which text to display.

Figure 9.19. Front-End Action Wizards - Text

Front-End Action Wizards - Text

Back-End Actions

A Back-End Action is run by the Aquirer. Unlike the Front-End Actions the action will be performed even if no workspace is shown. If, for example, you are using the service, and neither the Web-Interface nor Net-Probe is running the action will still be performed.

If an alarm changes state, an 'Action Script' can be executed. The 'Action Script' could simply function as an alert, send an email, phone a number, display a message on the screen etc, or it could try and correct the problem detected.

Each Back-End Failure Action needs at least some of the following properties defined:

Table 9.3. Failure Action Properties

Script File*The script that will be executed at the change in status. Net-Probe comes with a number of prewritten scripts.
Script Language*The type of language the script was written in.
Action HostThis specifies which host will run the script. To set the local host to execute the script use the tags <Local>. If a host is specified then a 'Remote-Probe.pl', running on the host, will be asked to perform the action. If the tag <Host> is used then the host that has the failure will be checked for the running of a 'Remote-Probe.pl' and, if found, the Action Script will be run on that host. If the entry is left blank then the <Local> tag is assumed. Usually either the <Host> or the <Local> tags would be used here.
Perform On attemptThe script will only execute after the Target has been found to have maintained the state for this number of checks. If left blank then 1 is assumed.
Re-Perform afterThe script is re-executed after a given period of time. Only targets that are in Critical or Warning state are re-executed.
ExtrasAn extra field that can be used for whatever you may need. In the case of sending an email this field could contain the email address for those who should receive the email etc. If setup is done using the Failure Action Wizard then a better description of what is required here for the script will be given.
Wait For HostThe function of this option is to make it possible to detect if a host failure has occured, or if just the current target check has failed. If 'yes' is selected then before the action is triggered, the 'Host Check' for the host of the failed service will be run. The result of the check is then offered to Action script. This makes it possible for an action to ignore a service alert if it is infact a host failure. If you were sending out emails, there is an obvious benefit to being able to send out one email saying the host is down, as opposed to sending an email for each service on the host.

Tags marked with an * indicate that they are required for the script to work.

The toolbar on the 'Failure Action Manager' window offers the ability to add an action. You can add the Action manually or use the wizard.

The Wizard's first step lists all located (pre-written) Action Scripts. You can click the script you want or browse the file system and locate some other script. If you do not use one of the located scripts then you will have specify the Script Language. The second and last step of the wizard is shown when 'next' is clicked. Here the Name of the script is guessed. This is only used by Net-Probe to refer to the action. Other requirements are specifying the 'Action Host', 'Perform on Attempt', 'Re-Perform After', 'Extras' and 'Wait for Host'. The 'Extras' option will have a description below the label. If the description ends in an * then the entry is required and the wizard will not let you continue unless present.

Figure 9.20. Failure Action Wizard - Select Action

Failure Action Wizard - Select Action

Figure 9.21. Failure Action Wizard - Settings

Failure Action Wizard - Settings

The other option for creating an action is to use the 'Manual' Option, also offered from the toolbar. Here a new entry will be added to the list. You will then have to enter the items by hand. The wizard is recommended for new users.

Example:

Lets say you have a DNS Server running on a local computer that tends to fail. You could use the 'Check Service', or the 'DNS check' pre-written scripts to check this service. You could then setup an Action Script that uses the pre-written script called 'RestartService.vbs'. This script will take whatever is in the Extras field as the service that needs to be restarted.

Setting up with the Wizard Option:

In the 'Failure Action Manager' select the 'Add Action'->'Wizard' item on the toolbar. Click the checkbox next to ServiceRestart-win32.vbs in the 'Located Actions' list. In Extras type 'dns' without the quotes. Untick 'Wait for Host'. You may want to modify the name to say 'Service Restart (dns)'. Then press the 'Finish' button.

Setting up with the Manual Option:

In the 'Failure Action Manager' select the 'Add Action'->'Manual' item on the toolbar. A new Action will be added to the list. It will be called 'New'. Click on 'New' and edit it to say 'Restart DNS'. This is the name of the Action Script. Now select the file by using the 'Browse button' ('...') that will appear when you click on the value side of 'Scripts'. The pre-written VB Action scripts can be found under the {installed directory}/Scripts/Actions/VB-Script/'. In this directory select the 'Restart Service.vbs' script. For 'Script Lanaguage' select VB-Script. For 'Notify on' set 3, Action Host '<Local>' and extras put 'dns' (no quotes). Select 'No' for Wait for Host.

Shown above are two options of how to setup the Action Script. You only need to do one. Now it is recommended that you test the Action script. One of the toolbar options is 'Show/Hide Advanced test Options'. Click on it so the options appear. In the 'Host' box next in the advanced test options, delete the host, and optionally put 'localhost' or the name of the server running Net-Probe. The host value here is fed into the 'ServiceRestart' script. The 'RestartService' Script will then try and restart the service on the host specified. Since we want to test the option on the local computer, this option needs to be set. Then click the 'Test' option on the ToolBar. You should get a message back saying all went well and the service was stopped and restarted.

During an Action Script test, the options in the 'Advanced Test' are sent to the script with the values specified, but under normal conditions these values come from the Target.

The last Toolbar option is 'Disable/Enable Immediate Apply for Edits'. This option will delay applying any of the changes until the 'Failure Action Manager' is closed. Targets using an edited Action Script will automatically be reloaded after each edit. It may be desirable to delay these reloads until all edits have been done, then only one reload is required for each Aquirer which has a Target that has had it's 'Action' script setting changed.

The Action Script that you wish to be executed on the state change of the Target must be specified in the Alarm Target Properties. 'Action Enabled' setting must also be set to Enabled. Disabled will stop the Action Script.

Also See: the section called “Alarm and Action Options”


Copyright (c) Warren Flemmer 2006www.net-probe.com