4.7.1 Customizing Provisioning

 

Aim

 

In this topic, you will create a simple provisioning template that configures an SNMP Device. This template configures the device with the values given by user and also updates the respective field in database.

 

To give a brief introduction about this provisioning template, this template will aim at configuring the sysName and sysLocation OIDs from the SystemGroup of RFC1213 mib. Before executing this SNMP set operation, it will first retrieve values of the systemGroup OIDs from the database for the managed object that we are trying to provision. The current system Group values fetched from the database are rendered in a form (or screens) where the user view the values for the OIDs got from the topology database. 

 

The second form / screen will show these OID values as fetched from the Network element or the device by doing a SNMP query to the device. The user can change the value for sysName and sysLocation parameter in the second screen which will be set to the device through a configuration task. Once the configuration is completed successfully, the sysName property is updated in the database so that the value set in the Network Element and the values in the database are synchronized.

 

Effort Estimate

 

This task can be accomplished in less than two hours.  

 

Instructions

 

Creating the Provisioning Template

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE Template SYSTEM "Template.dtd">

<Template name="eBon_template" owner="root">

<Stage label="1#">

<InventoryInput id="1" MOName="$TemplateParam$HOST" MOField="sysDescr" default="Unknown"/>

<InventoryInput id="2" MOName="$TemplateParam$HOST" MOField="sysName" default="Unknown"/>

<InventoryInput id="3" MOName="$TemplateParam$HOST" MOField="sysOID" default="Unknown"/>

<InventoryInput id="4" MOName="$TemplateParam$HOST" MOField="community" default="Unknown"/>

<InventoryInput id="5" MOName="$TemplateParam$HOST" MOField="snmpport" default="Unknown"/>

<NEInput>

<ProtocolMap name="snmp">

<Device community="$InventoryInput$4" host="$TemplateParam$HOST" port="$TemplateParam$PORT" retries="3" timeout="5000" version="v1"/>

</ProtocolMap>

<Attribute identifier="1.1.0" label="sysDescr" default="Unknown"/>

<Attribute identifier="1.4.0" label="sysContact" default="Unknown"/>

<Attribute identifier="1.5.0" label="sysName" default="Unknown"/>

<Attribute identifier="1.6.0" label="sysLocation" default="Unknown"/>

</NEInput>

First form entry:

This form displays all the values retrieved from the topology database. All fields in the form, except the community string are non-editable. The user can change the community string here for the device that we are going to configure, the community string provided by the user in this form will be user for the configuration task while provisioning the device.

 

<Form id="1#" title="SNMP Node Provisioning Form - Database" description="Simple template for configuring an SNMP node. Inputs that queried from the database for the managed object name $TemplateParam$HOST are shown as default values.">

<UserInput id="1" label="Snmp Node Name" default="$TemplateParam$HOST" editable="false"/>

<UserInput id="2" label="System Description" default="$InventoryInput$1" editable="false"/>

<UserInput id="3" label="System Name" default="$InventoryInput$2" editable="false"/>

<UserInput id="4" label="System Object Identifier" default="$InventoryInput$3" editable="false"/>

<UserInput id="5" label="Community" default="$InventoryInput$4"/>

<UserInput id="6" label="Snmp Port" default="$TemplateParam$PORT" editable="false"/>

</Form>

 

Second form entry:

 

This form displays the values retrieved by querying the device. Here the user can change the System Name and the System Location values. The new values will be configured/set in the device.

 

<Form id="2#" title="SNMP Node Provisioning Form - Device" description="Simple template for configuring an SNMP node. Inputs that queried from the device $TemplateParam$HOST are shown as default values.">

<UserInput id="7" label="SNMP Agent Hostname" default="$TemplateParam$HOST" editable="false"/>

<UserInput id="8" label="System Description" default="$NEInput$sysDescr" editable="false"/>

<UserInput id="9" label="System Contact" default="$NEInput$sysContact" editable="false"/>

<UserInput id="10" label="System Name" default="$NEInput$sysName"/>

<UserInput id="11" label="System Location" default="$NEInput$sysLocation" editable="false">

<Qualifier type="choice">

<Enum name="$NEInput$sysLocation" value="$NEInput$sysLocation"/>

<Enum name="Office A" value="Office A"/>

<Enum name="Office B" value="Office B"/>

<Enum name="Office C" value="Office C"/>

</Qualifier>

</UserInput>

</Form>

<ConfigTask taskName="SnmpTask" isNewTask="true" isOverwrite="true" isSequential="false">

<ProtocolMap name="snmp">

<Device community="$UserInput$5" host="$TemplateParam$HOST" port="$TemplateParam$PORT" retries="1" timeout="5000" version="v1"/>

</ProtocolMap>

<Attribute identifier="1.5.0" type="4" label="sysName" value="$UserInput$10"/>

<Attribute identifier="1.6.0" type="4" label="sysLocation" value="$UserInput$11"/>

</ConfigTask>

<InventoryUpdate>

<MOUpdate MOName="$TemplateParam$HOST" MOClass="com.adventnet.nms.topodb.SnmpNode" isNew="false" when="onSuccess">

<Property name="sysName" value="$UserInput$10"/>

<Property name="displayName" value="$UserInput$10.success"/>

</MOUpdate>

<MOUpdate MOName="$TemplateParam$HOST" MOClass="com.adventnet.nms.topodb.SnmpNode" isNew="false" when="onFailure">

<Property name="displayName" value="$UserInput$10.failure"/>

</MOUpdate>

</InventoryUpdate>

</Stage>

</Template>

Integrating with the EMS

Attribute Name

Attribute Value

name

eBon Provisioning Example

action_type

openframe

action_value

test.provisioning.TemplateNmsFrame?HOST=${name}&PORT=8001&TemplateName=eBon_Template

 

The entries will be as shown below.

 

<MENU-ITEM name="eBon Provisioning Example">

<JAVA-UI action_value="test.provisioning.TemplateNmsFrame?HOST=${name}&PORT=8001&TemplateName=eBon_Template" action_type="openframe"/>

</MENU-ITEM>

Note: The eBon_template.xml will be deployed under <Web NMS Home>/proviosioningtemplates directory and snmpmenu.xml under <Web NMS Home>/mapdata/menus. This will be handled while packaging the project and deploying the Nar.

 

Result

 

This completes the customization of Provisioning service of Web NMS.

 

 

 



Copyright © 2009 ZOHO Corp. All Rights Reserved.