Designing and Managing Behavior Models - Using Other Data Sources - HP OpenView IT/Operations - Listing OpC Masks -
HP OpenView IT/Operations      Using Alarms

Listing OpC Masks

This section explains how to display a list of the OpC masks currently defined in the NerveCenter database. The section also explains how to view the definition of a particular OpCmask.

For information on creating a new OpC mask, see Defining an OpC Mask.

 
  To display a list of OpC masks and then display a particular mask's definition:

  1. From the client's Admin menu, choose OpC Mask List.

    The OpC Mask List window is displayed.

    opcMaskList

    This window lists all OpC masks and provides a brief definition of each. For each OpC mask, the window specifies a name and the following information:

  2. Select an OpC mask from the mask list.
  3. Select the Open button

    NerveCenter displays the OpC Mask Definition window.

    opcMaskDefinition

    The mask defined in this figure is named SuFailure. It is looking for a message from IT/Operations concerning a "Bad su" condition. Note that the Object field is empty since the message's object is variable: the object is the user who unsuccessfully attempts to switch users.

Defining an OpC Mask

This section outlines the procedure for creating an OpC mask.

 
  To define a new OpC mask:

  1. From the client's Admin menu, choose OpC Mask List.

    NerveCenter displays the OpC Mask List window.

    opcMaskList

  2. Select the New button.

    The OpC Mask Definition window appears.

    opcMaskDefinition2

  3. In the Name text field, type a unique name for the OpC mask.

    All of the window's input areas are enabled.

  4. In the Application text field, enter the application that the message relates to, or leave this field blank.

    For example, if a message concerns an unsuccessful attempt to switch users, the associated application is su.

    If you're not sure what to enter in the Application field, send the message you're interested in to IT/Operations, and look at it in the Message Details window. The value you use in your mask should correspond to the contents of the Application field in this window. (You can use the same technique to obtain the values for the Group, Type, Object, and Severity fields.)

  5. In the Group text field, enter the message group to which a message belongs, or leave this field blank.

    Message groups are a mechanism used to classify messages. For example, the default message group Backup can be used to identify messages generated by applications that are used for backing up data or by devices that are part of a backup system. Operators are assigned groups of messages to deal with.

    The default message groups are Backup, Database, ITO, OS, Output, Performance, Security, Job, Network, SNMP, and Misc.

  6. In the Type text field, enter the message's message type, or leave this field blank.

    Message types, like message groups, are used to classify messages. However, whereas message groups are used to group messages that a single operator should work with, message types are used to label messages so that they can be easily identified by an event-correlation engine.

  7. In the Object text field, enter the object that caused, detected, or was affected by the condition that the message describes, or leave this field blank.

    For example, an object can be an operator, an application, or a node.

  8. In the Severity text field, enter the severity of the condition described in the IT/Operations message, or leave this field blank.

    The possible severities are Unknown, Normal, Warning, Minor, Major, and Critical.

  9. Select one of the following Trigger Type radio buttons:
  10. In step 9, if you selected:
  11. Select the Save button at the bottom of the OpC Mask Definition window to save your mask.

Writing an OpC Trigger Function

If an OpC mask cannot completely describe the type of message it is looking for by specifying the contents of the message's Application, Group, Type, Object, and Severity fields, it must contain a trigger function. This function, which you write using Perl 5, can include additional conditions that the message must meet, and it can fire different triggers as appropriate.

Most OpC trigger functions are very similar in structure. They follow this pattern:


   if (condition1) {
FireTrigger(arguments);
}
elsif (condition2) {
FireTrigger(arguments);
}
else {
FireTrigger(arguments);
}

The conditions can test the value of any the following message attributes:

For example, suppose that you want to create an OpC mask that detects IT/O messages concerning unsuccessful attempts to switch users to root. This mask would require a trigger function that checked a message's message text for the string "Bad switch user to root." (For details on how to implement this trigger function, see the section Examples of OpC Trigger Functions.)

To assist you in writing OpC trigger functions, NerveCenter provides:

For further information about these predefined functions and variables and the pop-up help menu, see the following sections:

Functions for Use in OpC Trigger Functions

NerveCenter provides a number of functions (actually Perl subroutines) that facilitate the writing of OpC trigger functions. The list below indicates what types of functions are available and where you can find detailed information about each function:

Variables for Use in OpC Trigger Functions

NerveCenter defines several variables for use in OpC trigger functions. These variables contain the values of fields in the IT/O message that NerveCenter is examining.

The complete list of variables that you can use in an OpC trigger function is shown in Variables Used in OpC Trigger Functions:

Variables Used in OpC Trigger Functions

Variable Description

$OpcApplication

Contains the value of the message's application field.

$OpcGroup

Contains the value of the message's message-group field.

$OpcMessage

Contains the value of the message's message-text field.

$OpcMsgId

Contains the value of the message's message-number field.

$OpcNodeName

Contains the value of the message's node field. The node referred to in this field is the one on which the condition being reported occurred.

$OpcObject

Contains the value of the message's object field.

$OpcSeverity

Contains the value of the message's severity field.

$OpcType

Contains the value of the message's message-type field.


To see how these variables might be used in context, see the section Examples of OpC Trigger Functions.

Examples of OpC Trigger Functions

This section presents a couple of example OpC trigger functions and explains what the functions do.

Example 1

Here's a simple example. Suppose that you're monitoring Sun workstations for disk usage and that you want to fire one trigger if a file server's disk usage crosses a certain threshold and another trigger if the disk usage at a user's workstation crosses that threshold. The first trigger will cause an alarm to transition to a state of Major severity, and the second will cause a transition to a state of minor severity.

The trigger function might look like this.


   if ($OpCNodeName eq "FileServer1" or
$OpCNodeName eq "FileServer2" ...) {
FireTrigger("lowDiskServer", $DefaultSubobject);
}
else {
FireTrigger("lowDiskNonserver", $DefaultSubobject);
}

Note the second argument to FireTrigger(), the subobject argument. In the context of an IT/O message, a subobject of the form baseObject.instance makes no sense, so by default NerveCenter uses a subobject of the form $OpCGroup.$OpCObject. This definition of a subobject enables you to create subobject-scope alarms that are driven by triggers fired from OpC masks.

Example 2

The following trigger function looks for unsuccessful attempts to su (switch users) to root by users who don't have permission to become root:


   if ((ContainsWord($OpCMessage, "Bad switch user to root")) and
($OpCObject ne "authorizedUser1") and
($OpCObject ne "authorizedUser2") ...) {
FireTrigger("badSuToRoot");
}

The call to ContainsWord() determines whether the message's message text contains the string "Bad switch user to root," and the expressions containing the variable $OpCOjbect determine whether the user who attempted the su is authorized to become root. (In this type of message, the object field contains the name of the user who issued the su command.)

Documenting an OpC Mask

This section explains how to add documentation (notes) to an OpC mask and what should be covered in that documentation.

How to Create Notes for an OpC Mask

You can add notes to an OpC mask by following the procedure outlined in this subsection.

 
  To add notes to an OpC mask:

  1. From the client's Admin menu, choose OpC Mask List.

    The OpC Mask List window is displayed.

    opcMaskList

  2. Select the OpC mask to which you want to add a note from the list.
  3. Make sure that your OpC mask is not enabled.
  4. Select the Open button.

    The OpC Mask Definition window appears.

    opcMaskDefinition2

  5. In the OpC Mask Definition window, select the Notes button.

    The OpC Mask Notes and Associations dialog is displayed.

    opcMaskNotes

  6. Enter your documentation for the OpC mask by typing in this dialog. See the section What to Include in Notes for an OpC Mask for information on what type of information you should enter here.
  7. Select the OK button at the bottom of the OpC Mask Notes and Associations dialog.

    The OpC Mask Notes and Associations dialog is dismissed.

  8. Select the Save button in the OpC Mask Definition window.

    Your notes are saved to the NerveCenter database. They can now be read by anyone who opens the definition for your alarm and selects the Notes button.

What to Include in Notes for an OpC Mask

We recommend that you include the following information in the notes for an OpC mask:

Enabling an OpC Mask

For an OpC mask to become functional, two conditions must be met:

This section explains how to enable an OpC mask.

 
  To enable an OpC mask:

  1. From the client's Admin menu, choose OpC Mask List.

    The OpC Mask List window is displayed.

    opcMaskList

  2. Select the OpC mask you want to enable from the list.

    The Open button becomes enabled.

  3. Select the Open button.

    The OpC Mask Definition window is displayed and shows the definition of the OpC mask you selected.

    opcMaskDefinition

  4. Select the On radio button.
  5. Select the Save button.

The OpC mask is now enabled.


HP OpenView IT/Operations Using Alarms
29 July 2003