Designing and Managing Behavior Models
-
Defining 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:
Admin
menu, choose Node List
.NerveCenter displays the Node List window.
Property Group
from the menu.NerveCenter displays the Property Group Edit dialog box.
Save
button.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:
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:
Poll Condition
page in the Poll Definition
window.
if ((system.sysLocation eq "Building 6") &&
(system.sysObjectID == 1.3.6.1.4.1.9.1))
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.
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.
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.
This procedure defines a trap mask that changes the property group of each node that issues an authentication failure trap, you would:
Trigger Function
page in the Mask Definition window.
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.
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.
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.
The subroutine should look something like this:
if ($NodePropertyGrp eq "Mib-II") {
AssignPropertyGroup("Gateway");
}
Transition Definition
dialog by double-clicking on the transition to which you want to add the Perl Subroutine action.
New Action
button.NerveCenter displays the new-action popup menu.
Perl Subroutine
action.NerveCenter displays the Perl Subroutine Action dialog box.
Name
list box.
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.
OK
button in the Transition Definition dialog.
Save
button in the Alarm Definition window. 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:
Transition Definition
dialog by double-clicking on the transition to which you want to add the Set Attribute action.
New Action
button.NerveCenter displays the new-action popup menu.
Set Attribute
action.NerveCenter displays the Set Attribute Action dialog.
Object Type
value set to Node
since you want to set an attribute of a node.
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.
Property Group
from the Attribute
drop-down list.
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.
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.
OK
button in the Transition Definition dialog.
Save
button in the Alarm Definition window. 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:
Admin
menu, choose OID to Group
.The OID to Property Group dialog is displayed.
System Object
text field.
Property Group
text field.
Add
button.
Save
button.Assigning a Property Group to a Node | Tips for Using Property Groups and Properties |
29 July 2003 |