Designing and Managing Behavior Models - Defining Property Groups and Properties - Using the Node List Window -
Assigning a Property Group to a Node      Tips for Using Property Groups and Properties

Using the Node List Window

You can change the property group of a set of nodes from the Node List window, using a popup menu accessible from that window. It is appropriate to use this method of property group assignment if:

 
  To change the property group for a set of nodes from the Node List window:

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

    NerveCenter displays the Node List window.

    nodelistb

  2. Select one node whose property group you want to change. Then hold down the Ctrl key and select the remainder of the nodes you want to modify.
  3. With your cursor positioned over one of the highlighted entries, press the right mouse button to bring up the node-management popup menu, and select Property Group from the menu.

    NerveCenter displays the Property Group Edit dialog box.

    propGrpEdit

  4. Select a property group from the drop-down list.
  5. Select the Save button.

Using the AssignPropertyGroup() Function

In addition to being able to assign property groups to nodes manually using the NerveCenter user interface, you can use the AssignPropertyGroup() function in a behavior model to change a node's property group dynamically. This function can appear in a poll condition, a trap mask trigger function, or a Perl subroutine.

The syntax for this function is shown below:


   AssignPropertyGroup("PropertyGroupName")

The property group whose name is passed to the function must already exist.

For further information about how to use this function in a poll condition, a trigger function, or a Perl subroutine -- and for information on when it's appropriate to use the function in each of these contexts -- see the sections listed below:

In a Poll Condition

Suppose you want to change the property group assignment for all of your Cisco routers in Building 6. You can collect the names or IP addresses of all these nodes and change their property groups manually using the NerveCenter user interface. However, this can be an error prone process. All you have is your list of routers to make sure that you assign the new property group to exactly the right set of nodes. Alternatively, you can create a poll that will detect whether a polled node is a Cisco router located in Building 6 and will assign the new property group only to nodes that meet these criteria.

 
  To define a poll condition that changes the property group

This procedure details how to define a poll condition that changes the property group of each Cisco router in Building 6, you would:

  1. Display the Poll Condition page in the Poll Definition window.

    pollCondition

  2. Create the condition that determines whether you want to call AssignPropertyGroup():
       if ((system.sysLocation eq "Building 6") &&
    (system.sysObjectID == 1.3.6.1.4.1.9.1))
  3. Add a block including a call to AssignPropertyGroup() to the preceding condition:
       if ((system.sysLocation eq "Building 6") &&
    (system.sysObjectID == 1.3.6.1.4.1.9.1)) {
    AssignPropertyGroup("Cisco6");
    }

    This example assumes that the new property group is named Cisco6.

  4. Select the Save button to save your poll.

Remember that before NerveCenter will use this poll, there must be an enabled alarm in which the poll can cause a state transition.

In a Trigger Function

Here's a simple example of when you might use the AssignPropertyGroup() function in a trap mask trigger function. Suppose that you want to use NerveCenter's Authentication behavior model to monitor your network for excessive SNMP authentication failures. This model includes a trap mask and two polls and looks for three authentication failures on a single node within a ten minute period.

You could enable the behavior model by assigning to the nodes you want to monitor a property group that contains the property snmp and turning on the Authentication alarm. But let's say that you don't want to monitor nodes that have never experienced an authentication failure, because the model does involve some polling. To monitor only nodes whose agents have sent authentication failure traps, you can initially assign your nodes a property group that doesn't contain the property snmp. You can then define a trap mask that looks for authentication failure traps and changes the property group of the nodes from which it receives these traps. Let's assume that the new property group is called Mib-II and contains the property snmp.

 
  To define a trap mask

This procedure defines a trap mask that changes the property group of each node that issues an authentication failure trap, you would:

  1. Create a trap mask that looks for a generic trap 4.
  2. Indicate that the trap mask will use a trigger function instead of a simple trigger.
  3. Display the Trigger Function page in the Mask Definition window.

    triggerFunction

  4. Type in your call to AssignPropertyGroup():
       AssignPropertyGroup("Mib-II");

    You can make this property-group assignment conditional, based on the value of a variable binding if you need to. In the present case, such a condition isn't necessary.

  5. Also type in a call to FireTrigger();
       FireTrigger("TrigggerName");

    Remember that before NerveCenter will use this mask, there must be an enabled alarm in which the mask can cause a state transition.

  6. Save your trap mask.

In a Perl Subroutine

Another place from which you can call the AssignPropertyGroup() function is a Perl Subroutine alarm-transition action. This is the appropriate context for using this function if you want to perform your property-group assignment conditionally, based on information that is available from with a Perl subroutine, but not elsewhere. For example, a Perl subroutine associated with an alarm transition has access to the name of the property group of the node that triggered the transition. You could use this information to change a node's property group only if:

For a complete list of the information that is available to a Perl subroutine, see the section NerveCenter Variables on page 292.

 
  To add a Perl Subroutine to an alarm transition:

The procedure below explains how to add to an alarm transition a Perl Subroutine action that assigns the property group Gateway to the node associated with the trigger that caused the transition. The property group is assigned only if the node's current property group is Mib-II.

  1. Use the Perl Subroutine Definition window to create your Perl subroutine.

    The subroutine should look something like this:


       if ($NodePropertyGrp eq "Mib-II") {
    AssignPropertyGroup("Gateway");
    }
  2. In the Alarm Definition window, open the Transition Definition dialog by double-clicking on the transition to which you want to add the Perl Subroutine action.

    transitionDefinition

  3. Select the New Action button.

    NerveCenter displays the new-action popup menu.

  4. Select the Perl Subroutine action.

    NerveCenter displays the Perl Subroutine Action dialog box.

    perlSubAction

  5. Select the name of the subroutine you created in step 1 from the Name list box.
  6. Select the OK button in the Perl Subroutine Action dialog.

    The dialog is dismissed, and the newly defined action appears in the Actions list in the Transition Definition dialog.

  7. Select the OK button in the Transition Definition dialog.
  8. Select the Save button in the Alarm Definition window.

Using the Set Attribute Alarm Action

There are two ways to change a node's property group using alarm-transition actions: using the Perl Subroutine action and using the Set Attribute action. For information on changing a node's property group using the Perl Subroutine action, see the section In a Perl Subroutine. Using a Perl Subroutine action to change a property group is appropriate when you want to use Perl to do something more complex than simply change the property group of the node associated with the trigger that causes the alarm transition (or the property group of any other node, for that matter). If the only action you would take from a Perl subroutine is to change a property group, you should use the Set Attribute action instead. This approach will save you the trouble of having to write and compile a Perl subroutine.

 
  To add to an alarm transition a Set Attribute action that changes a node's property group:

  1. Open the Transition Definition dialog by double-clicking on the transition to which you want to add the Set Attribute action.

    transitionDefinition

  2. Select the New Action button.

    NerveCenter displays the new-action popup menu.

  3. Select the Set Attribute action.

    NerveCenter displays the Set Attribute Action dialog.

    setAttrAction

  4. Leave the Object Type value set to Node since you want to set an attribute of a node.
  5. Usually you'll leave the Name value set to $NODE.

    $NODE stands for the name of the node associated with the trigger that caused the alarm transition. However, you can change the value to the name of any node in the NerveCenter database if you know in advance the name of the node whose property group you want to change.

  6. Select Property Group from the Attribute drop-down list.
  7. Select a property-group name using the Value drop-down list.

    The property group you choose will become the new property group for the node you chose in step 5 whenever this alarm transition takes place.

  8. Select the OK button in the Set Attribute Action dialog.

    The dialog is dismissed, and the newly defined action appears in the Actions list in the Transition Definition dialog.

  9. Select the OK button in the Transition Definition dialog.
  10. Select the Save button in the Alarm Definition window.

Using OID to Property Group Mappings

When a node is first written to the NerveCenter database, it is assigned a property group based on the object ID of the node. For example, a Cisco router with an OID of 1.3.6.1.4.1.9.1 is, by default, assigned a property group of CISCO-ROUTER-9.x-MIB. The assignments are based on a table of mappings between OIDs and property groups. If no mapping exists for a particular device, that device is assigned the default property group NCDefaultGroup.

Using the NerveCenter client, you can add entries to, or change entries in, this OID-to-property-group table. The new mappings will affect any nodes that are added to the NerveCenter database after you make your changes.

 
  To add a new OID-to-property-group mapping:

  1. From the client's Admin menu, choose OID to Group.

    The OID to Property Group dialog is displayed.

    oidToGroup

  2. Enter an object identifier in the System Object text field.
  3. Enter the name of a property group in the Property Group text field.
  4. Select the Add button.
  5. Select the Save button.


Assigning a Property Group to a Node Tips for Using Property Groups and Properties
29 July 2003