New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this...

157

Transcript of New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this...

Page 1: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative
Page 2: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Table Of Contents

EMS TUTORIAL ........................................................................................................ 3

1.1 Foreword........................................................................................................................ 4 1.2 Introduction .................................................................................................................... 7 1.3 EMS Tutorial Tour.......................................................................................................... 9 1.4 Application Overview ................................................................................................... 11

2. TRY IT YOURSELF ............................................................................................. 14

3. APPLICATION DESIGN ...................................................................................... 19

4. MODELING THE MANAGED RESOURCES....................................................... 22 4.1 Detailed Resource Modeling........................................................................................ 25

5. IMPLEMENTATION............................................................................................. 28 5.1 Creating EMS Project .................................................................................................. 30 5.2 Modeling the Switch and Its Components ................................................................... 32

5.2.1 Managed Resource Modeling...............................................................................................33 5.2.2 Customizing TrunkPort Object..............................................................................................36 5.2.3 Customizing Port Object for Status Polling...........................................................................37 5.2.4 Customizing Other Objects...................................................................................................39

5.3 Discovering Switch Devices......................................................................................... 40 5.3.1 Creating Discovery Filter ......................................................................................................42 5.3.2 Customizing Discovery Filter Code.......................................................................................44 5.3.3 Adding Device Components in Database.............................................................................48 5.3.4 Adding Trunk Objects in Database.......................................................................................52 5.3.5 Making Database Transaction Rollback Compliant..............................................................54

5.4 Creating Maps ............................................................................................................. 56 5.4.1 Adding Custom Map - Switch Map .......................................................................................57 5.4.2 Creating Map Filter ...............................................................................................................58 5.4.3 Customizing Map Filter Code ...............................................................................................60 5.4.4 Creating Chassis View..........................................................................................................61

5.5 Fault Management of Switch Devices ......................................................................... 63 5.5.1 Creating Trap Filter ...............................................................................................................64 5.5.2 Customizing Trap handling filter's code................................................................................66 5.5.3 Alarm propagation.................................................................................................................68 5.5.4 Correlating Events and Failures ...........................................................................................72 5.5.5 Status Polling ........................................................................................................................74

5.6 Configuring the Switch................................................................................................. 75 5.6.1 Switch Configuration.............................................................................................................76

AdventNet Inc. 1

Page 3: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.7 Making the Switch configuration secured .................................................................... 78 5.7.1 Using Authorization Service to implement Security..............................................................80 5.7.2 Customizing Configuration screen code to implement Security ...........................................81

5.8 Client-side Implementation .......................................................................................... 82 5.8.1 Building Chassis ...................................................................................................................83

5.8.1.1 Designing Main Screen ................................................................................................................. 87 5.8.1.2 Designing Shelf Screen................................................................................................................. 90

5.8.1.2.1 Designing Access Card .......................................................................................................... 91 5.8.1.2.2 Designing Trunk Card ............................................................................................................ 99 5.8.1.2.3 Building Property Screen...................................................................................................... 105

5.8.1.3 Chassis Configuration ................................................................................................................. 110 5.8.1.4 Compiling and Packaging the Application ................................................................................... 112

5.8.2 Building Configuration Screen ................................................................................ 114 5.8.2.1 Designing Main Screen - Switch Configuration Screen ............................................................... 117 5.8.2.2. Designing Panels for Main Screen ............................................................................................. 123

5.8.2.2.1 Designing System Configuration Panel ................................................................................ 124 5.8.2.2.2 Designing Spanning Tree Details Panel............................................................................... 126

5.8.2.2.3 Designing Port Parameters Panel ............................................................................................ 128 5.8.2.3 Integrating Panels and Adding Actions for Button ....................................................................... 132 5.8.2.4 Compiling and Packaging the Application ................................................................................... 138

5.9 Re-branding............................................................................................................... 140 5.10 Packaging the Project.............................................................................................. 141

6. FAST TRACK IMPLEMENTATION ................................................................... 142

7. DEPLOYMENT AND TESTING ......................................................................... 143 7.1 Installation Notes ....................................................................................................... 143 7.2 Testing the Application .............................................................................................. 145

8. HOW DOES THE APPLICATION WORK? ....................................................... 149

9. KNOWN ISSUES ............................................................................................... 153

10. TROUBLE SHOOTING TIPS........................................................................... 154

11. GLOSSARY ..................................................................................................... 155

12. OTHER TUTORIALS ....................................................................................... 156

AdventNet Inc. 2

Page 4: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

EMS Tutorial

Element Management System AdventNet Web NMS Tutorial Version 1.0 A simple guide to developers on how to build an Element Management System on AdventNet Web NMS 4 using the AdventNet Web NMS Studio. Copyright © 1996-2002 AdventNet, Inc. 5645 Gibraltar Drive Pleasanton, CA 95014 http://[email protected]

AdventNet Inc. 3

Page 5: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

1.1 Foreword AdventNet Web NMS aims at providing real world network management solutions to telecommunications and enterprise markets. It meets the demand of the market for advanced network management features. It fulfills the need of the market for shortest possible deployment time. EMS tutorial will demonstrate how the above market expectations are met by AdventNet Web NMS.

• Real World Network Management Solutions • Why AdventNet Web NMS • Application Life Cycle

Real World Network Management Solutions

Real world network management applications that can be made available on AdventNet Web NMS, categorized by specific domains are

Core Network : Optical and IP/ATM core. Metro Network : SONET/DWDM/Ethernet metro equipment. Edge and Access Network

: Cable, DSL, Optical, and Wireless-based Broadband access technologies, with IP, ATM, and SONET protocols.

The list of Web NMS applications goes on. Why AdventNet Web NMS

AdventNet Web NMS fulfills your specific network management needs. It comes with the most sought after features in the market. They are

• Massive scalability • High availability • Customization

o Modeling managed systems o Extending management services o Supporting variety of management protocols o Various deployment options

It can be customized and extended to suit your needs. The extensibility makes the design of the application more organized. The customization addresses the specific needs of the application to mange your custom equipment. AdventNet Web NMS comes bundled with a developer suite with rich tools, called AdventNet Web NMS Studio. This tool reduces the development life cycle time drastically. This in turn brings host of benefits:

• The time taken to deploy the application is lesser compared to the conventional development and deployment techniques.

• The human resources required are cut to a fraction of what is required for conventional techniques.

• The tool supports user from the level of novice to professional. The tool contains UI-based Wizards to accomplish all the simple tasks if you are a novice user and makes room for custom code if you are a professional to handle advanced tasks.

AdventNet Inc. 4

Page 6: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

• The required skill level of the user is also brought down. For example, you do not require Java knowledge to use the tool and only network management and your element domain knowledge will suffice.

All these benefits put together will make AdventNet Web NMS a wise choice for your network management solution. Application Life Cycle

AdventNet Web NMS offers a comprehensive development environment for building your management solution. This section explains how the complete product life cycle needs of your management solution are realizable using AdventNet Web NMS. They are captured in five easy steps that you can follow to build your management solution, as below: Step 1: Modeling the managed elements Step 2: Customizing managed object services Step 3: Rebranding the management solution Step 4: Packaging Step 5: Deployment and Testing The following diagram gives an overview of the experience of building management solutions with the AdventNet Web NMS.

AdventNet Inc. 5

Page 7: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Step 1: Modeling the Managed Elements

Each managed system comprises many inter-related elements that need to be individually managed. You start with modeling your elements, so that you can capture the data, operations and state of the elements and the relationships between the elements. The Web NMS provides a comprehensive, simple, and easy to learn information model, using which the various elements and hence the managed system can be modeled. The basic element of the Web NMS information model is the ManagedObject. The Web NMS also has models for various common IP network components such as Network, Node, SNMP Node, TL1 Node, etc. These form the core objects of the Web NMS information model. You have to extend any of the core objects of Web NMS to model your managed element. The core objects can be extended, by adding attributes, operations and state to those objects (modeling the data, operations and state of your element in addition to capturing the relationship).

This task can be easily accomplished by using the Managed Resources of AdventNet Web NMS Studio. It helps you walk through the steps in terms of the object that needs to be extended, the new attributes of your element, etc. Then it generates MO classes, relational classes, and database schema files for your managed element.

Step 2: Customizing Managed Object Services

AdventNet Web NMS offers a number of management services to the managed objects. The southbound services that populate the database with information from the elements such as data collection, status polling, etc., are classified as the mediation services. The services that enable the user to perform network planning, error management, and service deployment tasks are classified as the management services. Management services include event correlation, element configuration, service provisioning, access control, etc.

Using the module management services available as part of the Web NMS framework, you could also build other management application modules.

Step 3: Rebranding the Management Solution

You can rebrand the application to display the name of your company, the name of your product, and your logos. The I18N tool, bundled in AdventNet Web NMS Studio, helps you rebrand your application by replacing references to AdventNet and Web NMS. The logos, images, and icons can be changed by modifying configuration files.

Step 4: Packaging

You can package your application resources alone as a NAR (NMS Archive file) that can be installed over the AdventNet Web NMS.

Step 5: Deployment and Testing

Before testing your management solution, make sure all the third-party packages are installed correctly and you have the required privileges to use them for your testing. Once you start your application, look at the Web NMS server log files to make sure all the services are started successfully and are running.

Having deployed your application at a customer's site, you will be required to support the product and provide upgrades as part of support. AdventNet Web NMS Studio available in AdventNet Web NMS makes it easy to handle upgrades.

AdventNet Inc. 6

Page 8: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative examples to help you understand the choices to be made during development. This describes how AdventNet Web NMS Studio can be used to simplify the development of an EMS. The Tutorial

Consider a real life scenario wherein you need to manage five Switches, which support SNMP. This tutorial will help you achieve the same by using AdventNet Web NMS by building an EMS (Element Management System) to manage the Switches. The tutorial will walk through a series of steps, which will help you understand how a unique EMS solution can be built using AdventNet Web NMS Studio to suit your needs. Use of AdventNet Web NMS Studio will make the development of the application virtually very little or zero coding. This makes the development faster. This tutorial helps you to build only a sample application. In which, it adopts a generic network device (i.e., a Switch, which supports SNMP) as an example. This limited scope example will serve only to illustrate what can be built on AdventNet Web NMS and it is only a subset of the custom capabilities of AdventNet Web NMS. However, for many EMS applications of specific needs, this basic example can be extended. This topic covers the following details of the tutorial:

• The Intended User • Prerequisites • Related Information • Printed Version • Tutorial Conventions • At the End of the Tutorial

The Intended User

This tutorial is intended for those, who are interested in developing an Element Management System using the AdventNet Web NMS. Prerequisites

To develop this tutorial application, you will need a good knowledge of Network Management System. Knowledge of Java programming, SQL, and relational database concepts will be an added advantage, but it is not essential. Related Information

This tutorial provides concise information about AdventNet Web NMS Studio and AdventNet Web NMS. For detailed information, refer to the Web sites listed below:

1. AdventNet Web NMS Studio documentation - from the following URL: <Web NMS Home>\StudioTools\Studio\help\index.html

2. AdventNet Web NMS documentation - from the following URL:

http://www.adventnet.com/products/webnms/help.html

AdventNet Inc. 7

Page 9: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Printed version

To print this tutorial, follow these steps:

1. Ensure that Adobe Acrobat Reader is installed in your system. 2. Download the PDF version of this document from the following URL:

http://download.adventnet.com/products/webnms/ems_tutorial.pdf

3. Click the printer icon in Adobe Acrobat Reader. Tutorial Conventions

The following table lists the typographic conventions followed in this tutorial:

Font style Uses Arial Bold File name Arial Italic Directory Arial Bold Italic Methods / Interfaces / Classes Courier New Code snippet Courier New Bold Italic Highlighting important code snippets

At the end of the tutorial

You will learn how to

• Build an EMS by customizing AdventNet Web NMS with the help of AdventNet Web NMS Studio.

• Model Objects. • Achieve Fault, Configuration, Performance and Security managements, and Discovery of

network elements.

AdventNet Inc. 8

Page 10: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

1.3 EMS Tutorial Tour Welcome to the EMS Tutorial Tour This tutorial is in three stages.

1. In Stage One, you are provided with the ready built application. For a quick look at what the application is all about, you can straight away deploy the application in AdventNet Web NMS and experience the outcome of the application before getting into building the application on your own. Refer the Try it yourself topic for Stage One of this tour.

2. In Stage Two, you are guided to build the application yourself. You are provided with elaborate details about building the Application using the AdventNet Web NMS Studio. Refer the Detailed Implementation section in full for Stage Two of this tour.

3. In Stage Three, you are provided with the ready built project. Refer the Fast Track Implementation section in full for Stage Three of this tour. You can also experiment with the Project. Open the Project in AdventNet Web NMS Studio and make the changes, customize, add new features etc., as per your requirement, compile and package it. Deploy it in AdventNet Web NMS. You can see the effect of changes you done in the application.

Hope you will enjoy this tour and experience easy and quick Application development.

AdventNet Inc. 9

Page 11: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

The following flow-line diagram has image mapping to the corresponding topics.

Fig: Tutorial Tour

AdventNet Inc. 10

Page 12: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

1.4 Application Overview In this section, an overview of the Tutorial Application is provided. Normally, while building an EMS you would require external Switches simulator or real Switches (which in any case is not advisable) to run and view the result of the example application. However in this tutorial to avoid external dependencies the tutorial has been modeled/designed to convert the first five network elements discovered which support SNMP, as SNMP Switches. The discovered elements will be modeled as customized Switch objects and predefined slots, cards, etc. are also added. The tutorial application provides information on how to develop an EMS to manage the five Switches. The tutorial application is built exploring the various modules of AdventNet Web NMS.

• Application Specification • Description of System Used in the Application • Implementation in a Nutshell

Application Specification

Name of the Application : Element Management System Version of Web NMS used

: Web NMS Release 4

Compatibility with other Versions

: Not compatible with previous versions of Web NMS

Tools used and their Versions

: AdventNet Web NMS Studio 4.0

Platform-specific requirements

: No special requirements

Description of system used in the Application

The example element used in the application is a generic switch. The switch is assumed to have two types of cards. One is Trunk card and there are four such cards. It has a single Trunk port. The Trunk port connects this switch to another switch. Other is Access card and there are four such cards. It has four Access ports. The Access port connects network devices to this switch, which offer connection services. The switch is assumed to have 16 slots. Alternate eight slots, from the first slot hold the cards. The remaining eight slots are vacant. The cards are arranged alternately, starting with Trunk card. Implementation in a nutshell

The tutorial application covers various aspects of network management. Various modules of AdventNet Web NMS are used to achieve the network management objectives as listed below:

• Modeling the Switch and component Objects • Discovering Switch devices • Customizing Maps to display the Switches • Managing Alerts of Switch and its components • Configuring the Switch • Making the Switch configuration secured • Rebranding AdventNet Web NMS as your EMS

AdventNet Inc. 11

Page 13: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Modeling the Switch and component Objects

In AdventNet Web NMS, the managed device data is stored in the database for persistency. For storing the managed devices' data into a database, you need to model the managed device and it's components. The tutorial explains how the first five SNMP Nodes discovered are modeled as switches. In order to simulate a real time switch, the related components objects like shelves, slots, cards, and ports are modeled. The Object Modeling topic illustrates how the existing AdventNet Web NMS Managed Object model is extended to emulate a real SNMP Switch device and it's sub components. Discovering Switch devices

The Discovery process of AdventNet Web NMS, discovers all the elements available in the managed network. The tutorial explains how the Discovery process is customized to filter out the first five SNMP Nodes. The discovered nodes are modeled as explained above and stored in the topology database for effective management. The Discovery topic illustrates how to customize discovery and store the discovered information in the Topology database. Creating Maps to display the Switches

AdventNet Web NMS provides default maps with default layouts and symbols to display of various networks and element groups. The tutorial explains how the custom maps are created from the elements of the topology database and how to customize the display and configuration of network maps. The discovered switches are drawn on the map using a custom map layout. The various components of the switch are shown in the Chassis view. Managing Alerts of Switch and its components

AdventNet Web NMS implements Fault Management to identify failures in the managed network elements. The tutorial explains how to customize the Fault management features.

• The Trap handling topic explains how to process traps effectively. • The Alarm propagation topic elaborates how to notify failure events to affected

components. • The Correlating alarms topics explains how to minimize the clutter due to multiple

related failures and alarms. • The Status polling topic deals in a detailed manner on how to carryout surveillance of

Switch and components periodically. Configuring the Switch

AdventNet Web NMS enables you to configure the network devices, where you can also schedule a task to get executed at any convenient time. If the configuration of the device does not succeed then the previous settings of the device can be restored. All the configuration information (tasks) are cached in a XML file which can be reused. The tutorial illustrates how Configuration Management can be implemented to configure the modeled Switch components.

AdventNet Inc. 12

Page 14: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Making the Switch configuration secured

AdventNet Web NMS implements Security management using the Authorization Service. The tutorial implements Security management using the Authorization Service of Web NMS. Rebranding AdventNet Web NMS as your EMS

The tutorial re-brands AdventNet Web NMS into Acme EMS. The logo, images etc., can be replaced with your own. You have the i18N tool for internationalisation of various UI reference of AdventNet and Web NMS. With these the EMS developed can be easily re-branded.

AdventNet Inc. 13

Page 15: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

2. Try It Yourself In this section, the steps to deploy the ready built application are provided. This would help you run the application by yourself and view the results. The steps involved are

• Before You Begin • Get the Application's NAR File • Deploy the NAR in AdventNet Web NMS • Start NMS • View the Result

Before You Begin

• Download an evaluation copy of AdventNet Web NMS 4. • Get it installed in your machine.

For pertinent information, refer to the following document resources in the Installation Guide of AdventNet Web NMS 4

• System Requirements • Startup Options

Get the Ready Built application

The working example comes bundled with AdventNet Web NMS, as a NAR file. The NAR is actually the ready-built application. Another alternative is to download the latest version of the tutorial from the AdventNet Web site and use the NAR in it.

a. Use the bundled application The working example comes bundled along with AdventNet Web NMS, as a NAR file. OR

b. Download the latest version You can download the latest version from the Web site at the following URL: http://download.adventnet.com/products/webnms/tutorials/ems_tutorial.zip Unzip the zip file in the <Web NMS HOME> directory.

Select the NAR file mentioned below from the <Web NMS HOME>/tutorials/ems_tutorial directory.

EMS_Tutorial1.0.nar Deploy the Application in AdventNet Web NMS

Carry out the instructions given in the Installing the application section to deploy the NAR file. Start NMS

• Start the Web NMS Launcher, by invoking WebNMSLauncher.bat/sh file in the <Web NMS HOME> directory.

• Double-click Start Web NMS Server icon in the Web NMS Launcher.

AdventNet Inc. 14

Page 16: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

View the Result

Connect a Browser or Application client to the Web NMS Server in port 9090 as follows: Browser Client : Enter http://<host-name or IP>:9090 in the address bar Application Client : Double-click Application Client icon from the Web NMS Launcher Log in as user root and password public. In the left side frame, you will see the map tree. In that you can see the ACME > EMS-Panels > Network Maps > Switches node. Under this node you can see the five switches discovered.

Displaying Switches in a Map The Switches map will be the default map when you open the client. The following image is a snapshot taken from the application, which shows the switches map, where all the switches are laid out in the map with their interconnections. The interconnections are done between the Trunk Ports of each switch. The bandwidth of the trunk is also shown in the link. In the image you can see an individual map view for each discovered switch in the left-hand side tree under the switches map.

On double-clicking the individual Switch nodes, you can see the Chassis view of the individual switches. The Switch elements have right-click menu with five menu items, viz., Alerts, Events, Configuration, Chassis View Update Status Select Chassis View menu item will display the Chassis view of the Switch element.

AdventNet Inc. 15

Page 17: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Chassis View of the Switch Device The Chassis view of Switch device shows the various components of an individual switch. The diagram is given below. The map shows a shelf with 16 slots numbered (0-15). Each slot has a card associated with it. The alternate cards are modeled as empty. The cards, which contain only one port are called Trunk Ports and four such Trunk Ports are added to the switch. The remaining cards contain four Access Ports. You can view the Alerts, Events, and Properties of the individual sub-components of the Switch (i.e., Card and Port).

AdventNet Inc. 16

Page 18: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Alerts from the Switch Device and Sub-components and Its Propagation Right-click a device and select Alerts from the pop-up menu to see its alerts. The following diagram depicts how events are propagated from a child node (Port) to the parent container (Card) and how they are correlated to generate more meaningful alarms.

Configuring the Switch and Sub-components parameters In this application, the configuration management has been used to configure the modeled switches. The following GUI pops up on clicking configure switches option after selecting the switches you wish to configure from the switches map.

AdventNet Inc. 17

Page 19: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Secured Configuration of the Switch Right-click the device and select Configuration from the pop-up menu to see the Switch Configuration screen. The Configuration Management screen is used to demonstrate the security feature based on the operation assigned to the user. The image below has two of the tabs removed, which indicates that the user is a normal user and has no permission to change the Spanning tree and Port parameters of the switch. If you log in as an administrator, the STP and PortParameters tab will be available.

AdventNet Inc. 18

Page 20: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

3. Application Design Aim To come up with the design on customizing the AdventNet Web NMS platform features in order to provide various functions to the EMS, as specified in the requirements. EMS Management Requirements

• Modeling the Switch device as Managed Resource • Discovering the Switch devices in the network • Representing the Switch components in the Map • Managing the Events and Alerts of Switch and its components • Configuring the Switch Device • Rebranding AdventNet Web NMS as your EMS

Managed Resource Modeling

Objective Modeling a device enables you to represent the various attributes and the behavior of the corresponding physical device and its components in a convenient way so as to reflect their current state at any time. The EMS stores these persistent data in the database. Modeling the Switch and its components topic elaborately deals with various aspects to be considered for designing the Managed object. Tasks Define the resources to be managed by the EMS. The properties of the Device and its Components that will be used for modeling the resources are given below: Switch serialno, location Shelf Serialno Slot slotno, state Card serialno, cardType Port portno, speed, snmpInterface, switchnode Access Port remoteID, remoteStatus, portType Trunk Port trunk, remotePortID, portType Trunk source, destination, srcPort, destPort, bandwidth The Role of Studio Using the Resource Factory of the Studio, all the above resources can be modeled easily.

Discovering Switch Devices

Objective To automatically discover and add the Switch devices and their components into the topology database of Web NMS. This will necessitate identifying the component hierarchy of the Switch devices. Tasks

• Create a Discovery Filter defining the containment hierarchy of the device and its components.

AdventNet Inc. 19

Page 21: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

The Role of Studio The Discovery Filter Wizard will help you define the discovery filter. During discovery, Web NMS will discover the device and its components and store them in the database according to the containment hierarchy that has been defined in the discovery filter.

Representing the Switch Device and Its Components in the Map

Objective To graphically represent the Switch Devices and its components, illustrating the Containment hierarchy, in the map view of Web NMS Client. Tasks

• Create a custom map layout class to customize the format in which the

MapContainers are arranged in the map view of Web NMS Client. • Create a custom map renderer class to customize the shape, style and color of the

Map Containers, which gives the flexibility of depicting the various components in the map view of Web NMS Client.

The Role of Studio Using the Map Filter Wizard of the Studio, all the above tasks can be completed.

Managing the Events and Alerts of Switch and Its Components

Objective To monitor and manage the failures in the system effectively including, polling the Switch Device and its components periodically for their status and thereby take preventive action where necessary. Tasks

• Convert the failure notifications (Traps) into meaningful Events. • Check the Device Status by polling the devices.

The Role of Studio Using the Trap Filter Wizard of the Studio, it is easy to create a Trap Filter that filters the traps and converts them into meaningful Events which can be managed. The Managed Object is modeled to check the status of the device.

Configuring the Switch Device

Objective The EMS Application should be capable of controlling and configuring the device. It should be able to switch the status of the card from active state to inactive state. Tasks

• Identify the Configuration commands to activate and deactivate the Switch Card.

AdventNet Inc. 20

Page 22: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

The Role of Studio The Configuration Wizard of Client Builder is used to configure tasks and set Device lists where the tasks have to be executed.

Rebranding AdventNet Web NMS as your EMS

Objective The EMS has to be renamed according to your requirements. All the relevant images and icons will have be changed to reflect its new name (For example, Acme EMS). Tasks

• Replace the existing AdventNet & Web NMS images and logo with Acme. Internationalize the text and buttons that appear in the Client of the EMS.

The Role of Studio Using the I18N Editor, the EnglishToNative properties file will be changed to internationalize the text that appears in the Client. The images and logo of AdventNet will also be replaced with that of Acme using this Editor.

AdventNet Inc. 21

Page 23: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

4. Modeling the Managed Resources This topic concentrates on various aspects involved in the design of Managed Object. The various aspects covered are listed below:

• What Are the Different Methods Available to Design Managed Resources? • How is the Web NMS Core Object Resource Modeled? • An Example Modeling of Object Resources for This Application • Class Diagram of Managed Resources of EMS Application • Naming Convention Used in Modeling the Managed Resources

What Are the Different Methods Available to Design Managed Resources?

We have two choices for our design of managed elements.

1. Using the dynamic properties of Web NMS Managed Objects. 2. Extending the existing Managed Objects.

The former is a quick solution requiring minimal design effort but a cumbersome design. The later is a cleaner design. The second choice will serve our application needs better, because it provides a neat design. This approach also results in a better table structure for storing our objects in an RDBMS. Hence, the second approach is adopted in this tutorial. How is the Web NMS Core Object Resource Modeled? The core Object model of AdventNet Web NMS is simple and is easy to learn and extend for each application. The elements of the core model are designed for IP networks and are sufficient to represent common IP networks. However, for most specific applications, e.g., the management of a cable modem system, the model will be extended. The topology database has the following base elements:

ManagedObject : The base class of all objects in the Topology database.

TopoObject : The base class of all IP objects in the Topology database.

Network : This object represents an IP network.

Node : This object represents an IP network node.

SNMP Node : This object represents an IP network node with an SNMP Agent.

IP Address : This object represents an IP interface.

SNMP Interface : This object represents an IP interface with an SNMP Agent in its parent node.

AdventNet Inc. 22

Page 24: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

An Example Modeling of Object Resources for This Application

Let us look at an example of modeling a complex network device, consisting of shelves, slots, cards, and ports. This generic example will illustrate the modeling procedure. The EMS tutorial application models a switch with associated shelves, slots, cards, and ports. The following relationships are assumed between the Managed Objects:

Switch : This represents a manageable switch that is initially discovered via SNMP, i.e., Web NMS finds it as an SNMP Node in the network or is manually added by an operator.

Shelf : The switch consists of one or more shelves. For this example, we will work with only one shelf, though the example can be extended to multiple shelves.

Slot : Each shelf consists of 16 slots, which are numbered 0-15. Card : Each slot consists of a card, which can be of different types. In this

example, we will work with only one card type. The card object has a field called Card type to specify the card type.

Port : Each card can have multiple ports. A port can be an access port or a trunk port.

AccessPort : The AccessPort class is a subclass of port and models a port on an access card.

TrunkPort : The TrunkPort class is a subclass of port and models a port on a trunk card.

Trunk : This models a link between switches, i.e., a trunk connecting two switches.

These components are modeled in the Web NMS topology database and these definitions are used to build an EMS functionality into our application. Class Diagram of Managed Resources of EMS Application

The following class diagram gives an overview of Managed Object subclasses in this application.

AdventNet Inc. 23

Page 25: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Naming Convention Used in Modeling the Managed Resources

Although a naming convention is not essential, it provides some benefits. It supports the requirement of providing unique keys for all managed objects. It also allows us to easily identify some useful object properties, without having to explicitly store these properties in the object. We will use a naming convention for these objects that will make it easy to tell which object we are dealing with. This will also help with filtering, etc. if we wish to use them. The naming convention will be of the form: <switchname>_Shelf<N1>_Slot<N2>_Card_Port<N3> where <switchname> will be the name of the switch and <N1>, <N2> and <N3> are numbers to identify the ManagedObject within a container.

Note: In this example, although we have used a detailed object naming convention, we have not made use of object names for accessing such properties for better design considerations. We will create a set of objects based on this model and start with the discovery or manual addition of the switch. In the example code provided, we assume the first five SNMP Nodes to be switches instead of looking for specific switches.

Managed Object Parent-Child Containment Relationship

In our EMS example model, the many-to-one containment relationship needs to be modeled across the device components. That is, cards are contained within a slot, slots within a shelf, and shelves within a switch. For mapping this relationship, we use the parent-children modeling feature available in the ManagedObject class. This can be made available to our component classes just by implementing the ContainerInterface in the parent component's class and setting/storing the parent object name/key in the child component object using setParentKey() method of the ManagedObject class. This enables us to fetch all the children of a parent component by using the getChildrenKeys() method of the ManagedObject class, once the parent component and its children are added to the database. For providing the above MO Parent-Child containment relationship, we have implemented the ContainerInterface in the following classes:

• Switch • Shelf • Slot • Card

The source files have been manually edited to implement the interface.

Note: Another benefit of this ManagedObject property, namely ParentKey is, it allows for quick look up of the component object hierarchy as required when propagating alarms.

AdventNet Inc. 24

Page 26: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

4.1 Detailed Resource Modeling For each of the components of the network device, we have created a ManagedObject subclass. The following list captures the properties we have provided in each component we modeled, i.e., the ManagedObject subclasses.

Switch serialno, location Shelf serialno Slot slotno, state Card serialno, cardType Port portno, speed, snmpInterface,

switchnode AccessPort remoteID, remoteStatus, portType TrunkPort trunk, remotePortID, portType Trunk source, destination, srcPort,

destPort, bandwidth Switch

The Switch object will extend an SNMP Node object instead of ManagedObject directly. This is because our example assumes the switch supports SNMP and will be discovered as an SNMP Node. In your case, if the switch does not support SNMP you may extend node or ManagedObject directly as appropriate. We will provide the following additional properties in the switch, in addition to what is available in an SNMP Node class:

Location : The physical location of the switch. Serial number

: The serial number of the switch.

Shelf The Shelf object will extend ManagedObject. We will provide the following additional properties in the shelf, in addition to what is available in a ManagedObject class:

Serial number

: The serial number of the shelf.

Slot We will create a ManagedObject subclass to model the Slot. We will provide the following additional properties in the slot object, in addition to what is available in a ManagedObject class:

Slot number : The slot number is the identification of position on the shelf. State : An indication of the state of the slot, whether the slot is empty or it

contains card type.

Card The Card object is modeled using a ManagedObject subclass. We will provide the following additional properties in the card object, in addition to what is available in a ManagedObject class:

Serial number

: The serial number of the card.

Card Type : Whether an access or trunk card.

AdventNet Inc. 25

Page 27: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Port

The Port object is also directly sub classed from ManagedObject. To capture the containment of ports in switches, we will add a property to capture this relationship. We do not keep a reference to the switch, but rather store the key that identifies the switch that we can query from the database. We will provide the following additional properties in the port object, in addition to what is available in a ManagedObject class.

SNMP Interface

: The network interface object (IP Address) associated with this port, if any.

Port number : The port number is the identification of position on the card. Speed : The data transaction speed of the Port Switch Node : The Switch Node to which the Port belongs.

Note: The Switch Node property will help us in querying for all ports of a particular type belonging to a switch, as we do in the discovery filter for linking switches using trunks. We add this property to this port object so that we can make the query quickly and easily. But this is not a must. We can also get the TrunkPorts of a given switch by traversing/scanning recursively across the containment hierarchy using the getChildrenKeys() method of the ManagedObject. Or we can also use SQL queries, fired from the discovery filter, under database mode. Only the query will be somewhat complicated.

AccessPort The AccessPort object is sub classed from Port. We will provide the following additional properties in the AccessPort object, in addition to what is available in the port class:

Remote ID : An identifier for what is connected to this AccessPort. Could be an

equipment serial number or location of a customer site where the access device is.

Remote Status

: The status of the device connecting to this AccessPort.

PortType : Denotes the type of port used (Here, it is Access Port)

TrunkPort

The TrunkPort object is sub classed from port. We will provide the following additional properties in TrunkPort object, in addition to what is available in the port class:

Trunk : The trunk that terminates on this port. This is a reference to the trunk

object. Remote Port ID

: The ID of the remote port at the other end of an attached trunk.

portType : Denotes the type of port used (Here, it is Trunk Port)

AdventNet Inc. 26

Page 28: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Trunk

The Trunk object is sub classed from ManagedObject. We will provide the following additional properties in the trunk object, in addition to what is available in the ManagedObject class:

Source : The switch that one end of this trunk terminates. No fundamental

distinction is made between source and destination here. Destination : The switch that one end of this trunk terminates. Source Port : The port on which this trunk terminates. Destination Port

: The port on which this trunk terminates, i.e., the port on the destination switch.

Bandwidth : The bandwidth capacity of this trunk.

AdventNet Inc. 27

Page 29: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5. Implementation This tutorial application has been created using AdventNet Web NMS Studio. This comes bundled with AdventNet Web NMS. Using AdventNet Web NMS Studio

In the AdventNet Web NMS Studio, you have to create a separate project for this application. When the project is complete, compile it and package it into a NAR file. For deploying the application in the AdventNet Web NMS, you will have to deploy the NAR into the AdventNet Web NMS using the Deployment Wizard tool. Various features available in the Studio allow you in creating the Application. However, you need to write certain amount of custom code in order to suit the need of the tutorial application. You need to add certain files as other files in the Studio project, which are specific to the exclusive implementation of this tutorial application. Implementation overview

To start with, you will have to create a new Studio project. In the Project, build the application using the following Service Wizards:

Model the Managed Resource Model your Switch devices and their components into Managed Resources of AdventNet Web NMS Topology database. You will be filling up the Managed Resource's Name, Parent Resource, and its attributes in the Managed Resource wizard. In the end, you will get the Managed Resource's class, and its Relational class. Build Discovery-related Files Using Discovery Service Create a Discovery filter to discover the Switch objects you have modeled in the previous task. Create the filter using the Wizard. Select the Shallow Discovery. Declare the variables. Prepare the Criteria Table using Add/Modify Criteria Editor. View the summary. In the end, you will get the discovery filter. Add the Custom code specific to this application. Build Maps, Layouts, and Other Related Files Using Maps Service and Chassis Wizard Create a Map filter to display the discovered Switches. Add custom code to change the symbol of the Trunk link. Configure mapIcon.data file to specify map iconName, its corresponding device type and the menuName. Modify maps.conf file to add Custom Map. Create a Map Symbol Renderer class to paint the Map as per your requirement. Create a Chassis view and other related screens for the Switch using Chassis Wizard. Build Fault Management-related Files Using Fault Service Create a Trap filter to process the traps. Add Custom code to handle Addition of Card and Deletion of Card. Create a propagation filter to propagate the status of the Child nodes to the Parent node. Configure the propagation filter. Create an Event filter to group the alerts as one aggregated Alert. Model the managed object to check the device status (a method in the Managed Object class to check the status; here, it is the checkStatus() method) . Build Configuration-related Screens Using Configuration Wizard Create Configuration-related screens for configuring the Switch using the Configuration Wizard.

AdventNet Inc. 28

Page 30: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Configure Authorization to Various Users Using Security Administration Tool The Security Administration screen contains two nodes under Security - Groups and Users. Create groups and users for the respective nodes as shown below: Groups -> Users Admin Users -> guest root Configure authorization for the Users to carryout various operations using the Security Administrator Tool. Rebrand the Application Using the Rebranding and i18N Editor Tools Change the splash image, logo, and frame icons etc. in the Rebranding tool and Company Name, Product, and Version in the i18N Editor tool.

AdventNet Inc. 29

Page 31: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.1 Creating EMS Project The first step toward any implementation using the AdventNet Web NMS Studio is to create a Project. The project stores all the information that are essential for developing the application.

Starting Studio From the Web NMS Launcher, double-click the Web NMS IDE icon. Invoke AdventNet Web NMS Studio by double-clicking the Studio icon. Alternatively, you can invoke startWebNMSStudio.bat/sh located in <Web NMS Home>/StudioTools/Studio/bin directory. The Project Wizard opens. For details on Creating Project, refer to the Web NMS Studio help documentation.

Instructions Follow the steps given below to create the project.

Step 1: Invoke the Project Wizard Select File > New Project menu item to invoke the Project Wizard. Step 2: Add Project Details Provide the following details about the EMS Project. Project Name

- EMS_User

Package Name

- com.adventnet.nms.tutorials.ems

Application Name

- EMS_User

Version - 1.0 Click Next to proceed. Step 3: Select Device Details Select the Protocol as SNMP from the combo box. Provide the following Device details manually in the corresponding text fields (this is user-defined and will not be available in the list of devices provided by the Studio). Device Type - Switch

Device OID - .1.3.6.1.4.1.2162

Poll Interval (sec) - 300 Click Next to proceed. Please note that the OID given above is AdventNet SysOID

AdventNet Inc. 30

Page 32: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Step 4: Select Web NMS Services Details Select the Services to be customized in your application. All Services are selected by default of which, some are mandatory and cannot be unchecked. For the EMS application, select only the following Services: Mandatory Services

Application-Specific Services

• ManagedResource • Security • Rebranding

• Discovery • Map • Fault • Server_Configuration

Click Next to proceed. Step 5: Select Database Details Select the following Databases from the Databases listed.

• MySQL • Oracle

Note: For Oracle Database, you can configure the Database Details at the time of packaging the project using the Packager Wizard.

Click Next to proceed. Step 6: Select User Details Select Single User option for this application. This gives you Admin permission for all the selected Services (You can select Multiple Users to give Admin permission for different users for different services. That is, one user can be given Admin permission for DISCOVERY service, while another user can be given Admin permission for FAULT Service only). Step 7: Preview You can view the EMS Project details in the summary screen. Click Finish to create the Project Workspace.

Result The Workspace for the Project is now created. After the Project is created the Resource Factory Wizard opens. Using the Resource Factory, we will see how to model the Switch Device and its components in the next section. You can proceed with modeling the device. You can also invoke the wizard by clicking MANAGEDRESOURCE node in the Studio Tree.

AdventNet Inc. 31

Page 33: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.2 Modeling the Switch and Its Components To manage a physical device and its components, you need to model them as database objects. The status and behavior of the physical device and subcomponents are modeled as attributes of the objects. By controlling/monitoring the attributes of the objects, the physical device can be managed by the Element Management Application. By storing the details of the Modeled Resource in the database, the data is made persistent and this helps the Element Management. You are converting the real life device, its components, status, and behavior into a network management application manageable form. This is achieved by modeling them as Managed Resources. In this example application, we have taken a generic Switch. The Switch holds four Access card. Each Access card has four ports and these ports are used to connect the devices, which require the service of the switch. The Switch holds another four Trunk cards. Each Trunk card has one port and it is used for connecting this Switch to another Switch. The following table lists the Real life device/components, which are required to be modeled as Managed Resources, the core Web NMS Resources which are extended in order to represent these Resources, and the Properties which are mapped to the status/behaviour of the physical device/subcomponent.

Managed Resource

Core Web NMS Resource Properties to Be Managed

Switch com.adventnet.nms.topodb.SnmpNode serialno, location Shelf com.adventnet.nms.topodb.ManagedObject serialno Slot com.adventnet.nms.topodb.ManagedObject slotno, state Card com.adventnet.nms.topodb.ManagedObject serialno, cardType Port com.adventnet.nms.topodb.ManagedObject portno, speed,

snmpInterface, switchnode

Access Port com.adventnet.nms.tutorials.ems.Port remoteID, remoteStatus, portType

Trunk Port com.adventnet.nms.tutorials.ems.Port trunk, remotePortID, portType

Trunk com.adventnet.nms.topodb.ManagedObject source, destination, srcPort, destPort, bandwidth

Refer to the Detailed resource modeling topic in Appendix to this document, for more explanation about the Modeled Resources and their Properties. This chapter explains the procedure to model the Managed Resources of EMS, using AdventNet Web NMS Studio. The topics in this chapter cover the following procedures:

• Managed Resource Modeling for EMS. • Writing convenience methods by adding Custom code to Managed Resource's source.

AdventNet Inc. 32

Page 34: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.2.1 Managed Resource Modeling Aim The Switch Device and its components have to be represented as Managed Resources. During the discovery process, Web NMS discovers these managed resources and stores them in the database to manage them. For details of Creating Managed Resource using AdventNet Web NMS Studio, refer to the AdventNet Web NMS Studio documentation. Instructions The Switch system consists of seven major components. The components with a short description is given below.

Switch : This represents a manageable switch that is initially discovered via SNMP, i.e., Web NMS finds it as an SNMP Node in the network or is manually added by an operator.

Shelf : The switch consists of one or more shelves. For this example we will work with only one shelf, though the example can be extended to multiple shelves.

Slot : Each shelf consists of 16 slots, which are numbered 0-15. Card : Each slot consists of a card, which can be of different types. In this

example, we will work with only one card type. The card object has a field called Card type to specify the card type.

Port : Each card can have multiple ports. AccessPort : A port can be an access port or a trunk port. The AccessPort class is a

subclass of port and models a port on an access card. TrunkPort : This is a subclass of port and models a port on a trunk card. Trunk : This models a link between switches, i.e., a trunk connecting two

switches. Steps to Model Switch

Step 1: Invoke Resource Factory Wizard The Wizard opens by default as soon as you finish creating a project. You can also invoke the Wizard by clicking the MANAGEDRESOURCE node in the Studio-tree. Specify the managed resource details in Step1 of the Resource Factory Name of the Managed Resource : Switch

Name the Parent Resource : com.adventnet.nms.topodb.SnmpNode Click Next to proceed. Step 2 : MIB Details Skip this screen and click Next to proceed as this application does not require a MIB to be loaded.

AdventNet Inc. 33

Page 35: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Step 3: Managed Resource Attributes Preview Add the following attributes with name and type as specified below: Attribute Name Attribute Type Serialno String Location String

All the properties of the Managed Resource with the property type and description are listed in the Attribute table. Click Next to proceed. Step 4: View the Source View the source of the Managed Resource, Relational Managed Resource, schema to store the persistent data in the database and aliases for the tables. Step 5: Adding custom codes Click Finish. The new ManagedResource Switch node is appended to the left panel under MANAGEDRESOURCE. It implements ContainerInterface. Compile the Switch node created under MANAGEDRESOURCE

Follow the above steps to model the Shelf, Slot, Card, Port, AccessPort, TrunkPort, and Trunk as per the table given below. The attribute types are specified against the properties.

Managed Resource Parent Resource Interface Properties to Be

Managed Shelf com.adventnet.nms.topodb.

ManagedObject implements ContainerInterface

serialno (String)

Slot com.adventnet.nms.topodb. ManagedObject

implements ContainerInterface

slotno (int), state (String)

Card com.adventnet.nms.topodb. ManagedObject

implements ContainerInterface

serialno (String), cardType (String)

Port com.adventnet.nms.topodb. ManagedObject -

portno (int), speed (int), snmpInterface (String), switchnode (String)

AccessPort com.adventnet.nms.tutorials. ems.Port -

remoteID (String), remoteStatus (String), portType (String)

TrunkPort com.adventnet.nms.tutorials. ems.Port -

trunk (String), remotePortID (String), portType (String)

Trunk com.adventnet.nms.topodb. ManagedObject -

source (String), destination (String), srcPort (String), destPort (String), bandwidth (String)

AdventNet Inc. 34

Page 36: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Compile the Shelf, Slot, Card, Port, AccessPort, TrunkPort, and Trunk nodes created under MANAGEDRESOURCE . Add the required custom code to these objects before compiling. When you select the node, it opens in the JMACs editor in the right panel where you can edit. The details of the custom code meant for TrunkPort object added to the Managed Resource class are discussed in the next topic. Result All the Managed Resources are created now. We can proceed toward customization of Web NMS Services. The first task is to define a Discovery Filter to discover the Switch components.

AdventNet Inc. 35

Page 37: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.2.2 Customizing TrunkPort Object Custom Code Specific to the Tutorial Application Requirements - TrunkPort

In addition to the properties provided, you have to provide two convenience methods, getRemotePort() and getRemoteStatus(), which are useful for quickly getting a handle on the remote port at the other end of an attached trunk. Before you proceed to add the user code, specify the following imports for this class: import java.sql.*; import com.adventnet.nms.severity.SeverityInfo; import com.adventnet.nms.topodb.TopoAPI; import com.adventnet.nms.util.NmsUtil; For providing the above two convenience methods, you have to write the custom code in the TrunkPort source file directly. Add the User code as given below after the public int checkStatus() throws java.rmi.RemoteException method: public TrunkPort getRemotePort()

{ if (trunk == null) return null;

try {

Trunk trunkObj = (Trunk)((TopoAPI) NmsUtil.getAPI("TopoAPI")).getByName(trunk); if (trunkObj == null) return null; if (getName().equals(trunkObj.getSrcPort())) return (TrunkPort) ( (TopoAPI)(NmsUtil.getAPI("TopoAPI"))).getByName(trunkObj. getDestPort()); if (getName().equals(trunkObj.getDestPort())) return (TrunkPort) ((TopoAPI)(NmsUtil.getAPI("TopoAPI"))).getByName(trunkObj.getSrcPort()); }

catch (Exception ex) { System.err.println("Exception getting remote port: "+ex); ex.printStackTrace(); }

return null; }

public int getRemoteStatus() {

TrunkPort remotePort = getRemotePort(); if (remotePort == null)

return SeverityInfo.getInstance().getSpecialPurposeSeverity(); return remotePort.getStatus();

}

AdventNet Inc. 36

Page 38: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.2.3 Customizing Port Object for Status Polling Custom Code Specific to the Tutorial Application Requirements - Port

For providing the status polling function, you have to write the custom code in the Port source file directly. Imports to the class are: import java.sql.*; import com.adventnet.nms.severity.SeverityInfo; import com.adventnet.nms.severity.SeverityIterator; import com.adventnet.nms.topodb.TopoAPI; import com.adventnet.nms.util.NmsUtil; import com.adventnet.snmp.beans.SnmpTarget; Enter the following code after the Variable Declarations: public Port() { setType("Port"); setClassname("Port"); setPollInterval(300); } The method below in the managed object class is called whenever status polling of this object is scheduled. Using this method, you can directly control what happens when status polling is to be done for this object. Also each managed object can be configured to support failure counts, i.e., allowing multiple failures before a managed object failure is reported to the system. This is done by using the setFailureThreshold() method in the ManagedObject class. Here you have two methods for the status polling of Port object. The actual status polling is done by the second method checkObjStatus() below, which is invoked by the first checkStatus() which overrides the super class method. Add the User code as given below at the end before the last "}": /** This does the real check to the managed object **/ int checkObjStatus() { // As an example, we'll use the interface status, ifOperStatus, // of the node as the status of the port. We'll use the // port number to check status of the port. // Alarm propagation will be used to notify containers if ((switchnode == null) || (switchnode.equals("unknown"))) { TopoAPI tapi = (TopoAPI)NmsUtil.getAPI("TopoAPI"); String temp = getParentKey(); for (int i = 0; i < 3; i++) { try { if (temp != null) temp = tapi.getByName(temp).getParentKey(); } catch (Exception ex) { System.err.println("Exception fetching the parent "+ "switch of the port: " +getName()+ex); return SeverityInfo.getInstance().getSpecialPurposeSeverity(); } } switchnode = temp; }

AdventNet Inc. 37

Page 39: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

SnmpTarget target = new SnmpTarget(); target.setTargetHost(switchnode); int index = portno+1; target.setObjectID("ifOperStatus."+index); String status = target.snmpGet(); if (status == null) { SeverityIterator s_iter = SeverityInfo.getInstance().getIterator(); s_iter.moveToHighest(SeverityInfo.LEFT); // Default. So optional. return s_iter.getPreviousCriticality(); // MAJOR severity } if (status.equals("1") || status.startsWith("up")) { return SeverityInfo.getInstance().getClear(); // CLEAR severity } SeverityIterator s_iter = SeverityInfo.getInstance().getIterator(); s_iter.moveToHighest(SeverityInfo.LEFT); // Default. So optional. return s_iter.getPreviousCriticality(); // MAJOR severity } // end checkObjStatus() //End User Code The check is done to see that the interface is operational for the given index corresponding to the port number on the card. Based on the return value, a status update message is generated by the server. The fields of the generated event are based on the values in the managed object.

Note: When the devices are status polled at periodic interval, the output may be either • Status Up Events (in which case, the default severity will be Clear) • Status Down Events (in which case, the default severity will be Major)

AdventNet Inc. 38

Page 40: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.2.4 Customizing Other Objects Custom Code Specific to the Tutorial Application Requirements Provide the following user code after the Variable Declarations for the corresponding objects to setup a unique map icon for the objects. Switch public Switch() { setType("Switch"); setClassname("Switch"); } Shelf public Shelf() { setType("Shelf"); setClassname("Shelf"); } Slot public Slot() { setType("Slot"); setClassname("Slot"); } Card public Card() { setType("Card"); setClassname("Card"); } Trunk public Trunk() { setType("Trunk"); setClassname("Trunk"); }

AdventNet Inc. 39

Page 41: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3 Discovering Switch Devices After modeling the Managed Resource, you need to make the EMS to discover the Switch devices and add them to the Topology database. To achieve this, you need to customize the existing AdventNet Web NMS Discovery process. This is done by writing a Discovery filter. This filter will convert the first five SNMP Devices discovered into Switches. This filter retrieves the details of the (imaginary) Switches and stores in the Topology database. Discovery Filter Code Description in a Nutshell

The Discovery filter gets called when any new object is discovered by Web NMS and decides whether the discovered object can be passed through. As stated earlier, the filter identifies the first five SNMP devices as Switches and adds components such as shelves, slots, cards, etc. The filter passes through only the SNMP objects. It will drop all non-SNMP objects. If this filter returns, the corresponding object will be dropped and not added to the database. You require to restrict the number of switches to a maximum of five. For this purpose, the filter will check the database. To ensure this, the filter needs to detect warm start and add switches, only if the database has less than five switches. For this, write the custom code. Also, the filter needs to collect this information before it checks the managed object for interface so that it filters out the interface objects that do not correspond to the Switches that are added. Refer to the Discovery Filter Flowchart for a pictorial representation of Discovery filter class code implementation. This chapter will explain the procedure to customize the discovery for the modeled Managed Resources and to populate the database with the network elements' details, using the AdventNet Web NMS Studio. The following topics explain the procedure using AdventNet Web NMS Studio in detail:

• Creating the Discovery Filter to discover the Switch devices • Adding Custom code in the source of Discovery Filter, to the achieve the following tasks:

o Carryout Warm Start check o Add Device components into the database o Add Trunk objects into the database o Make database transaction rollback compliant

AdventNet Inc. 40

Page 42: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Discovery Filter Flowchart

AdventNet Inc. 41

Page 43: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3.1 Creating Discovery Filter Aim To create a discovery filter to discover the Switch Device and its components and to set the properties for the discovered Managed Resources. The components of the Switch device are discovered by querying the Agent. Instructions to Create a Discovery Filter Discovery filtering is done in two ways - Shallow and Deep. In Shallow discovery, only a particular device is discovered. In Deep discovery, the device and its components are discovered. For the EMS Project, we select Shallow Discovery Filter. For details of Creating Shallow Discovery Filter of AdventNet Web NMS Studio, refer to the AdventNet Web NMS Studio documentation. Follow the steps given below to discover the Switch Device and its components.

Step 1: Invoke the Shallow Discovery Filter Wizard Click on the node Services > Discovery > Discovery Filter and right-click. Select New. A dialog box pops up prompting you to choose between Shallow Discovery Filter and Deep Discovery Filter. Choose Shallow Discovery Filter. Step 2: Enter the Shallow Discovery Filter Details Provide the following details about the deep discovery filter. Class Name - SwitchDiscoveryFilter Package Name - com.adventnet.nms.tutorials.ems Click Next to proceed. Step 3: Declare the Variables Variables will be added as part of custom code. So, click Next in this screen. Step 4: Specify the Filter Criteria In the Filter Criteria screen, choose the criteria node. Right-click and select Add Node / Add Sub Node menu. Create Criteria1 as a Sub-Node of Code_Builder. Enter the other Nodes one by one as given in the Criteria Flow table given below.

Criteria Flow Criteria1 ├─ Null_Check │ ├─ Network_Check ├─ WarmStart_Check │ └─ Error ├─ If_Node_Check │ ├─ IF_Check │ │ ├─ Num_Nodes_Check │ │ └─ Else_Num_Nodes_Check│ └─ Else_IF_Check ├─ Final_Check │ └─ Switch_Count_Check │ └─ Else_Final_Check

AdventNet Inc. 42

Page 44: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Select the Nodes/Sub Nodes one by one and click Add button in the Criteria table. This will bring the Add/Modify Criteria Editor. Add the following criteria against the nodes, using the Add/Modify Criteria Editor. Select the Return Type from the Combo Box.

Criteria flow Criteria Return Type Criteria1 Null_Check

(managedObject == null || ! (((TopoObject)managedObject).getIsSNMP() ) )

null

Network_Check (managedObject instanceof Network) managedObject WarmStart_Check (switch_count == 0 ) && (

topoApi.getNumNodes() > 0)

Error (switch_name_vect == null ) || (switch_name_vect.size() == 0)

If_Node_Check ( ! (((TopoObject)managedObject). getIsNode() ) )

IF_Check (((TopoObject)managedObject). getIsInterface() )

managedObject

Num_Nodes_Check (switch_count >= 5) null Else_Num_Nodes_Check (switch_count < 5) managedObject Else_IF_Check ( ! (((TopoObject)managedObject).

getIsInterface() ) ) managedObject

Final_Check (warmstart ) Switch_Count_Check

( ( !(switch_name_vect.contains(managedObject. getName()) ) ) && ( switch_count >= 5 ) )

null

Else_Final_Check (switch_count >= 5)

Click Next. Step 5: Specify the Filter Properties Skip the Filter Properties screen. Step 6: View the Summary of Criteria and Modified Properties In the Criteria and Modified Properties screen, check if the Properties are set in the right order you want. If not, use the UP or DOWN buttons to set the order. Click Next. Step 7: View the Source In the Source screen, check the generated source code for the Criteria and the Properties defined. Step 8: Adding Custom Code Click Finish.

After this, the Java source file is generated by the Wizard. You can add the custom code or modify the existing code of the source using the JMACS editor directly as per your requirement. The details of the custom code added to the Discovery filter class is discussed in four parts.

AdventNet Inc. 43

Page 45: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3.2 Customizing Discovery Filter Code Custom code specific to the tutorial application requirements - Part I

The following part illustrates how to layer discovery over the Web NMS IP discovery. Add the following import statements in SwitchDiscoveryFilter class. import java.util.*; import java.sql.Time; import java.sql.Date; import java.sql.Timestamp; import com.adventnet.nms.severity.SeverityInfo; import com.adventnet.nms.topodb.IpAddress; import com.adventnet.nms.topodb.Network; import com.adventnet.nms.topodb.SnmpInterface; import com.adventnet.nms.topodb.TopoObject; import com.adventnet.nms.util.NmsUtil; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; import com.adventnet.management.transaction.*; Add the following variables after the //<End_Variable_Declarations> tag. /** Counter for the number of switches added. **/ int switch_count = 0; /** Used in warm start for fetching the switches already added. **/ Vector switch_name_vect = null; /** Warm start indicator. **/ boolean warmstart = false; /** Transaction API. **/ static TransactionAPI transAPI=null; /** This method gets called whenever an object is discovered. **/ public ManagedObject filterObject(ManagedObject managedObject,TopoAPI topoApi) throws com.adventnet.management.transaction.UserTransactionException, com.adventnet.nms.store.NmsStorageException Add the following line in code after //<UserCode_Begin_Network_Check_IF_END> try{ In the WarmStart_Check of the filter, add the following custom code after the //<UserCode_Begin_WarmStart_Check_IF_START> tag. warmstart = true; // All nodes are SnmpNodes as we filtered out non-snmp // objects. And this example takes SnmpNodes as switches. switch_count = topoApi.getNumNodes(); switch_name_vect = topoApi.getNodes(); System.out.println("Discovery - Warm Start :: "+ "Number of switches already in database: "+switch_count+" :");

AdventNet Inc. 44

Page 46: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Add the following code below //<UserCode_Begin_WarmStart_Check_IF_END> tag. catch(java.rmi.RemoteException rex) { System.err.println("Exception while getting the number of nodes in the TOPODB "); rex.printStackTrace(); } catch (Exception ex) { System.err.println("Error in Warm Start check. Exception: "+ex);ex.printStackTrace(); } Add the following code after //<UserCode_Begin_Else_Final_IF_END> tag. catch (Exception ex) { System.err.println("Error in Warm Start check. Exception: "+ex); ex.printStackTrace(); } To keep a count of the number of switches added to the database, declare it as an instance variable so that all Web NMS discovery threads can have this common. Limit the number of switches added to the database to a maximum of five, arbitrarily chosen, for this application. This is done as there could be a number of SNMP Nodes in the network and you should not get too many maps generated, one for each switch, especially because this is an example application. Add the following custom codes given in the tables below after the //<UserCode_Begin_METHOD_FINISH> tag. switch_count++; System.out.println("Discovery - Switch ::" + managedObject.getName()); We will replace the SNMP Node object passed to us with the Switch object, which is a subclass of SNMP Node. // Generate switch object. Switch theSwitch = new Switch(); theSwitch.setName(managedObject.getName()); The Status of any Parent has to reflect the maximum severity including the status of its children. Hence, the "Tester" property of the switch is set to "max". //code inside box theSwitch.setTester("max"); Copy over the SNMP Node properties to the switch. But before applying all properties, you would eliminate the ones that are unique to the Switch and could be overwritten, e.g., classname. The properties classname and type are set to Switch in the Switch Class. So, remove the properties that are not to be updated. Then, set these properties to the new Switch object created.

AdventNet Inc. 45

Page 47: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

// Get the properties of object. Properties p = obj.getProperties(); // Set the properties of switch. First remove some of the props // e.g. the classname does not apply p.remove("classname"); p.remove("type"); theSwitch.setProperties(p); Next, set some of the switch's specific properties. In reality, you will have to actually discover details for these properties from the switch. However, you will use some arbitrary values and set the serial number property in this example. theSwitch.setSerialno("1234"+theSwitch.getName()); Once the properties are set, add the switch to the database. This you need to do before adding the other components in order to implement parent-children containment relationship across managed objects. try { transAPI = NmsUtil.relapi.getTransactionAPI(); } catch(Exception e) { System.err.println("Exception in getting the handle of TransactionAPI"+e); } beginTrans(); try { topoApi.addObject(theSwitch); commitTrans(); } catch(java.rmi.RemoteException re) { System.err.println("Exception while adding Switch : " +theSwitch.getName()); re.printStackTrace(); // if an exception occurs rollback the transaction. rollbackTrans(re); return null; } catch (Exception ex) { System.err.println("Exception adding switch : " +theSwitch.getName() + ex); // if an exception occurs rollback the transaction. rollbackTrans(ex); return null; } // Discover switch components' details and populate the database getSwitchComponentsInfo(theSwitch, topoApi); // Add trunks for illustration purposes. We'll add a trunk to each // switch already discovered. Here in this EMS switch model, each // switch has a shelf with 4 TrunkPorts. Therefore we limit the // switches to be connected to a maximum of 4 Trunks.

AdventNet Inc. 46

Page 48: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

addTrunks(theSwitch, topoApi); // Return null as the switch and all its components have already // been added to the TopoDB. // return null; //End of manual code managedObject=null; catch(com.adventnet.management.transaction.UserTransactionException ute) { System.err.println("Exception while adding Switch : " +theSwitch.getName()); ute.printStackTrace(); // if an exception occurs rollback the transaction. rollbackTrans(ute); return null; } catch(com.adventnet.nms.store.NmsStorageException nse) { System.err.println("Exception while adding Switch : " +theSwitch.getName()); nse.printStackTrace(); // if an exception occurs rollback the transaction. rollbackTrans(nse); return null; } catch(java.rmi.RemoteException re) { System.err.println("Exception while adding Switch : " +theSwitch.getName()); re.printStackTrace(); // if an exception occurs rollback the transaction. rollbackTrans(re); return null; } catch (Exception ex) { System.err.println("Exception adding switch : " + theSwitch.getName() + ex); rollbackTrans(ex); return null; } Next, you will discover and add all the switch's components such as slots, ports, etc. Details on this are provided below. // Discover switch components' details and populate the database getSwitchComponentsInfo(theSwitch, api); You will add trunks between switches, as described later in this section, for illustration purposes. addTrunks(theSwitch, api); Finally, the class should return null as the switch and all its components have already been added to the topology database. Please note that the switch object was added instead of the SNMP Node object. managedObject=null; The next section covers how to add the details on each discovered device component.

AdventNet Inc. 47

Page 49: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3.3 Adding Device Components in Database In this topic, the second part of the discovery filter class, adding Device components is dealt elaborately. Custom Code Specific to the Tutorial Application Requirements - Part II

Since this application does not use any real switches, you will not actually fetch the device details by communicating with the switch. Simply add a number of components to the switch to illustrate how to add managed objects to the system once they are discovered. Add the following code after the //<End_filterObject_ManagedObject_TopoAPI> tag. void getSwitchComponentsInfo(Switch theSwitch, TopoAPI api) {

// In this example we will not actually go to the switch. // We'll just add shelves, etc. arbitrarily. // Add one or more shelves. Here we'll add one. addShelf(theSwitch, api);

} Add a shelf as shown below and set some properties for the shelf. While adding switch components, follow the naming convention mentioned earlier. Also, set the parentKey of the component to its container, which is already added to the topology database. Here, the Switch object is parent to the Shelf object. You need to explicitly add the shelf to the database using the TopoAPI as shown below. Once the shelf is added to the database, add 16 slots. This part of the code should follow the above code. void addShelf(Switch s, TopoAPI api) {

Shelf shelf = new Shelf(); shelf.setName(s.getName()+"_Shelf1"); shelf.setParentKey(s.getName()); shelf.setSerialno("S1234"+s.getName()); shelf.setTester("max"); beginTrans();

try {

api.addObject(shelf); commitTrans();

} catch (Exception ex) {

System.err.println("Exception adding shelf: "+shelf.getName()+ex); rollbackTrans(ex); return;

} // we'll assume 16 slots in this shelf for (int i=0;i<16;i++) addSlot(i,shelf,s,api);

} Next, add slots as given below. Again, you need to explicitly add the slot to the database. For Slot, Shelf is the parent Object and set the state of the slot based on the card type you are adding into the slot. Odd-numbered slots are kept empty and even-numbered slots are plugged with Trunk and Access Cards.

AdventNet Inc. 48

Page 50: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Add after the code given in the above table. void addSlot(int slotno, Shelf s, Switch theSwitch, TopoAPI api) {

Slot slot = new Slot(); slot.setName(s.getName()+"_Slot"+slotno); slot.setParentKey(s.getName()); slot.setSlotno(slotno); slot.setTester("max");

// We'll leave odd numbered slots empty and have even numbered // slots plugged in with Trunk Cards and Access Cards alternatively if ((slotno%2) != 0) slot.setState("empty"); else if ((slotno%4) != 0) slot.setState("Access"); else slot.setState("Trunk"); beginTrans(); try { api.addObject(slot); commitTrans(); } catch (Exception ex) { System.err.println("Exception adding slot: "+slot.getName()+ex); rollbackTrans(ex); return; }

// We'll check the slot number and add a card. // For this case we'll add a card in even numbered slots.

if ((slotno%2) == 0) addCard(slot, theSwitch, api); } The card objects are added in a similar fashion. For cards, alternate between trunk cards and access cards. So you will end up with four trunk cards and four access cards. This should follow the above code. static void addCard(Slot s, Switch theSwitch, TopoAPI api) {

Card card = new Card(); card.setName(s.getName()+"_Card"); card.setParentKey(s.getName()); card.setSerialno("C1234"); card.setTester("max");

if (s.getSlotno()%4 == 0) { // make every 4th slot a trunk card card.setCardType("Trunk"); } else { card.setCardType("Access"); } beginTrans(); try { api.addObject(card); commitTrans(); } catch (Exception ex) { System.err.println("Exception :adding card: "+card.getName()+ex); rollbackTrans(ex);

AdventNet Inc. 49

Page 51: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

return; } if (s.getSlotno()%4 == 0) { addPort(0,card, theSwitch, api); // only one port for Trunk cards

} else { // Add four ports for Access cards as an example for (int i=0;i<4;i++) addPort(i,card,theSwitch,api);

} } Finally, add the port objects. Instantiate different subclasses of Port depending on the card that this port is attached to. To illustrate getting data from the device to drive the setup of the configuration, use the SNMPNode interfaces to determine the configuration of the ports. Check the operational status of the interfaces and based on the status for each port index, set whether the port is managed or not. This is done for each card. Add this code after you add Port. static void addPort(int portno, Card s, Switch theSwitch, TopoAPI api) {

Port port = null; if (s.getCardType().equals("Trunk")) port = new TrunkPort(); else port = new AccessPort(); port.setName(s.getName()+"_Port"+portno); port.setPortno(portno); port.setParentKey(s.getName()); port.setSwitchnode(theSwitch.getName()); // for access ports, tie it to the interface ifIndex if (port instanceof AccessPort) {

port.setManaged(false); Vector interfaces = theSwitch.getIpaddrs(); for (Enumeration en=interfaces.elements();en.hasMoreElements();) {

try { IpAddress intf=api.getInterface((String)en.nextElement()); if (intf instanceof SnmpInterface) {

if (((SnmpInterface)intf).getIfIndex() == portno+1) { port.setSnmpInterface(intf.getName()); port.setManaged(true);

break; }

} }

catch (Exception ex) { System.err.println("Error getting interface : "+ex);

} }

if (!port.getManaged()) { // No IP address for this ifIndex // but we could still have this ifIndex operations if (port.checkObjStatus() == SeverityInfo.getInstance().getClear()) port.setManaged(true); // ifIndex operational }

} beginTrans(); try { api.addObject(port); commitTrans();

AdventNet Inc. 50

Page 52: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

} catch (Exception ex)

{ System.err.println("Exception adding port: "+port.getName()+ex); rollbackTrans(ex);

} } Thus, for an SNMP Node with three active interfaces and index numbers 1-3, each access card will have the first three AccessPorts as managed as well as active and the last AccessPort as unmanaged. The trunk card will have one managed and active TrunkPort. If the interface with an index of 1 is not active or goes down, none of the TrunkPorts will be active ports, but they are managed. The above discovery filter will add five switches and their related components into the topology database.

AdventNet Inc. 51

Page 53: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3.4 Adding Trunk Objects in Database In the previous topic, we discussed how the discovery filter is used for discovering the switches and their components. In this topic, the third part of the discovery filter class, how Trunks (or Links) are added between the switches is dealt elaborately. Custom Code Specific to the Tutorial Application Requirements - Part III

Trunks are physical connections between switches. Unlike a real-world EMS, which will use network information to add trunks, you will add trunks between switches based on some simple rules. Add one trunk to every TrunkPort and connect one link to every other switch with a free TrunkPort. In this EMS switch model, each switch has a shelf component with four TrunkPorts. Therefore, you can have a maximum of four trunks per switch. Use the getTrunkPort method, described below, for checking the availability of a free TrunkPort and fetching the same, from the topology database for the given switch. As part of adding the trunks, update the termination ports with information on the trunk terminating on the particular TrunkPorts. Add the following code after the addPort() method. private static Vector srcDestVect = new Vector(); synchronized void addTrunks(Switch s, TopoAPI api) { String source = s.getName(); int numTrunks = 0; try { Vector nodes = api.getNodes(); for (Enumeration en=nodes.elements();en.hasMoreElements();) { String destination = (String)en.nextElement(); if (destination.equals(source)) continue; if(srcDestVect.contains(source+"-"+destination) || srcDestVect.contains(destination+"-"+source)) { continue; } srcDestVect.add(source+"-"+destination); // We need to check if the remote switch // has room for more trunk connections. TrunkPort destport = getTrunkPort(destination, api); if (destport == null) { continue; } // Let's not add more than 4 trunks per switch. // We've only added 4 trunk ports above if (++numTrunks > 4) return; // Create the trunk object. Trunk trunk = new Trunk(); trunk.setName("Trunk_" + source +"-"+ destination); trunk.setSource(source); trunk.setDestination(destination); trunk.setBandwidth("20MB"); // Get the next available source port TrunkPort srcport = getTrunkPort(source, api); if (srcport == null) { System.err.println("No trunk port found for source: "+ source); continue; } srcport.setTrunk(trunk.getName()); destport.setTrunk(trunk.getName()); trunk.setSrcPort(srcport.getName());

AdventNet Inc. 52

Page 54: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

trunk.setDestPort(destport.getName()); srcport.setRemotePortID(destport.getName()); destport.setRemotePortID(srcport.getName()); beginTrans(); api.addObject(trunk); api.updateObject(srcport,false,false); api.updateObject(destport,false,false); commitTrans(); } } catch (Exception ex) { System.err.println("Error in adding trunk: "+ex); ex.printStackTrace(); rollbackTrans(ex); } } Use this method to fetch the next available free trunk port in a given switch. If the switch does not have a free TrunkPort, the method returns null. Use the switchnode property of Port object to query the database for ports belonging to a particular switch. You further narrow down our search by using the property trunk with value unknown, applicable only for free TrunkPorts. Once the Trunk object is added to the topology database, the source ports and destination ports are also updated with the trunk name for associativity. Add the following code after the addTrunks() method. private TrunkPort getTrunkPort(String switchname, TopoAPI api)throws java.rmi.RemoteException { if (switchname == null) { System.err.println("Fetching available trunk port: "+"switch name passed is null"); return null; } Properties poppy = new Properties(); poppy.put("switchnode", switchname); poppy.put("trunk", "unknown"); Vector tportvect = api.getObjectNamesWithProps(poppy); if ((tportvect == null) || (tportvect.size() == 0)) { System.err.println("Error. No trunk ports found for switch : "+switchname); return null; } TrunkPort tport = null; String temp = null; for (int i=0;i<tportvect.size();i++) { temp = tportvect.elementAt(i).toString(); tport = (TrunkPort) api.getByName(temp); if (tport == null) { System.err.println("Error. TrunkPort: "+ temp +" :not found in the TopoDB"); continue; } return tport; } return null; // no free trunk ports } The trunks will be represented as map links, which will be described in the Maps section.

AdventNet Inc. 53

Page 55: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.3.5 Making Database Transaction Rollback Compliant In this topic, the last part of the discovery filter class (i.e., use of transaction) is dealt elaborately. To use transactions, the following points are to be considered.

• Whether the code written for databases that support transactions has to support databases that do not support transactions as well, without flooding the log files with exceptions.

• Whether the begin(), commit(), and rollback() methods will be called frequently. Description of Custom Code Specific to the Tutorial Application Requirements

Note: The custom codes given in the following tables should not be added to the SwitchDiscoveryFilter as the codes are already added and are embedded in various methods of this filter class.

Allow the transaction to begin and throw NotSupportedException. Catch the exception and do nothing. The commit and rollback methods have no effect in case database does not support transactions. To use transactions, first get the TransactionAPI reference using RelationalAPI. Note that this is already included in the code and hence you need not add it again. try { transAPI = NmsUtil.relapi.getTransactionAPI(); } catch(Exception e) { System.err.println("Exception in getting the handle of TransactionAPI"+e); } Next, define method to begin transactions as this code snippet may be used very frequently. private static void beginTrans() { try { transAPI.begin(); } catch (javax.transaction.NotSupportedException nse) { // print "Transaction not supported" messages here if required. // We do not wish this code to throw exceptions while working with databases which do not support transactions, // as the same code works in transaction mode as well as non transaction mode. } catch (Exception e) { System.err.println("Exception in beginning the transaction : " + e); } }

AdventNet Inc. 54

Page 56: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Similarly, define method to commit the transaction. private static void commitTrans() { try { transAPI.commit(); } catch (Exception e) { System.err.println("Exception in committing the transaction : " + e); } } Finally, define a method to rollback the transaction. private static void rollbackTrans(Exception ex) { try { transAPI.rollback(ex.getMessage()); } catch (Exception e) { System.err.println("Exception in rolling back : " + e); } } Call the beginTrans() method before a group of addObject(obj) / updateObject(obj) statements. Call the commitTrans() method after the above group of addObject(obj) / updateObject(obj) statements. In case the above transaction throws exception, catch the exception and call the rollbackTrans(ex) method from inside. The following code snippet shows how to add the trunk object using transactions. Similarly all other objects are added/updated using transactions. beginTrans(); try { topoApi.addObject(theSwitch); // commit the above addObject transaction. commitTrans(); } catch (Exception ex) { System.err.println("Exception adding switch : " +theSwitch.getName() + ex); // if an exception occurs rollback the transaction. rollbackTrans(ex); return null; }

AdventNet Inc. 55

Page 57: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.4 Creating Maps The Switch devices discovered need to be represented by images/icons. These representations need to be laid out and displayed in a map. The map also displays the links, representing the physical connections between the Switches as well as other devices. Apart from this, individual Switch device is represented as an actual model of the physical equipment. This is called Chassis view. In this view, the Switch device with Shelves, Slots, Cards, and Ports are displayed in a NMS Frame. This chapter explains the procedure to achieve the following tasks using AdventNet Web NMS Studio:

• Adding Custom map and configuring the custom map in maps.conf file • Create new Map for the Switch devices using filter • Adding custom code to change the symbol of the Link and configuring the filter in

mapIcon.data file • Creating Chassis view using Chassis wizard

AdventNet Inc. 56

Page 58: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.4.1 Adding Custom Map - Switch Map If we want to display a map of all the switches and the trunks connecting the switches, creating a custom map showing all the switches and trunks in one map is straightforward solution. This topic deals with adding custom Maps in this application. Using Studio to Add Custom Maps

Adding the Switch Map for this application was achieved with the help of the AdventNet Web NMS Studio. We have used the maps.conf file of the Map service wizard of the AdventNet Web NMS Studio. In the project, steps to edit the maps.conf file were followed and the nodes and their details were added. The Map service wizard of the Studio provides the facility to create and edit the nodes of the conf file and its details (which are in XML format). The XML file can be edited using the User Interface invoked by the right-click menu. You can add or edit the node or modify the existing node directly as per your requirement using the UI. For details of working with XML files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. Modifying maps.conf File for Adding Switch Map For displaying a map of all the switches and the trunks connecting the switches, simply add the following node to the maps.conf file. <MAP_CONFIG>

<map label="Switches" index="0" treeIconFileName="images/maps.png" helpDoc="help/userguide/use_map_client.html" autoPlacement="true" anchored="false" imageName="ems_tut_white.png" mapSymbolRenderer="com.adventnet.nms.mapui.MapSymbolRendererImpl_3 topology="$ring" currentTopology="ring" mapname="Switches.netmap"> <criteria type="Switch,Trunk" />

</map> </MAP_CONFIG> The last line specifies the ManagedObject types that should be added to the map. Any property of the ManagedObjects can be chosen to specify which objects should be in the map. The first set of properties is for the new map you wish to create. With this configuration, all switches and trunks will be added to the new map.

AdventNet Inc. 57

Page 59: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.4.2 Creating Map Filter Aim To create link symbols automatically for each trunk in the Switches map Creating a Map Filter Follow the steps given below to define a Map filter. For details on Creating Map Filter of AdventNet Web NMS Studio, refer to the AdventNet Web NMS Studio documentation.

Step 1 : Invoking the Map Filter Wizard Click the node Services > Map > Map Filter. Right-click and select New. Step 2 : Map Filter Details Provide the following details about the Map Filter: Class Name - TrunkMapFilter Package Name - com.adventnet.nms.tutorials.ems

Click Next to proceed. Step 2 Variables are not defined. Click Next to proceed. Step 3 : Defining Criteria Provide the following inputs to define criteria-based map representation. Click the Add button to declare Connectors/ Left Operand/ Operator/ Value. Criteria flow Criteria Criteria1 ( ! (managedObject instanceof Trunk ) ) Click the Next button to proceed. Step 4: Specify the Filter Properties Skip the Filter Properties screen. Step 5: View the summary of Criteria and Modified properties In the Criteria and Modified Properties screen, check if the Properties are set in the right order you want. If not, use the UP or DOWN buttons to set the order. Click Next. Step 6: View the Source In the Source screen, check the generated source code for the Criteria and the Properties defined. Step 7: Adding custom codes Click Finish.

AdventNet Inc. 58

Page 60: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

After this, the Java source file is generated by the Wizard. You can add the custom code or modify the existing code of the source using the JMACS editor directly as per your requirement. The details of the custom code added to the Map filter class are discussed in the next topic.

AdventNet Inc. 59

Page 61: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.4.3 Customizing Map Filter Code This topic deals with the custom code added to the Map filter class (TrunkMapFilter). This custom code is meant for changing the symbol automatically generated for each trunk into a link on the map. Custom Code Specific to the Tutorial Application Requirements

The following custom code has been added to map filter to change the symbol automatically generated for each trunk to a link on the map. Imports to the class are given in the following table. import java.sql.Date; import java.sql.Timestamp; import java.util.*; import com.adventnet.nms.topodb.ManagedObject; import com.adventnet.nms.mapdb.*; import com.adventnet.nms.util.NmsUtil; import java.sql.Time; Add the custom code after the //<UserCode_Begin_METHOD_FINISH> tag. Vector temp=new Vector(); for (int i=0;i<mapSymbols.size();i++) {

MapSymbol mobj = (MapSymbol) mapSymbols.elementAt(i); MapLink trunk = new MapLink(); Properties p = mobj.getProperties(); p.put("source",((Trunk)managedObject).getSource()); p.put("dest",((Trunk)managedObject).getDestination()); trunk.setProperties(p); trunk.setLabel(((Trunk)managedObject).getBandwidth()); temp.addElement(trunk);

} mapSymbols=temp; Configuring Map Filters

Studio will automatically put entry in map.filters located in <Web NMS Home>conf directory when a NAR is installed. The entry will be as shown below. <FILTER_LIST> <FILTER className="com.adventnet.nms.tutorials.ems.TrunkMapFilter"/> </FILTER_LIST>

AdventNet Inc. 60

Page 62: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.4.4 Creating Chassis View In this section, we will discuss how the discovered Switch along with its sub-components such as Shelf, Slot, etc. is represented. The Switch with its sub-components will be represented as a Chassis. The Chassis can be built as a UI in two ways:

1. Using Map APIs of AdventNet Web NMS 2. Using Chassis Wizard of AdventNet Client Builder

For details of How to build the Chassis? using Chassis Wizard of AdventNet Client Builder, refer to Building the Chassis section of this tutorial documentation. A detailed discussion on the details of "How to build the Chassis?" using MapAPI is available in CORBA Southbound tutorial. In this tutorial, the Switch is being represented as a Chassis with the help of Chassis Wizard of AdventNet Client Builder. Creating Chassis View Using the AdventNet Client Builder

• The Chassis is built as a separate project using the Chassis Wizard of the AdventNet Client Builder.

• The project is compiled and packaged as a NAR. • This NAR is then imported into the Studio project of EMS application. • Now, the Chassis view of the Switch will become part of the EMS application.

Importing the Chassis NAR in the EMS Application

• Open Web NMS Studio • From File Menu, select Open > Project • Select the project (here, it is Ems_Tutorial.proj) • From the Menu bar, Select Tools > Import Nar to invoke the Import Nar Wizard • Select the ChassisScreen.nar from <Web NMS Home>/StudioTools/ClientBuilder directory

using the Browse button • Click Next to see the User Information Screen • Select the User for whom the Nar has to be installed, say root • Click Next to see the 'Map Menu Information' screen • Enable Configure MapMenu • Enter Menu Name as SwitchMenu and Menu Item Name as ChassisView • Select the relevant image for the map using Browse button and click Next • Similarly, enter the List Menu Informations and click Next • In the Install Information screen, click Finish

The NAR is imported in the EMS Application. The Final Output The Chassis is represented as a dynamic view, i.e., the view will be automatically updated based on the status of the components. The Chassis is built based on the corresponding Switch ManagedObject added to the Web NMS database.

AdventNet Inc. 61

Page 63: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

This application can be invoked from the device node in the Switch → Chassis View.

AdventNet Inc. 62

Page 64: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5 Fault Management of Switch Devices To receive, process the failures in the managed network elements (i.e., Switches) and present it in a meaningful form, you have to implement Fault management service of AdventNet Web NMS. The Switch notifies any abnormality in the operations, parameters and failures to the EMS application in the form of traps Processing Alerts and Events of Switch device

You have to process the events of the Switch received through the traps to convert it into a meaningful alert. For processing the traps you have to write a trap filter. In the application you will be creating a filter called TrapHandling. Next, you will have to ensure that the event/alert pertaining to a Child managed object is propagated to its parent object. For example, the serviceability state of the Port needs to be propagated to Card. For this you have to write an event filter. In the application you will be creating a filter called AcmePropagationFilter. Next, you will have to group the alerts by correlating them. An alert event of the Managed Object at bottom of the child-parent hierarchy will generate a number of alerts to pass it up in the hierarchy. Hence, you will have to correlate all the alerts and make them as one. For this, you will have to write an Event filter. In the application you will be creating a filter called AlertGrouper. Status polling of Switch device

You have to ensure that EMS gets the status of the Switch and its components periodically. This will be updated in the database and displayed in the Client. The tutorial explains how to customize the Fault management features. • The Trap handling topic explains how to process traps effectively. • The Alarm propagation topic elaborates how to notify failure events to affected components. • The Correlating alarms topics explains how to minimize the clutter due to multiple related failures

and alarms. • The Status polling topic deals in a detailed manner on how to carryout surveillance of Switch and

components periodically.

AdventNet Inc. 63

Page 65: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5.1 Creating Trap Filter Aim To provide a complete Switch management capability to the EMS with effective Trap handling and periodic status polling. Tasks

• Convert the failure notifications (Traps) into meaningful Event Objects using the Trap Filter Wizard

• Status Poll the Switch Device and its components using the Status Poller Wizard. Instructions Follow the steps given below to define a Trap Filter and after completion proceed to the Status Poller Wizard. For details on Creating Trap Filter, refer to the Web NMS Studio Help documentation.

Step 1: Invoking the Trap Filter Wizard Click on the node Services > Fault > Trap Filter. Right click and select New Step 2 : Trap Filter Details Provide the following details about the Trap Filter Class Name - TrapHandling Package Name - com.adventnet.nms.tutorials.ems Event Class - com.adventnet.nms.eventdb.Event

Note: The Event Class is available in the list-box. Click Next to proceed Step 3: Variable Declaration Add the following variables using the Add button. Variable Type Variable Name Variable Value TopoAPI api (TopoAPI)NmsUtil.getAPI("TopoAPI") SnmpVarBind varbind (SnmpVarBind)varbinds.elementAt(0) Vector varbinds pdu.getVariableBindings() String stringVarbind varbind.getObjectID().toString() String slotName varbind.getVariable().toString()

Click Next button Step 4: Defining Criteria Select and right-click the node Criteria1 in the left tree and add the nodes DeleteCard_Criterion and AddCard_Criterion. Select each of these node and add the corresponding node criteria from the corresponding list-box as mentioned below.

AdventNet Inc. 64

Page 66: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

DeleteCard_Criterion Generic Type == Enterprise Specific(6) Specific Type == 100 AddCard_Criterion Generic Type == Enterprise Specific(6) Specific Type == 200 After you add the criteria, click Preview Criteria button to see the added criteria as given in the right column of the following table. DeleteCard_Criterion ( pdu.getTrapType() == 6 ) && (

pdu.getSpecificType() == 100) AddCard_Criterion ( pdu.getTrapType() == 6 ) && (

pdu.getSpecificType() == 200) Click Next to proceed Step 5: Adding / Modifying Property Informations In the Property Information Screen, the Property Form will display the criteria properties. To add more properties, click Add Properties and to see the modified properties, click Modified Properties. Modified Properties Screen You can see the following modified properties for the AddCard_Criterion

• text • entity • source

Click Next to see the source. Step 6: Viewing Source Code

• View the source code with the return value as event • Click the Finish button to complete defining the Trap Filter.

After this, the Java source file is generated by the Wizard. You can add the custom code or modify the existing code of the source using the JMACS editor directly as per your requirement. The details of the custom code added to the Trap filter class in discussed in the next topic.

AdventNet Inc. 65

Page 67: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5.2 Customizing Trap handling filter's code In this application, we have tried to simulate a real time situation in which cards are removed or added physically from a Switch. Whenever a card is removed or added, the agent in the device sends a trap to the manager and notifies the problem. To simulate this condition, we will send separate SNMP V1 traps for adding and removing the cards. To process the trap, we need to associate a trap filter. This topic deals with creating a trap filter called TrapHandling. Custom code specific to the tutorial application requirements

TrapHandling is the trap filter, which does the addition and removal of cards based on the trap received. Imports in this class are given in the table below: import com.adventnet.snmp.snmp2.SnmpPDU; import com.adventnet.snmp.snmp2.SnmpAPI; import com.adventnet.studio.services.filters.trap.PDUTokenUtility; import com.adventnet.nms.eventdb.Event; import java.util.*; import java.sql.Time; import java.sql.Date; import java.sql.Timestamp; import com.adventnet.nms.util.NmsUtil; import com.adventnet.nms.topodb.*; import java.rmi.RemoteException; import com.adventnet.snmp.snmp2.*; For Deletion of Card the following custom code is added to the trap filter class after the //<UserCode_Begin_DeleteCard_Criterion_IF_START> tag: try { Card card=(Card)api.getByName(pdu.getAgentAddress().getHostName()+"_Shelf1_" +slotName+"_Card"); Properties p=new Properties(); p.put("parentKey",card.getName()); Vector v=api.getObjectNamesWithProps(p); boolean b=api.deleteObject(card,false,false); if(b) { for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { boolean bool=api.deleteObject(api.getByName((String)e.nextElement()),false,false); } } } catch(Exception e) { System.err.println(" Error while deleting card"); return pdu; //log the trap message }

AdventNet Inc. 66

Page 68: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Since the card and its children need to be deleted, we need to get the corresponding Card object. Using the Topo API handle, the api.getByName() method returns the Managed Object corresponding to the card. The TopoAPI method deleteObjectAndSubElements() deletes the ManagedObject specified (Card) and its children (Ports). Once the object is deleted from the database, the map module is notified and it in turn deletes these Objects from the Map database. If a new card is inserted then in the received trap we will get the slot number where the card needs to be added and accordingly add the card and ports. The code snippet for Addition of Card is as given below. Add the code after the //<UserCode_Begin_AddCard_Criterion_IF_START> tag. try {

String ifObjectName= pdu.getAgentAddress().getHostName(); Switch sw=(Switch)api.getByName(ifObjectName); Slot slot=(Slot)api.getByName(ifObjectName+"_Shelf1_"+slotName); SwitchDiscoveryFilter.addCard(slot,sw,api);

} catch(RemoteException e) {

System.err.println("Unable to get the managed object"); return pdu; //log the trap message

} The name of the agent (Device) from which the trap was received can be obtained from the pdu.getAgentAddress().getHostName() method. Using the Topo API handle we will get the Managed Object of the device as done before. As we need to add the cards and its children in the specified slot we need to get the Slot Object of the corresponding slot. This can be obtained by the following method. Slot slot=(Slot)api.getByName(ifObjectName+"_Shelf1_"+slotName); After getting the slot object we will invoke the addCard() method of the SwitchDiscoveryFilter which will add the card and its corresponding ports. Once the managed objects are added the map module is notified which in turn adds the objects to its database and updates the UI.

AdventNet Inc. 67

Page 69: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5.3 Alarm propagation We used status polling to check the status of ports on the switch and could do the same for all components on the switch, provided the component reports status that can be retrieved by the management system via SNMP or some other communication to the switch. Another way that status may be updated is via SNMP traps or other autonomous message from the device. You would use trap parsers to ensure the correct component is updated for a given trap. However, in some cases the containers like Cards and Slots do not actually report status. Instead we need to derive the status of these container objects based on the contained objects for which we can check the status. To support this requirement, i.e. maintaining and reporting status of container objects, we use the alarm propagation capabilities of Web NMS. This topic deals with creating and configuring the Alarm propagation filter. Using Studio to configure Alarm propagation filter

Adding the Alarm propagation filter used in this application was achieved with the help of the AdventNet Web NMS Studio. Use the propagation.filters file of the Fault service wizard of the AdventNet Web NMS Studio. In the project, steps to edit the propagation.filters file were followed and the nodes and its details were added. The Fault service wizard of the Studio provides the facility to create and edit the nodes of the filters file and its details with the right click menu and UI. You can add or edit the node or modify the existing node directly as per your requirement using the UI, which is invoked by the right click menu. For details of working with XML files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. Add the following node to the propagation.filters file. <PROPAGATION_FILTERS> <FILTER className="com.adventnet.nms.tutorials.ems.AcmePropagationFilter" /> </PROPAGATION_FILTERS> In order to setup alarm propagation, the alarm propagation filter class called the AcmePropagationFilter class, is mentioned in the above node as Filter class. Using Studio to configure Alarm propagation filter in the NmsProcessessBE.conf file

Configuring the Alarm propagation was achieved with the help of the AdventNet Web NMS Studio. Use the NmsProcessessBE.conf file of the Common Server Configuration service of the AdventNet Web NMS Studio. In the project, steps to edit the NmsProcessessBE.conf file were followed and the configuration was done. The Common Server Configuration service of the Studio provides the facility to create, edit, and configure the values of the conf file directly in the file. You can add, edit or configure the values directly in the source file as per your requirement displayed in the right side window. For details of working with conf files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation.

AdventNet Inc. 68

Page 70: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

In the NmsProcessessBE.conf file, in the java com.adventnet.nms.topodb.DBServer process, set the value of the parameter ENABLE_SP_FOR_MO_RELATIONS to max. When the containment relationship exists between objects, the parameter ENABLE_SP_FOR_MO_RELATIONS for the process java com.adventnet.nms.topodb.DBServer found in the NmsProcessessBE.conf file is used for configuring Alarm Propagation. In this case, the value for the parameter is set to max which means that

• the maximum severity of the children objects/sub elements is propagated to the Parent Object • the status of the Parent Object totally depends on the status of the Children Objects • there will not be any check for the status of the Parent or Container Object

Note: One benefit of using alarm propagation versus status polling is that lower-level alarms immediately propagate to the container object, and the polling delay is eliminated.

With these configurations, Alarms for ports will be propagated to Trunks using the filter and further advanced configuration of Alarm propagation is achieved. Creating Alarm Propagation filter class

In order to setup alarm propagation, we have written an alarm propagation filter class called the AcmePropagationFilter class. Create this filter class using other files option of the Studio project. For details of Working with other files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. The following is the alarm propagation filter we will use for propagating alarms from Ports to Trunks. Use the same package name and import some necessary packages. package com.adventnet.nms.tutorials.ems; import com.adventnet.nms.alertdb.Alert; import com.adventnet.nms.alertdb.MiniAlert; import com.adventnet.nms.alertdb.PropagationFilter; import com.adventnet.nms.eventdb.InputEvent; import com.adventnet.nms.severity.SeverityInfo; import com.adventnet.nms.severity.SeverityIterator; import com.adventnet.nms.topodb.ManagedObject; import com.adventnet.nms.topodb.TopoAPI; import com.adventnet.nms.util.NmsUtil; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; Propagation filters need to implement the PropagationFilter interface in the com.adventnet.nms.alertdb package. These filters implement the applyPropagation() method, whose argument is a reduced version of the Alert. The reason for a reduced version is to reduce the amount of data being passed around. However, for our purposes we need the complete alert, which we obtain from the AlertAPI. /** * This class implements a Propagation Filter for propagating * port alarms to the card, card alarms to the slot, and * slot alarms to the shelf, and shelf alarms to the switch. * We also propagate trunk port alarms to any attached trunks. **/ public class AcmePropagationFilter implements PropagationFilter { /** This is the filter method called to propogate each alert **/

AdventNet Inc. 69

Page 71: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

public void applyPropagation(MiniAlertminiAlert) { if (miniAlert == null) return; We will not propagate any thing other than valid severities with criticality. intsev = miniAlert.getSeverity(); if ( !SeverityInfo.getInstance().contains(sev) || SeverityInfo.getInstance().isNoCriticality(sev) || SeverityInfo.getInstance().isUnknown(sev) || SeverityInfo.getInstance().isInfo(sev) || (SeverityInfo.getInstance().getSpecialPurposeSeverity() == sev) ) return; String source = miniAlert.getSource(); if (source == null) return; TopoAPItopo_api = (TopoAPI)NmsUtil.getAPI("TopoAPI"); try { ManagedObjectobj = topo_api.getByName(source); if (obj == null) return; // We'll first see if it's a port, card, slot, or shelf if ( !(objinstanceof Port) && !(objinstanceof Card) && !(objinstanceof Slot) && !(objinstanceof Shelf) ) return; // We need to fetch the complete alert, // e.g. to get the group name Alert alert = ((AlertAPI)(NmsUtil.getAPI("AlertAPI"))).getAlert(miniAlert.getEntity()); We then propagate to our links, i.e. trunks between switches. Applies only to trunk ports. // Alert trunk terminating on this port, if any if (objinstanceofTrunkPort) propagateToTrunk(alert, obj, topo_api); } catch (Exception ex) { System.err.println("Error propagating alert: "+ex); ex.printStackTrace(); } } If the alert is generated for a trunk port, call this method to propagate to the attached trunk on this port. First check if there is a trunk attached to this port. If there is not attached trunk do nothing. Once you find an attached trunk, check if the alert is a clear. If it is a clear alert, you need to know if there is a failure at the remote end of the trunk. It would not be appropriate to clear the status of the trunk if there are outstanding failures on either end. So check the remote end port status. If the alert is a failure, you simply need to generate a failure event on the trunk. For no particular reason use a severity of MINOR for the propagated trunk alarms. In both cases use the Event API to add a new event into the system. Also set the group name field in the event, for reasons explained in the next section on event correlation. /** * Propagate the alert to the trunk, with a minor alarm * **/ void propagateToTrunk(Alert alert, ManagedObjectobj,TopoAPItopo_api) throws RemoteException void propagateToTrunk(Alert alert, ManagedObjectobj,TopoAPItopo_api) throws Exception { // To prevent updating trunk status for the wrong kind of // alert, we need to check the category of the alert if (!alert.getCategory().equals("Topology")) return; String trunkName = ((TrunkPort)obj).getTrunk(); if (trunkName == null) return; Trunk trunk = (Trunk) topo_api.getByName(trunkName);

AdventNet Inc. 70

Page 72: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

// This port doesn't have a trunk. Possible. if (trunk == null) return; // Get the far end port TrunkPortfarEnd = null; String farEndName = trunk.getSrcPort(); if ( (farEndName == null) || obj.getName().equals(farEndName) ) farEndName = trunk.getDestPort(); if ( (farEndName != null) && !obj.getName().equals(farEndName) ) farEnd = (TrunkPort) topo_api.getByName(farEndName); if (farEnd == null) { System.err.println("Error while alert propagation for: "+ obj.getName()+" :Far end port is not found: "+farEndName); return; } if (alert.getSeverity() == SeverityInfo.getInstance().getClear()) { if (trunk.getStatus() ==SeverityInfo.getInstance().getClear()) return; // if the trunk is already clear intsev = farEnd.getStatus(); if ( !SeverityInfo.getInstance().contains(sev) || SeverityInfo.getInstance().isNoCriticality(sev) || SeverityInfo.getInstance().isClear(sev) || SeverityInfo.getInstance().isUnknown(sev) || SeverityInfo.getInstance().isInfo(sev) || (SeverityInfo.getInstance().getSpecialPurposeSeverity() == sev) ) { // Send a trunk clear event InputEvent event = new InputEvent ("Trunk", // use class as category "Both trunk terminations clear. Clear from " + obj.getName(), trunk.getStatusColor(alert.getSeverity()), trunkName, trunkName, trunkName); event.setGroupName(obj.getName()); ((EventAPI)( NmsUtil.getAPI("EventAPI"))).addEvent(event); } else { return; // far end still failed so don't clear trunk } } else { // we have a definite failure SeverityIterators_iter = SeverityInfo.getInstance().getIterator(); // Default. So optional. s_iter.moveToHighest(SeverityInfo.LEFT); // MINOR severity. intsev = s_iter.getPreviousCriticality(2); // Send a trunk fail event InputEvent event = new InputEvent ("Trunk", // use class as category "Trunk termination port failure. Alarm from " + obj.getName(), trunk.getStatusColor(sev), // MINOR severity trunkName, trunkName, trunkName); event.setGroupName(obj.getName()); ((EventAPI)( NmsUtil.getAPI("EventAPI"))).addEvent(event); } } }

With this propagation filter, and the entry in the configuration file, the server will generate trunk events – which get processed into alerts. The alert then results in the status of the trunk managed objects to get updated, and thus changes the status on the map.

AdventNet Inc. 71

Page 73: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5.4 Correlating Events and Failures AdventNet Web NMS supports two forms of event correlation, time-correlation and grouping of failed elements.

• The first results in multiple events over time on any given component being correlated to a single alert in Web NMS.

• The second relates multiple alerts into an alert group, based on the alert group field in the alert.

For grouping of failed components, use the Alert group field to relate alerts on multiple components where the failures have a common cause. The user sees only one alert from each group and can see the failures or alerts in that group when he opens up the alert details. Using Studio to configure Alert grouping event filter

Adding the Alert grouping event filter used in this application was achieved with the help of the AdventNet Web NMS Studio. You have used the event.filters file of the Fault service wizard of the AdventNet Web NMS Studio. In the project, steps to edit the event.filters file were followed and the nodes and its details were added. The Fault service wizard of the Studio provides the facility to create and edit the nodes of the filters file and its details with the right click menu and UI. You can add or edit the node or modify the existing node directly as per your requirement using the UI, which is invoked by the right click menu. For details of working with XML files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. Add the following node to the event.filters file. <EVENT_FILTERS>

<FILTER name="SetPortGroup"> <FILTER_ACTION className="com.adventnet.nms.eventdb.UserFilter" userclass="com.adventnet.nms.tutorials.ems.AlertGrouper" name="setgroup" />

</FILTER> </EVENT_FILTERS> With this configuration, Alerts arms for ports will be propagated to Trunks using the filter and further advanced configuration of Alarm propagation is achieved. In order to setup alert grouping, write an event filter class called the AlertGrouper class. Create this filter class using other files option of the Studio project. For details of Working with other files of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. Creating Alert grouping event filter class

In the last section we looked at alarm propagation, which generates multiple alerts from a single alert to notify containers and related components of failures and update their status. Here we undo the resulting duplication of alerts by correlating them to the common root cause.

AdventNet Inc. 72

Page 74: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

For each propagated event, which results in an alert on the related component, set the group field to the port that generated the initial failure. You also need to set the group name in the event generated for the port itself, to the port name, since by default the group name field is left blank. You do that using the following event filter, called AlertGrouper. package com.adventnet.nms.tutorials.ems; import com.adventnet.nms.eventdb.Event; import com.adventnet.nms.eventdb.FilterClient; import com.adventnet.nms.alertdb.Alert; import com.adventnet.nms.util.NmsUtil; import com.adventnet.nms.topodb.ManagedObject; import com.adventnet.nms.topodb.TopoAPI; /** * This class implements an event filter to help in grouping Switch * alerts. Since the status update leaves the group name for port * failure events unset, we need to do that here. We set the group * field to the port itself. The propagated alarms will take this * value from the sourcing alert. * * The group field should set according to the rules that are * appropriate for correlating alerts on different components, * i.e. ports, slots, trunks, etc. */ public class AlertGrouper implements FilterClient { /** Called when the filter action class is first instantiated **/ public void init() { } /** This is the filter method called to filter each event. We will do nothing for events. **/ public Event filter(Event e) { // And only Topology status update events need this change if (!e.getCategory().equals("Topology")) return e; // We only need to look at port objects if (e.getSource() == null) return e; try { TopoAPI api = (TopoAPI)NmsUtil.getAPI("TopoAPI"); ManagedObject obj = api.getByName(e.getSource()); if ( (obj == null) || (!(obj instanceof Port)) ) return e; } catch (Exception ex) { System.err.println("Error while grouping event. "+ "Status polling for port: "+e.getSource()); } e.setGroupName(e.getSource()); return e; } /** Filter method called to filter each NetAlerts alert **/ public Alert filter(Alert a) { return a; } } In the above event filter, all you need to do is set the group name for the event when the source is a port object. This will be passed to the alert, so that the group name is set for the port. Once the group name is set for the alert on the port, it will be set for the propagated alerts on each of the containers and the trunk. In the alert user interface, you will see only one alert in the group displayed in the default (group) view. Each of the alerts with the same group tag will be placed as failures within the group when you look at the alert details.

AdventNet Inc. 73

Page 75: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.5.5 Status Polling You need to ensure the status of the Managed Objects are monitored and displayed in the Client UI. For each type of device, Web NMS performs status polling of these devices based on the configuration. For each managed object, it invokes the status polling specified by the configuration, which may be a standard operation like pinging the device already supported by Web NMS or a custom polling that is needed for a specific device or component. You can override the status polling code for your managed object. You will see how the Port object is used, for which you will poll the operational status of an interface corresponding to the port number on a card. The custom code for achieving the above task is added to the Port object as explained in the Implementation > Modeling the Switch and its components > Customizing Port object topic of this tutorial document.

AdventNet Inc. 74

Page 76: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.6 Configuring the Switch In this section, how to configure the Switch is discussed. In order to optimize the functioning of the Switch, you have to configure certain parameters of the Switch online. This is achieved with the help of Configuration Wizard screens. You have to build these screens separately using Configuration Wizard of ClientBuilder. You must import the compiled screens as a NAR file into the Studio project. At runtime, the screens to configure the Switches will be invoked through a menu item. Overview of Switch configuration process

An overview of the Configuration process is presented in the diagram below:

When the Configure Switches option in the object menu (appears when switches are selected in the Switches map) is selected the screen for the parameters that need to be configured appears. The information regarding the parameters that can be configured has already been discussed above. After all the changes to the parameters are made, you can get back to the original settings of the device by selecting the refresh option. This option will also be useful to know whether a device has been configured successfully. On clicking the refresh option all the modifications that has been done previously for the device are deleted and a fresh query is made to the device to get the values. In this application you will explore some of the features of the Configuration Management. The functionality described here is only a small subset of what can be done with AdventNet Web NMS Configuration Management.

AdventNet Inc. 75

Page 77: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.6.1 Switch Configuration In this application, you will be building the Switch configuration screens with the help of Configuration Wizard of AdventNet ClientBuilder. The parameters that are chosen in this application are more generic and will be present in any Network Management device (e.g., switch, router) regardless of the type or make of the device. The various parameters that can be configured can be broadly classified into three categories.

• Basic Information about the Switch. • Basic Spanning Tree Configuration Details. • Spanning Tree Parameters of the Ports.

• Basic Information about the switch

This view brings the various parameters like the Name of the switch, Location of the switch and the Name of the User/Contact person who is responsible for managing the switch.

• Basic Spanning Tree Configuration Details This view shows some of the spanning tree parameters that can be configured for a given switch. They are: • Bridge Priority : This value is used to elect the root switch. • Bridge Max Age : The value that all bridges use for MaxAge when this bridge is

acting as the root. • Hello Time : This value determines how often the switch broadcasts its hello

message to other switches. • Forward Delay : This value determines the amount of time a port will remain in

the listening and learning states before entering the forwarding state.

• Spanning-Tree Parameters for the Ports

This view shows the following parameters: • Port Number : The Port Number of the switch • State : Displays the spanning-tree state of the port. This can take any

one of these values Blocking, Listening, Learning, Forwarding or Disabled.

• Forward Transitions

: Number of times Spanning-Tree Protocol changed forwarding states.

• Path Cost : The path cost of the port. • Priority : Priority of each port relative to the other.

• Port Enabled : The enabled or disabled state of the port.

Note: If Spanning Tree Protocol is not enabled in the switch you cannot view the Spanning Tree Protocol values.

Creating Configuration management application using the AdventNet Management Builder

For the details of How to build the Configuration management screens using Configuration Wizard of AdventNet Management Builder, refer Building Configuration Screens section in the Appendix of this tutorial documentation.

AdventNet Inc. 76

Page 78: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

• The Configuration screens of the Switch has been built using the Configuration Wizard of the AdventNet Management Builder.

• The Configuration management application will be built as a separate project. • The project will be compiled and packaged as a NAR. • This NAR has to be imported into the Studio project of EMS application. • The NAR has to be imported using the Import Nar wizard invoked through the Import Nar

menu of the Studio. Importing the Configuration Screen NAR in the EMS Application

• Open Web NMS Studio • From File Menu, select Open > Project • Select the project (here, it is Ems_Tutorial.proj) • From the Menu bar, Select Tools > Import Nar to invoke the Import Nar Wizard • Select the SwitchConfiguration.nar from <Web NMS

Home>/StudioTools/ClientBuilder/projects/EMS_Configuration directory using the Browse button

• Click Next to see the User Information Screen • Select the User for whom the Nar has to be installed, say root • Click Next to see the 'Map Menu Information' screen • Enable Configure MapMenu • Enter Menu Name as SwitchMenu and Menu Item Name as Configuration • Select the relevant image for the map using Browse button and click Next • Similarly, enter the List Menu Informations and click Next • In the Install Information screen, click Finish

• Now the Configuration screens of the Switch will become part of the EMS application.

Caution: It is not advisable to change the ./values of Spanning Tree Configurations in a real switch which is a part of an active network, as it may inadvertently affect the operation of the switch. The AdventNet Agent Simulator can be used to simulate the switch by recording the values from a real switch.

AdventNet Inc. 77

Page 79: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.7 Making the Switch configuration secured In this tutorial application, the security feature is implemented by using the Authorization service provided by Web NMS. This service supports authorization of application specific tasks, or operations. The architecture also supports user and group based authorization as well as view-based authorization. By using this authorization service, you can limit the users access to a specific area or subset of objects or instances. You have to make the task of configuring the Switch secured. Allowing all the For instance, you can limit the access for a particular user to a certain kind of device. It also provides group based authorization, where users can be assigned to groups, which have configured levels of authorization, in addition to authorizing specific users. Based on the group the user belongs to, the components in the Configuration Screen is enabled or disabled. To use the security feature with this tutorial application, views and operations needs to be added to the database tables. Using Studio to Configure Security features Security configuration used in this application was achieved with the help of the AdventNet Web NMS Studio. You will be using the Security Administration tool bundled in the AdventNet Web NMS Studio. You can add or edit the operations node or modify the existing node as per your requirement using the Security Administration screen, which is invoked from the menu bar. Also you can assign permission to operations for various users. For details of working with Security Administration tool of AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. Using the Security Administration screen, operations nodes can be added to the Operations tree. For adding operations nodes to the Operations tree In the pop-up Operation Tree configuration screen

• Under the Operation Tree Root node the Ems Operations node was added and under the Ems Operations node the three nodes Ems Configure All, Ems Configure Scalar, and Ems Configure None were added.

Using the Security Administration screen, operations can be assigned to users. For assigning an Operation to a user at design time. In the Assign Permissions screen, you will see Permissions tree hierarchy.

• In the Ems Operations tree under the Operation Tree Root node, un-select the Ems Configure All operation and select the Ems Configure None.

The operations assigned to various users are as follows:

User Operation root Ems Configure All guest Ems Configure Scalar

-- Ems Configure None

AdventNet Inc. 78

Page 80: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

So far it has been explained how to carry out the security configuration through a tool in the AdventNet Web NMS Studio. The Studio takes care of writing the security configuration carried out, in the respective files of the Web NMS work space. Basically, the two default users (root and guest) are used to demonstrate this feature. The first user root belonging to the Admin group to which the Ems Configure All operation is assigned, allows the user to configure all the parameters of the switch. The Configure button remains enabled for this user. The second user guest belonging to the Users group to which the Ems Configure Scalar operation is assigned, allows the user only to configure the scalar parameters of the switch. The Configure button remains enabled, but the second and the third tab is removed from the UI. The screen shot below show the configuration UI when the Ems Configure Scalar operation is assigned to a user. i.e., The user is authorized to configure only the scalar parameters of the switch.

Login to the Application Client with root or guest to see the difference in the Switch Configuration Screen.

AdventNet Inc. 79

Page 81: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.7.1 Using Authorization Service to implement Security Aim Every EMS application should have Authorization Services enabled to distinguish among users. This section will guide you to create Groups and Users, to enable authorization and to authenticate permissions levels for the Users. Instructions Follow the steps given below to assign Groups and Permissions for effective security Administration

Step 1: Invoking the Security Administrator Tool Select the node EMS Tutorial in the tree. From the menubar, choose the menu Tools > Security Administrator Step 2: Adding Groups and Permissions

• Expand the Groups node in the tree • Select Users and click the Add Operation Icon from the toolbar • In the Operations screen, select the node Operation-Tree • Enter the name of the operation in the text field provided at the bottom • Click Add. Scroll down the Operations tree to see the operation added. Select the

new operation and click OK • Now, in the Security Administration screen, click Set Permissions to see 'Assign

Permissions' screen pop-up • Scroll down this screen and check the corresponding box against the new operation

added. • Click Done.

Group Name and permissions granted are given below.

Group Name

Permitted EMS Operations

Users Ems Configure All Admin Ems Configure Scalar

Step 3: Adding Users to the Group Right- click the Users node and click Add Users. Provide the following information.

Groups Users Users root, guest Admin root

Result The EMS users are grouped and different authorization levels are created. The Authorization for operations is achieved for all the groups. The task that follows next is Re-branding.

AdventNet Inc. 80

Page 82: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.7.2 Customizing Configuration screen code to implement Security You need to add custom code in the Configuration management screen to cater for Security administration In the Configuration wizard, you will be creating the screens for configuring the Switches. In the SwitchConfiguration.java file of the EMS configuration project, accommodate the custom code in order to cater for Security administration. Details of the custom code When the switch configuration screen is invoked from the client, the checkUserOperations() method makes a RMI lookup to the AuthorizationEngineAPI for retrieving the operations for the logged-in user. Whenever a component in the UI is added, disabled or enabled, a check is made if the user logged in has the required permission to perform the operation. Based on the user operation, the component is enabled or disabled. You have to do this task while crating the Configuration Management screen as explained in the Appendix > Building Configuration Screen > Designing Main Screen topic of this document.

AdventNet Inc. 81

Page 83: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8 Client-side Implementation In the Client-side Implementation, we will be building two applications.

1. DSLAM Chassis 2. Configuration Screen

DSLAM Chassis In this section, you will learn to build chassis application to represent DSLAM device along with its sub-components such as Shelf, Slot, etc. This representation is known as Chassis View. Building chassis application using Chassis Wizard is explained in the Building Chassis section. The Output The Chassis View is dynamic, i.e., the application updates based on the status of the components in Web NMS Database. Once eBON EMS is deployed in Web NMS, this application can be invoked from the device node by right-clicking the node and selecting View Chassis. Configuration Screen In this section, you will be building the configuration screens with the help of Configuration Wizard to configure DSLAM device parameters. Building Configuration Management Application using Configuration Wizard of AdventNet Management Builder is explained in the Building Configuration Application section. The Output The Configuration Management application configures, saves the Configuration data to Cache and loads the Configuration data from Cache for Scalar properties updates based on the status of the components in Web NMS Database. Once eBON EMS is deployed in Web NMS, this application can be invoked from the device node by right-clicking the node and select Configure Device.

AdventNet Inc. 82

Page 84: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1 Building Chassis This chapter explains the step by step procedure for building the chassis using AdventNet Management Builder's chassis wizard. Refer the Working with Client Builder topic (under Studio Help) to learn working with various options.

• Building Chassis Management Applications • Working with Chassis Wizard

o Working with Chassis Project • Getting Chassis Data from Web NMS Database

o Building Chassis with Slot & Shelf Modeled Parameters

Managed Object Description The application is built for a device, which has been populated as a Managed Object in Web NMS Database with the following Properties.

Managed Object Name : Switch1 No of Shelves : 1 where the shelf name is Switch_Shelf1 No of Slots in the Shelf

: 16 where the names of the Slots are Switch1_Slot<n> where n takes the value 0 to 15

No of Card Types in the Shelf1

: 2 where card types are Trunk and Access

Before creating the chassis application, you must know how the MOs are populated in the Web NMS Database. Hence make a SQL query from the Web NMS Database using the mysql commands given below mysql>select name,parentkey, type from ManagedObject where name like "%Switch1%"; where the Switch1 is the MO name of the chassis device you have populated. You shall get the query result similar to the table given below

Name parentkey name Switch1 Switch1_Shelf1 Switch1_Shelf1_Slot0 Switch1_Shelf1_Slot0_Card Switch1_Shelf1_Slot0_Card_Port0 Switch1_Shelf1_Slot1 Switch1_Shelf1_Slot10 Switch1_Shelf1_Slot10_Card Switch1_Shelf1_Slot10_Card_Port0 Switch1_Shelf1_Slot10_Card_Port1 Switch1_Shelf1_Slot10_Card_Port2 Switch1_Shelf1_Slot10_Card_Port3 Switch1_Shelf1_Slot11 Switch1_Shelf1_Slot12 Switch1_Shelf1_Slot12_Card Switch1_Shelf1_Slot12_Card_Port0 Switch1_Shelf1_Slot13 Switch1_Shelf1_Slot14 Switch1_Shelf1_Slot14_Card Switch1_Shelf1_Slot14_Card_Port0

NULL Switch1 Switch1_Shelf1 Switch1_Shelf1_Slot0 Switch1_Shelf1_Slot0_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot10 Switch1_Shelf1_Slot10_Card Switch1_Shelf1_Slot10_Card Switch1_Shelf1_Slot10_Card Switch1_Shelf1_Slot10_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot12 Switch1_Shelf1_Slot12_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot14 Switch1_Shelf1_Slot14_Card

Switch Shelf Slot Card Port Slot Slot Card Port Port Port Port Slot Slot Card Port Slot Slot Card Port

AdventNet Inc. 83

Page 85: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Name parentkey name Switch1_Shelf1_Slot14_Card_Port1 Switch1_Shelf1_Slot14_Card_Port2 Switch1_Shelf1_Slot14_Card_Port3 Switch1_Shelf1_Slot15 Switch1_Shelf1_Slot2 Switch1_Shelf1_Slot2_Card Switch1_Shelf1_Slot2_Card_Port0 Switch1_Shelf1_Slot2_Card_Port1 Switch1_Shelf1_Slot2_Card_Port2 Switch1_Shelf1_Slot2_Card_Port3 Switch1_Shelf1_Slot3 Switch1_Shelf1_Slot4 Switch1_Shelf1_Slot4_Card Switch1_Shelf1_Slot4_Card_Port0 Switch1_Shelf1_Slot5 Switch1_Shelf1_Slot6 Switch1_Shelf1_Slot6_Card Switch1_Shelf1_Slot6_Card_Port0 Switch1_Shelf1_Slot6_Card_Port1 Switch1_Shelf1_Slot6_Card_Port2 Switch1_Shelf1_Slot6_Card_Port3 Switch1_Shelf1_Slot7 Switch1_Shelf1_Slot8 Switch1_Shelf1_Slot8_Card Switch1_Shelf1_Slot8_Card_Port0 Switch1_Shelf1_Slot9

Switch1_Shelf1_Slot14_Card Switch1_Shelf1_Slot14_Card Switch1_Shelf1_Slot14_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot2 Switch1_Shelf1_Slot2_Card Switch1_Shelf1_Slot2_Card Switch1_Shelf1_Slot2_Card Switch1_Shelf1_Slot2_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot4 Switch1_Shelf1_Slot4_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot6 Switch1_Shelf1_Slot6_Card Switch1_Shelf1_Slot6_Card Switch1_Shelf1_Slot6_Card Switch1_Shelf1_Slot6_Card Switch1_Shelf1 Switch1_Shelf1 Switch1_Shelf1_Slot8 Switch1_Shelf1_Slot8_Card Switch1_Shelf1

Port Port Port Slot Slot Card Port Port Port Port Slot Slot Card Port Slot Slot Card Port Port Port Port Slot Slot Card Port Slot

On querying the Card MO table using the SQL query given below mysql>select name,cardType from Card where name like "Switch1%"; You shall get the query result similar to the table given below

name cardtype Switch1_Shelf1_Slot0_Card Switch1_Shelf1_Slot10_Card Switch1_Shelf1_Slot12_Card Switch1_Shelf1_Slot14_Card Switch1_Shelf1_Slot2_Card Switch1_Shelf1_Slot4_Card Switch1_Shelf1_Slot6_Card Switch1_Shelf1_Slot8_Card

Trunk Access Trunk Access Access Trunk Access Trunk

Using the cardType property, you can provide the type property in Chassis Wizard. Device Description To built the dynamic chassis application for the above device Switch1, you have to build the chassis project with the following parameters

Number of Shelves

: One

Number of Slots : 16 Number of Card Types

: Three

AdventNet Inc. 84

Page 86: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Since the position of Cards in the Slots is subject to change, the Project is built with Dynamic Chassis.

Note: The Managed Objects in Web NMS Database are populated by discovery of the devices based on the criterion in Discovery Filter. The Chassis Application created for these Managed Objects is Dynamic Chassis because the card screen panels are fitted in slot holder panels based on the Managed Objects in the Web NMS Database.

Device Information The following classes and XML are required to build the chassis project

• Card.class under com.adventnet.nms.tutorials.ems • AccessPort.class under com.adventnet.nms.tutorials.ems • TrunkPort.class under com.adventnet.nms.tutorials.ems • ManagedObject.xml

Getting Started With Development The images from the <Web NMS Home>/StudioTools/ClientBuilder/projects/EMS_Chassis/images directory must be copied to <Web NMS Home>/StudioTools/ClientBuilder/images directory. The images from the <Web NMS Home>/StudioTools/ClientBuilder/projects/EMS_Chassis/mibs have to be copied to <Web NMS Home>/StudioTools/ClientBuilder/mibs directory. Follow the steps given below to create a chassis project in AdventNet Management Builder - Chassis Wizard Opening the Chassis Wizard To invoke Chassis Wizard from Web NMS Launcher, double-click Web NMS IDE icon in the Web NMS Launcher. From here, double-click the Chassis Wizard icon. Alternatively, you can use startChassisWizard.bat/.sh present in <Web NMS Home>/StudioTools/ClientBuilder/bin. Creating the Chassis Project

1. Select File → New → Project to invoke the New Project Details dialog to create a new chassis project.

2. Provide the Project Name field with the value EMS_Chassis if it does not exists. 3. Provide the Package Name field with the value com.adventnet.nms.tutorials.ems. 4. Ensure the Dynamic radio button is selected for the Chassis Type, since you are

constructing chassis project for Managed Objects in Web NMS Database. 5. Select the MO radio button for the Chassis Construct From field. 6. Click OK button to create the project in the projects folder under the <Client Builder Home>

directory. You can find a project named EMS_Chassis in the chassis project tree. Configuring the Web NMS Host in Servers UI

1. Invoke the Server Tool with the Tools → Servers or using the Web NMS Launch Pad. 2. Select the Management Server from the list and click Properties button on the right hand side

to invoke the Servers Properties List Dialog. 3. Select the first option WebNMS_Server_HOST and assign it with the host name in which the

Web NMS is running. By default it is None and so the entry is WebNMS_Server_HOST = None. For Example, WebNMS_Server_HOST = test2 means the Web NMS is running in host machine test2.

4. Click OK button to close the Servers Properties list dialog. 5. Restart the Management Server using the Stop and Start buttons.

Get back to Chassis Wizard and follow the steps given below.

AdventNet Inc. 85

Page 87: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Steps Involved in Building the Chassis Project The following steps are involved in building the chassis project, packaging the chassis project as NAR and installing the NAR in Web NMS Client.

1. Designing Main Screen 2. Designing Shelf Screen

a. Designing Access Card Screen b. Designing Trunk Screen c. Building Port Property Screen 3. Chassis Configuration 4. Packaging and Installing the Application

AdventNet Inc. 86

Page 88: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.1 Designing Main Screen The main screen of the chassis application holds the shelf panels, the shelf panels contains the slot holder panels and each slot holder panel holds a card screen panel. The designing of main screen is done in the chassis main screen of the chassis project tree, which is invoked on the right side on clicking the "Main Screen" node in chassis project tree. In this screen you should provide the information whether the Shelf and Slot are modeled in the Web NMS Database. You should also provide the "Card Type Property Name" with which the chassis application recognize the card types for each card populated in Web NMS Database. Follow the steps given below to design the main screen. Initial Settings

1. Click the Main Screen Node of the "EMS_Chassis" Project Tree. In the right side you can find the Main Screen Parameter Panel as given below.

2. Rename the Main Screen name as "Chassis_Tree" by double clicking on the node. Also change the build type of the Main Screen to "NMS Frame" using the menu command Built >Type > NMS Frame

Providing Shelf Parameters

1. Provide the values "Number of Shelves"=1 and "Number of Distinct Shelf Types"=1 respectively in the Main Screen Parameter Panel.

2. Configure the Screen Size with Width=910 and Height=470 using the respective fields under "Screen Size". Follow the link Main Screen Parameter Panel for detailed explanation and usage.

Providing Managed Object Details

1. Invoke the "Managed Object Properties" dialog using the 'Settings' button next to the Protocol Properties field which invokes the Managed Object Properties Wizard.(as given in the figure below)

AdventNet Inc. 87

Page 89: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

2. Check the "Is Slot Modeled" and "Is Shelf Modeled" check boxes in the first screen of MO Properties Wizard. Since these are the known parameters. Click "Next" button to proceed to the next screen as given below.

3. Click on the browse button and load the "com.adventnet.nms.tutorials.ems.Card.xml" using the "Load XML" button. Select the "cardType" from the XML and click on "OK" button.

4. Click "Next" button to proceed to the final screen of the MO Wizard. Here you can select extra properties if required.

5. Click "Finish" button to close the MO Properties Wizard. Designing and Laying out the Components

1. Provide the background image by double-clicking the "Main Screen" draw area to invoke the Property Form. In the "backgroundImage" property, select the "Chassis_Shelf.png" in the images folder under the <Management Builder Home>.

2. Change the layout of the Main Screen to "Null Layout" by right clicking the draw area to invoke the screen popup menu, select Layouts-->Null Layout , so that you can size the "Shelf1" panel in which the slot holders are present. You can find that the "Set all Shelves to Same Size" field is enabled, so that you can provide the shelf size and padding.

3. Resize the "Shelf1" panel so that the background image appear using the "Shelf Size and Padding Parameters for Shelves" dialog. Invoke this dialog using the "Settings" next to the "Set all Shelves to Same Size" field. Provide the values "Width"=610 and "Height"=410 (in pixels).

4. Place the "Shelf1" panel to the Center of the draw area so that the background image appear at run time.

Registering for Notifications The Chassis and it's components have to be updated on any status change of the underlying Managed Object, they represent. To achieve this Right-click on the screen and select the option "Configure Notifications > New Notification". Using the "Load XML" button load the "ManagedObjectUpdates.xml" and then select the "ManagedObjectName" property of "allUpdates". Then select the "User Code" option of the "Result Settings" and insert the following user code there.

AdventNet Inc. 88

Page 90: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

if(ManagedObjectName.startsWith(currentManagedObjectName)) { propertyHandler.refresh(resultRetriever); } Then click OK to save the changes. Providing Source Code

1. Switch to Source view tab and scroll to the init method and add the following code under the //End_init tag.

setTitle("Chassis View of "+currentManagedObjectName); setResizable(false);

2. Switch back to the Screen view tab. 3. Save the Project using the menu command File > Save > Project.

The design of Main Screen for the "EMS_Chassis" project is complete.

AdventNet Inc. 89

Page 91: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.2 Designing Shelf Screen The Shelf Screen in Chassis Wizard is to design and arrange the slot holder panels as required, the slot holder panels holds the card screens at run time. In the Main Screen, you have created a shelf type (ShelfType_1) and a shelf ("Shelf1" panel in the Main Screen). So the Shelf1 is of the type ShelfType_1 . In this topic you shall design the shelf screen "ShelfType_1" that contains 16 slots arranged Vertically in "Grid Layout" and the three card type screens. Follow the steps given below to design the Shelf Screen.

1. Switch to Shelf Screen Parameter Panel by clicking the "ShelfType_1" node in the chassis tree.

2. Change the layout of the draw area to "Grid Layout" by right clicking the draw area to invoke the screen popup menu, select Layouts > Grid Layout. This is to arrange the slot holder panels in uniform width with appropriate spacing.

3. Provide No. of Slots=16 and No. of Distinct Cards=3 respectively in the Shelf Screen Parameter panel.

4. You can find the slots holder panels numbered from 1 to 16 are placed in the Shelf Screen, Ensure that they are in the ascending order by drag and dropping the cards in respective positions.

5. Thus you have designed the "ShelfType_1" Screen for the "EMS_Chassis" project. 6. Save the Project using the menu command File > Save > Project.

Designing Card Screens You can find the three card type screens under the Shelf_Type1 screen namely Card_0, Card_1 and Card_2. Rename these cards as Access_Card, Trunk_Card and Blank_Card respectively. To rename a card screen, double-click the screen node so that the node will be editable, Provide the new name and press "Enter" key. The description for each card type screens is given below Access_Card Screen: The "Access_Card" screen is to represent the Access Card present in the Switch device, This card contains port components and a LED bean component. Follow the link Designing Access Card for steps to design the "Access" Card for detailed explanation. Trunk_Card Screen: The "Trunk_Card" screen is to represent the Trunk Card present in the Switch device, This card contains port components and a LED bean component similar to the "Access_Card" screen. Follow the link Designing Trunk Card for steps to design the "Trunk" Card for detailed explanation. Blank_Card Screen: As the name indicates this is to represent the empty slots present in the Switch device. You have to provide the background image for this screen by double-clicking the "Main Screen" draw area to invoke the Property Form. In the "backgroundImage" property, select the "Chassis_blankcard.png" in the images folder under the <Client Builder Home>. The design of "ShelfType_1" screen of the "EMS_Chassis" project is complete.

AdventNet Inc. 90

Page 92: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.2.1 Designing Access Card The "Access_Card" will be held by the Slot Holder panels present in the Shelf Screen at run time if the Web NMS Database has the card MO of the cardType property "Access". In this topic you will learn to design the "Access_Card" screen with port components and a LED bean components. Follow the steps given below to design the "Access_Card" screen. Providing Port and Card Parameters

1. Switch to Card Screen Parameter Panel of the "Access_Card" card type screen (as given in figure below) by clicking the "Access_Card" node in the chassis tree.

2. In the Card Screen Parameter of the "Access_Card" screen provide the "Number of Distinct Port Types"=1 and "Number. of Ports"=4. For detailed explanation for usage follow the topic Card Screen Parameter Panel.

3. Configure the screen size with the value "Width"=54 and "Height"=430 (in pixels). Setting Image for the Port

• Expand the "Access_Card" node to can find a port node named "Port_0". • Right-click the Port_0 node to get the Port Popup menu, Select the 'Modify' menu item from

the Popup to invoke Port Configuration dialog. • In the "Component Properties", browse and select the "networkport1.png" for the property

"Image File". Providing Protocol Intelligence for Port Type

• Expand the "Access_Card" node to can find a port node named "Port_0". • Right-click the Port_0 node to get the Port Popup menu, Select the 'Modify' menu item from

the Popup to invoke Port Configuration dialog. • Switch to "Protocol Properties" tab, change the "Polling Type" to Periodic. • Load the com.adventnet.nms.tutorials.ems.AccessPort.xml device information file

available in the mibs directory using the Load XML/MIB icon . • Select "status" node of the com.adventnet.nms.tutorials.ems.AccessPort.xml under the

"properties" node. • Click "OK" button to close the Port Configuration dialog.

a. In the Card Screen's Draw Area, you can find the Port components "Port1". ,Port2,Port3 and Port4.

b. Right-click the "Port1" port component to get the Bean Popup menu, Select the Protocol Property Form > Client_Port11 (the client property instance) from the Popup to invoke Client Property dialog. In the Client Property dialog all the field are inaccessible except the Index/Key field.

c. Provide the value currentManagedObjectName + "_Port0" in the Index/Key field, Since the Port's MO name is suffixed with the Card name. Click 'OK' to close the Client Property dialog.

• Repeat the a, b, and c steps for the ports Port2, Port3 and Port4 also.

AdventNet Inc. 91

Page 93: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Port Instance Name Port Index in Client Property dialog

Port2 currentManagedObjectName + "_Port1" Port3 currentManagedObjectName + "_Port2" Port4 currentManagedObjectName + "_Port3"

Dropping LED Bean and Configuring Protocol Intelligence

1. Drop a LED bean from AdventNetUI.jar in the Beans Palette adjacent to the ActiveIcon1 bean.

2. Right-click the LED bean to get the Bean Popup menu, Select the Protocol Property Form > New Client Property from the Popup to invoke Client Property dialog.

3. Load the com.adventnet.nms.tutotials.ems.Card.xml using the load device information button.

4. Expand the tree and move the "status" node of the com.acme.ems.Card.xml under the "properties" node to Selected nodes list. This is to display the status of the Card.

5. Select the "setResult" method with the Prototype "string" from the Result method list. 6. Click 'OK' to close the Client Property dialog.

Setting severity color to the LED Double click on the LED to bring up the property form. Change the Threshold Color and Threshold value as mentioned in the table below.

Property Value Threshold Color 1 Red Threshold Color 2 Orange Threshold Color 3 Yellow Threshold Color 4 Cyan Threshold Color 5 Green Threshold Color 6 Magenta Red Threshold Color 7 Grey Threshold Value 1 1 Threshold Value 2 2 Threshold Value 3 3 Threshold Value 4 4 Threshold Value 5 5 Threshold Value 6 6 Threshold Value 7 7

Then Click on "Close" to save the changes. Registering for Notifications The Card and it's ports have to be updated on any status change of the underlying Managed Object, they represent. To achieve this for a Card "RIGHT" click on the LED component and select the option "Configure Notifications > New Notification". Using the "Load XML" button load the "ManagedObjectUpdates.xml" and then select the "ManagedObjectName" property of "status". Then select the "User Code" option of the "Result Settings" and insert the following user code there.

AdventNet Inc. 92

Page 94: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

if(ManagedObjectName.startsWith(currentManagedObjectName)) { if(ManagedObjectName.indexOf("Card") != -1) { Led1.setResult(status); } } Then press "OK" to save the changes. For Notifying the Ports, Right-click on any of the Port component present in the Card draw area and select the option "Configure Notifications > New Notification". Using the "Load XML" button load the "ManagedObjectUpdates.xml" and then select the "ManagedObjectName" property of "status". Then select the "User Code" option of the "Result Settings" and insert the following user code there.

String status=event.getUserProperty("Status"); if(ManagedObjectName.startsWith(currentManagedObjectName)) { if(ManagedObjectName.indexOf("Port0") != -1) { Port1.setIconResult(status); } else if(ManagedObjectName.indexOf("Port1") != -1) { Port2.setIconResult(status); } else if(ManagedObjectName.indexOf("Port2") != -1) { Port3.setIconResult(status); } else if(ManagedObjectName.indexOf("Port3") != -1) { Port4.setIconResult(status); } } Arranging the Components 1. Arrange the components as given in the figure below

AdventNet Inc. 93

Page 95: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

2. Double-click the draw area to invoke the Property From for the card screen. Configure the background image property with the "fourport.png" present in <Client_Builder_Home>images folder.

Creating and Configuring the AccessCard Menu

1. Right-click the Draw Area to invoke the Card Screen Popup Menu, select Menus >Create Menu to invoke the Screen Menu Configuration UI.

2. Select the "PopUpMenu" node from the tree (in left side pane) and click "Add" button (at the bottom of the UI) to invoke a dialog asking for Pop up menu name, provide the value "AccessCard" and click "OK" button. You can find a node with the name "AccessCard" is added under the "PopUpMenu" node.

3. Select the "AccessCard" node and click "Add" button to invoke the "Choose Menu" dialog. 4. Select "JMenuItem" radio button and provide the value "Alerts" in the text field labeled

"Enter Menu Item Name". You can find the "Alerts" is added under the "AccessCard" node.

5. Select the "Alerts" node to invoke the respective panel in the right side of the split pane.

6. Remove the existing code (if any) in the text area (under the "Hide Menu Item Details" button) and enter the following code as in the above figure

Properties prop = new Properties (); prop.put ("PANEL_NAME", "AlertApplet"); String portName=currentManagedObjectName; if(! name.equals("Card")) { portName=currentManagedObjectName+"_"+name; } prop.put ("entity", "<" + portName + ">"); prop.put ("tobeselected", "Alerts"); java.awt.Event event = new java.awt.Event (this, NmsPanel.CHANGE_PANEL_EVENT, prop); NmsPanelEvent nmsevt = new NmsPanelEvent (event); NmsClientUtil.getMainPanel().handleNmsPanelEvent (nmsevt);

AdventNet Inc. 94

Page 96: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

7. Repeat the above steps (Steps: 3,4,5, and 6) to add the following JMenuItems with there

respective user codes as in the table below

JMenuItem Name Code to be provided in Text Area

Events

Properties prop = new Properties (); prop.put ("PANEL_NAME", "EventBrowser"); String portName=currentManagedObjectName; if(! name.equals("Card")) { portName=currentManagedObjectName+"_"+name; } prop.put ("entity", "<" + portName + ">"); prop.put ("tobeselected", "Events"); java.awt.Event event = new java.awt.Event (this, NmsPanel.CHANGE_PANEL_EVENT, prop); NmsPanelEvent nmsevt = new NmsPanelEvent (event); NmsClientUtil.getMainPanel().handleNmsPanelEvent (nmsevt);

Property

Property_Screen pp=new Property_Screen() pp.setVisible(true); String portName=currentManagedObjectName; String type="Card"; if(! name.equals("Card")) { portName=currentManagedObjectName+"_"+name; type="Access" ; } pp.setValue(portName,type);

8. Click "Close" button to close the "Screen Menu Configuration UI". 9. Right-click the "Access_Card" Screen's Draw Area to invoke the pop-up menu. Select

Menus > Pop-up Menus > AccessCard (radio button) as given in the figure below. This done to invoke the "AccessCard" pop-up designed in "Screen Menu Configuration UI" on right-clicking the "Access_Card" screen at run time

AdventNet Inc. 95

Page 97: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

10. Right-click the port component with the instance name "Port1" to invoke the pop-up menu.

Select Popup Menus > AccessCard (radio button) as given in the figure below. This done to invoke the "AccessCard" pop-up designed in "Screen Menu Configuration UI" on right-clicking the port component in the card screen at run time.

11. Follow the above step (Step-10) to configure the "AccessCard" pop-up menu for other port components (with the instance name) "Port2", "Port3", and "Port4".

Providing User Code in Source View Tab

Specifying NMS Packages Imported

Switch to Source view tab and add the following code (in black colored font) under the package import declarations as given below

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import com.adventnet.beans.chassis.*; import java.util.*; import com.adventnet.nms.startclient.*; import com.adventnet.nms.util.*;

Also implement the interface "MouseListener" ie add the MouseListener as follows

public class Access_Card extends JPanel implements com.adventnet.beans.chassis.ChassisCard,com.adventnet.management.ProtocolListener,com.adventnet.beans.management.MSBeansInterface,com.adventnet.management.ExceptionListener,com.adventnet.management.MSEventListener,MouseListener

AdventNet Inc. 96

Page 98: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Providing Source Code to invoke the Property Dialog 1. Scroll down to the init method and insert the following code below the //End_init tag.

Top.addMouseListener(this); Port4.addMouseListener(this); Port3.addMouseListener(this); Port2.addMouseListener(this); Port1.addMouseListener(this); Port1.setName("Port0"); Port2.setName("Port1"); Port3.setName("Port2"); Port4.setName("Port3"); Top.setName("Card"); 2. Scroll down to end of the class and write the following code before the end of class (closing

brace "}"). public String name=null; public void mouseClicked(MouseEvent me) { if(((Component)me.getSource()).getName().equals("Card")) { name=((Component)me.getSource()).getName(); } else { Component comp=componentAt((JComponent)me.getSource(),me.getX(),me.getY()); name=comp.getName(); } } public void mouseReleased(MouseEvent me) { } public void mousePressed(MouseEvent me) { } public void mouseEntered(MouseEvent me) { } public void mouseExited(MouseEvent me) { } public Component componentAt(Container parent,int x,int y) { if (!parent.contains(x, y)) { return null; } int ncomponents = parent.getComponentCount(); Component component[] = parent.getComponents(); for (int i = 0 ; i < ncomponents ; i++) { Component comp = component[i]; if (comp != null) { Rectangle rect = comp.getBounds(); int compx = rect.x; int compy = rect.y;

AdventNet Inc. 97

Page 99: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

if (comp instanceof Container) { if(comp instanceof com.adventnet.beans.images.StatusIcon) { return comp; } else { comp = componentAt(((Container)comp),x - compx, y - compy); } } else { comp = parent.getComponentAt(x - compx, y - compy); } if (comp != null && comp.isVisible()) { return comp; } } } return parent; } 3. Switch back to Screen view tab 4. Save the Project using the menu command File > Save > Project.

The design of "Access_Card" screen is complete.

AdventNet Inc. 98

Page 100: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.2.2 Designing Trunk Card The "Trunk_Card" will be held by the Slot Holder panels present in the Shelf Screen at run time if the Web NMS Database has the card MO of the cardType property "Trunk". In this topic you will learn to design the "Trunk_Card" screen with port components and a LED bean components. Follow the steps given below to design the "Trunk_Card" screen. The steps involved in designing the "Trunk_Card" is similar to the "Access_Card". Providing Port and Card Parameters Switch to Card Screen Parameter Panel of the "Trunk_Card" card type screen (as given in figure below) by clicking the "Trunk_Card" node in the chassis tree.

2. In the Card Screen Parameter of the "Trunk_Card" screen provide the "Number of Distinct Port Types"=1 and "Number. of Ports"=1. For detailed explanation for usage follow the topic Card Screen Parameter Panel.

3. Configure the screen size with the value "Width"=54 and "Height"=430. Setting Image for the Port

• Expand the "Trunk_Card" node to can find a port node named "Port_0". • Right-click the Port_0 node to get the Port Popup menu, Select the 'Modify' menu item from

the Popup to invoke Port Configuration dialog. • In the "Component Properties", browse and select the "networkport1.png" for the property

"Image File". Providing Protocol Intelligence for Port Type

• Expand the "Trunk_Card" node to can find a port node named "Port_0". • Right-click the Port_0 node to get the Port Popup menu, Select the 'Modify' menu item from

the Popup to invoke Port Configuration dialog. • Switch to "Protocol Properties" tab, change the "Polling Type" to Periodic. • Load the com.adventnet.nms.tutorials.ems.TrunkPort.xml device information file available

in the mibs directory using the Load XML/MIB icon . • Select "status" node of the com.adventnet.nms.tutorials.ems.TrunkPort.xml under the

"properties" node. • Click "OK" button to close the Port Configuration dialog.

o In the Card Screen's Draw Area, you can find the Port component "Port1". o Right-click the "Port1" port component to get the Bean Popup menu, Select the

Protocol Property Form-->Client_Port (the client property instance) from the Popup to invoke Client Property dialog. In the Client Property dialog all the field are inaccessible except the Index/Key field.

o Provide the value currentManagedObjectName + "_Port0" in the Index/Key field, Since the Port's MO name is suffixed with the Card name.

o Click 'OK' to close the Client Property dialog.

AdventNet Inc. 99

Page 101: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Dropping LED Bean and Configuring Protocol Intelligence

1. Drop a LED bean from AdventNetUI.jar in the Beans Palette adjacent to the ActiveIcon1 bean.

2. Right-click the LED bean to get the Bean Popup menu, Select the Protocol Property Form > New Client Property from the Popup to invoke Client Property dialog.

3. Load the com.adventnet.nms.tutorials..ems.Card.xml using the load device information button

4. Expand the tree and move the "status" node of the com.adventnet.nms.tutorials..ems.Card.xml under the "properties" node to Selected nodes list. This is to display the status of the Card.

5. Select the "setResult" method with the Prototype "string" from the Result method list. 6. Click OK to close the Client Property dialog.

Setting severity color to the LED Double click on the LED to bring up the property form. Change the Threshold Color and Threshold value as mentioned in the table below.

Property Value Threshold Color 1 Red Threshold Color 2 Orange Threshold Color 3 Yellow Threshold Color 4 Cyan Threshold Color 5 Green Threshold Color 6 Magenta Red Threshold Color 7 Grey Threshold Value 1 1 Threshold Value 2 2 Threshold Value 3 3 Threshold Value 4 4 Threshold Value 5 5 Threshold Value 6 6 Threshold Value 7 7

Then Click on "Close" to save the changes. Registering for Notifications The Card and it's ports have to be updated on any status change of the underlying Managed Object, they represent. To achieve this for a Card "RIGHT" click on the LED component and select the option "Configure Notifications --> New Notification". Using the "Load XML" button load the "ManagedObjectUpdates.xml" and then select the "ManagedObjectName" property of "status". Then select the "User Code" option of the "Result Settings" and insert the following user code there.

if(ManagedObjectName.startsWith(currentManagedObjectName)) { if(ManagedObjectName.indexOf("Card") != -1) { Led1.setResult(status); } }

AdventNet Inc. 100

Page 102: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Then click OK to save the changes. For Notifying the Ports, Right-click on the Port component present in the Card draw area and select the option "Configure Notifications > New Notification". Using the "Load XML" button load the "ManagedObjectUpdates.xml" and then select the "ManagedObjectName" property of "status". Then select the "User Code" option of the "Result Settings" and insert the following user code there.

String status=event.getUserProperty("Status"); if(ManagedObjectName.startsWith(currentManagedObjectName)) { if(ManagedObjectName.indexOf("Port0") != -1) { Port1.setIconResult(status); } }

Arranging the Components

1. Arrange the components as given in the figure below

2. Double-click the draw area to invoke the Property From for the card screen. Configure the background image property with the "singleport.png" present in the images folder under the <Client Builder Home> folder.

AdventNet Inc. 101

Page 103: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Creating and Configuring the Card Pop-up Menu (Similar to the steps involved in creating Pop-up menu in Access Card Screen)

1. Right-click the Draw Area to invoke the Card Screen Popup Menu, select Menus >Create Menu to invoke the Screen Menu Configuration UI.

2. Select the "PopUpMenu" node from the tree (in left side pane) and click "Add" button (at the bottom of the UI) to invoke a dialog asking for Pop up menu name, provide the value "TrunkCard" and click "OK" button. You can find a node with the name "TrunkCard" is added under the "PopUpMenu" node.

3. Select the "TrunkCard" node and click "Add" button to invoke the "Choose Menu" dialog. 4. Select "JMenuItem" radio button and provide the value "Alerts" in the text field labeled

"Enter Menu Item Name". You can find the "Alerts" is added under the "TrunkCard" node. 5. Select the "Alerts" node to invoke the respective panel in the right side of the split pane. 6. Remove the existing code (if any) in the text area (under the "Hide Menu Item Details"

button) and enter the following code Properties prop = new Properties (); prop.put ("PANEL_NAME", "AlertApplet"); String portName=currentManagedObjectName; if(! name.equals("Card")) { System.out.println(" name is "+name); portName=currentManagedObjectName+"_"+name; } prop.put ("entity", "<" + portName + ">"); prop.put ("tobeselected", "Alerts"); java.awt.Event event = new java.awt.Event (this, NmsPanel.CHANGE_PANEL_EVENT, prop); NmsPanelEvent nmsevt = new NmsPanelEvent (event); NmsClientUtil.getMainPanel().handleNmsPanelEvent (nmsevt);

7. Repeat the above steps (Steps: 3,4,5, and 6) to add the following JMenuItems with there respective user codes as in the table below

JMenuItem

Name Code to be Provided in Text Area

Events

Properties prop = new Properties (); prop.put ("PANEL_NAME", "EventBrowser"); String portName=currentManagedObjectName; if(! name.equals("Card")) { portName=currentManagedObjectName+"_"+name; } prop.put ("entity", "<" + portName + ">"); prop.put ("tobeselected", "Events"); java.awt.Event event = new java.awt.Event (this, NmsPanel.CHANGE_PANEL_EVENT, prop); NmsPanelEvent nmsevt = new NmsPanelEvent (event); NmsClientUtil.getMainPanel().handleNmsPanelEvent (nmsevt);

Property

Property_Screen pp=new Property_Screen(); pp.setVisible(true); String portName=currentManagedObjectName; String type="Card"; if(! name.equals("Card")) { portName=currentManagedObjectName+"_"+name; type="Trunk" ; } pp.setValue(portName,type);

AdventNet Inc. 102

Page 104: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

8. Click Close button to close the "Screen Menu Configuration UI". 9. Right click the "Trunk_Card" screen's Draw Area to invoke the pop-up menu. Select Menus

> Pop-up Menus > TrunkCard (radio button). This done to invoke the "TrunkCard" pop-up designed in "Screen Menu Configuration UI" on right-clicking the "Trunk_Card" screen at run time.

10. Right click the port component with the instance name "Port1" to invoke the pop-up menu. Select Popup Menus > AccessCard (radio button). This done to invoke the "TrunkCard" pop-up designed in "Screen Menu Configuration UI" on right-clicking the port component in the card screen at run time.

11. Follow the above step (Step-10) to configure the "TrunkCard" pop-up menu for other port components (with the instance name) "Port2", "Port3", and "Port4".

Providing User Code in Source View Tab

Specifying NMS Packages Imported

Switch to Source view tab and add the following code (in black colored font) under the package import declarations as given below

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import com.adventnet.beans.chassis.*; import java.util.*; import com.adventnet.nms.startclient.*; import com.adventnet.nms.util.*;

Also implement the interface "MouseListener" i.e. add the MouseListener as follows

public class Trunk_Card extends JPanel implements com.adventnet.beans.chassis.ChassisCard,com.adventnet.management.ProtocolListener,com.adventnet.beans.management.MSBeansInterface,com.adventnet.management.ExceptionListener,com.adventnet.management.MSEventListener,MouseListener

Providing Source Code to invoke the Property Dialog

1. Scroll down to the init method and insert the following code below the //End_init tag. Port1.addMouseListener(this); Port1.setName("Port0"); Top.addMouseListener(this); Top.setName("Card");

2. Scroll down to end of the class and write the following code before the end of class (closing brace "}").

public String name=null; public void mouseClicked(MouseEvent me) { if(((Component)me.getSource()).getName().equals("Card")) { name=((Component)me.getSource()).getName(); } else { Component comp=componentAt((JComponent)me.getSource(),me.getX(),me.getY());

AdventNet Inc. 103

Page 105: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

name=comp.getName(); } } public void mouseReleased(MouseEvent me) { } public void mousePressed(MouseEvent me) { } public void mouseEntered(MouseEvent me) { } public void mouseExited(MouseEvent me) { } public Component componentAt(Container parent,int x,int y) { if (!parent.contains(x, y)) { return null; } int ncomponents = parent.getComponentCount(); Component component[] = parent.getComponents(); for (int i = 0 ; i < ncomponents ; i++) { Component comp = component[i]; if (comp != null) { Rectangle rect = comp.getBounds(); int compx = rect.x; int compy = rect.y; if (comp instanceof Container) { if(comp instanceof com.adventnet.beans.images.StatusIcon) { return comp; } else { comp = componentAt(((Container)comp),x - compx, y - compy); } } else { comp = parent.getComponentAt(x - compx, y - compy); } if (comp != null && comp.isVisible()) { return comp; } } } return parent; }

3. Switch back to Screen view tab. 4. Save the Project using the menu command File > Save > Project.

The design of "Trunk_Card" screen is complete.

AdventNet Inc. 104

Page 106: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.2.3 Building Property Screen Property screen is to display the properties for the Cards or Port at run time. This screen is of the built type dialog that is invoked from card or port (present in the card). At run time, right-click the card or port to invoke the pop-up menu and select "Property" menu item. This topic explains the steps involved in building this dialog screen. The JTextField bean components dropped in this screen are not provided with client property since the values are set for these JTextFields at run time depending on the how this dialog is invoked viz. card's pop-up menu or port's pop-up menu (port components are present in the cards). Initial Settings

1. Create a new screen under "Screens" node using the menu command File > New > Screen and rename the screen name as "Property_Screen".

2. Change the layout of the screen by right-clicking the Draw Area and select Layouts > Border Layout.

3. Click and drop a two JPanels from SwingBeans.list tab of the Beans Pallete. 4. Change the instance name of these JPanels as Details_Panel and Button_Panel.

Designing Details_Panel Panel

1. Set the position of "Details_Panel" JPanel to "Center" and "Button_Panel" to south using the "Layout Properties" dialog (invoked by right-clicking the Draw Area and select Layouts Properties ).

2. Drop a JLabel from SwingBeans.list tab of the Beans Palette in the "Details_Panel" JPanel. Invoke the Property Form, provide the following properties as given in the table below

Property Value InstanceName NameL horizontalTextPosition RIGHT horizontalAlignment RIGHT text Name foreground bottle green

3. Drop 11 JLabels from SwingBeans.list tab of the Beans Palette. Select "RIGHT" option for

"horizontalTextPosition" and "horizontalAlignment" properties. Change the instance name and text properties for these JLabels as listed in the Instance Name in the table given below. Set the properties for each component as given in the table below (Similar to the above step-6)

Instance Name Property Value Text Property Value

DisplayNameL Display Name TypeL Type ManagedL Managed StatusL Status ParentKeyL Parent Key SwitchL Switch PortTypeL Port Type SpeedL Speed PortNoL Port Number TrunkL Trunk RemortPortL Remote Port

8. Drop a JTextField from SwingBeans.list tab of the Beans Palette in the "Details_Panel"

JPanel. Invoke the Property Form, provide the "Instance Name" property with the value "NameTF" and choose "False" option for the "editable " property.

AdventNet Inc. 105

Page 107: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

9. Drop 11 JTextFields from SwingBeans.list tab of the Beans Palette. Change the instance name as listed below.

• DisplayNameTF • TypeTF • ManagedTF • StatusTF • ParentKeyTF • SwitchTF • PortTypeTF • SpeedTF • PortNoTF • TrunkTF • RemotePortTF

10. Choose "False" option for the "editable " property for all the above JTextField components. 11. Change the layout of the "Details_Panel" panel by right-clicking the Draw Area and select

Layouts > GridBag Layout.

12. Position the components in the Details_Panel JPanel GridBag Layout Customizer (invoked by right-clicking the Draw Area and select Layouts Properties ) as given in the table below (also refer the figure above).

AdventNet Inc. 106

Page 108: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

13. In the GridBag Layout Customizer, set the following properties for all the components:

Property Value Grid Width 1 Grid Height 1 Fill Horizontal Anchor Center Insets 5,5,5,5

Grid Component (Identified with Instance Name) GridX GridY

NameL 0 1 DisplayL 0 2 TypeL 0 3 ManagedL 0 4 StatusL 0 5 ParentKeyL 0 6 SwitchL 0 7 PortTypeL 0 8 SpeedL 0 9 PortNoL 0 10 TrunkL 0 11 RemortPortL 0 12 NameTF 1 1 DisplayNameTF 1 2 TypeTF 1 3 ManagedTF 1 4 ParentKeyTF 1 5 StatusTF 1 6 SwitchTF 1 7 PortTypeTF 1 8 SpeedTF 1 9 PortNOTF 1 10 TrunkTF 1 11 RemortPortTF 1 12

Designing Button_Panel Panel

1. Change the layout of this panel by right-clicking the Draw Area and select Layouts > Flow Layout.

2. Drop a JButton from SwingBeans.list tab of the Beans Palette in the "Button_Panel" JPanel. Invoke the Property Form, provide the "Instance Name" property with the value "Close" and choose "text" property and provide the value "Close". Close the Property Form using the "Close" button.

AdventNet Inc. 107

Page 109: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

3. Right-click the "Close" button and select Interaction Wizard > action > actionPerformed to get a rubber-band line, drop the rubber-band line on to the "Close" button itself to invoke the Interaction Wizard.

4. Move to the last screen of the Interaction wizard using the "Next" button (by clicking the button twice).

5. Insert the following code in the actionPerformed method setVisible(false);

6. Close the Interaction Wizard using the "Finish" button.

import java.io.*; import java.util.Properties; import com.adventnet.nms.mapui.MapClientAPI; For the Property screen to show the properties of the Card and Port when the menu is invoked form Card and port respectively, insert the following user code just before the final "{" brace of the source in the source tab - MapClientAPI api; public void setValue(String portname,String type) { String pn = null ; if( portname != null ) { pn = portname; } else{ System.out.println(" portname is null . Please input the portname"); return; } setTitle("Property - "+pn); try{ api=MapClientAPI.getInstance(); }catch(Exception e) { System.out.println("Error in getting Handle of MapClientAPI"+e); } try{ Properties prop=api.getManagedObjectProperties(pn); NameTF.setText(prop.getProperty("name")); SwitchTF.setText(prop.getProperty("switchnode")); SpeedTF.setText(prop.getProperty("speed")); PortTypeTF.setText(prop.getProperty("portType")); DisplayNameTF.setText(prop.getProperty("displayName")); ParentKeyTF.setText(prop.getProperty("parentKey")); TypeTF.setText(prop.getProperty("type")); ManagedTF.setText(prop.getProperty("managed")); StatusTF.setText(prop.getProperty("status")); PortNoTF.setText(prop.getProperty("portno")); if(type.equals("Trunk")) { TrunkTF.setText(prop.getProperty("trunk")); RemotePortTF.setText(prop.getProperty("remotePortID")); } if(type.equals("Access")) { TrunkL.setText("SNMP Interface"); TrunkTF.setText(prop.getProperty("snmpInterface")); RemotePortL.setVisible(false);

AdventNet Inc. 108

Page 110: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

RemotePortTF.setVisible(false); } if(type.equals("Card")) { SwitchL.setText("Card Type"); SwitchTF.setText(prop.getProperty("cardType")); PortTypeL.setText("Serial Number"); PortTypeTF.setText(prop.getProperty("serialno")); SpeedTF.setVisible(false); StatusTF.setVisible(false); PortNoTF.setVisible(false); TrunkTF.setVisible(false); RemotePortTF.setVisible(false); SpeedL.setVisible(false); StatusL.setVisible(false); PortNoL.setVisible(false); TrunkL.setVisible(false); RemotePortL.setVisible(false); } }catch (Exception remoteException) { System.out.println ( "Error in getting api.getByName using portname " + portname); remoteException.printStackTrace(); return; } } The design of "Property_Screen" screen dialog is complete.

AdventNet Inc. 109

Page 111: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.3 Chassis Configuration In the Chassis Configuration Screen you have to provide the details for the 'Shelf_Type1' & 'Shelf Identification Name' in Chassis Configuration table, 'Slot Identification Name' in the Shelf Configuration table and 'Card Value' in the Card Configuration table. You can also configure the default card type for each slot using the "Default Type" column in Shelf Configuration table and set the default type as "Blank_Card".

Chassis Configuration Table Ensure cell under the Shelf Identification Name for "Shelf1" and the value is set to currentManagedObjectName + "_Shelf1"(by default as in the above figure). Since the shelf name in the Web NMS database is referred with its respective Parent MO. Shelf Configuration Table Ensure following parameters are set for the respective slots in the Shelf Configuration Table as listed in the table below (refer the above figure)

AdventNet Inc. 110

Page 112: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Slot Default Type Slot Identification Name

Slot1 currentManagedObjectName + "_Slot0" Slot2 currentManagedObjectName + "_Slot1" Slot3 currentManagedObjectName + "_Slot2" Slot4 currentManagedObjectName + "_Slot3" Slot5 currentManagedObjectName + "_Slot4" Slot6 currentManagedObjectName + "_Slot5" Slot7 currentManagedObjectName + "_Slot6" Slot8 currentManagedObjectName + "_Slot7" Slot9 currentManagedObjectName + "_Slot8" Slot10 currentManagedObjectName + "_Slot9" Slot11 currentManagedObjectName + "_Slot10" Slot12 currentManagedObjectName + "_Slot11" Slot13 currentManagedObjectName + "_Slot12" Slot14 currentManagedObjectName + "_Slot13" Slot15 currentManagedObjectName + "_Slot14" Slot16

Card_2

currentManagedObjectName + "_Slot15"

Card Configuration Table In Card Configuration Table, provide the values for each card type screens as given in the table below (also refer the above figure). This is done by double-clicking the editable combo box against each card and entering the respective card value.

Card Type Screen Name Card Value Access_Card Access Trunk_Card Trunk Blank_Card Blank

Note: The correct card values should be provided as in the Web NMS Database because the incorrect card values will not poll the cards in slots.

Save the Project using the menu command File > Save > Project.

AdventNet Inc. 111

Page 113: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.1.4 Compiling and Packaging the Application The Packaging of applications built using Client Builder to NAR (NMS ARchive) is done using the Package Wizard. After NAR is created, NAR is installed in the Web NMS Client (using Deployment Wizard in Web NMS). Before the packaging the chassis application to NAR, you must compile the project Follow the steps given below to compile the project Compiling the Project

1. Ensure that the "NmsClientClasses.jar" of Web NMS is in the CLASSPATH for proper compilation. You can verify this in the "Required Jars" combo box present in the Classpath Settings tab of Project Properties dialog (invoked using menu command Properties > Project Properties)

2. Ensure that the <Web NMS Home >/classes and <Web NMS Home>/tutorials/ems_tutorial/classes are in classpath. You can verify this in the "Classpath" combo box present in the Classpath Settings tab of Project Properties dialog (invoked using menu command Properties > Project Properties)

3. Regenerate the Project using the menu command Project > Regenerate Project. 4. Compile the Project using the menu command Project > Compile Project. You will get the

message "Compilation succeeded for EMS_Chassis" in status bar. Packaging the Classes using Package Wizard

1. Invoke the Package Wizard for creating the Device Specific NAR using the menu command Tools > Package for Web NMS > Device Specific. For detailed explanation on using the Package Wizard follow the topic Integration with Web NMS.

2. Select the value "com.adventnet.nms.tutorials.ems.ChassisScreen" from the Classes list and click "Next" to proceed to next screen.

3. Choose the required destination directory where the NAR has to be created using the browse

button. Click "Next" to proceed to next screen. 4. Provide the corresponding device type that of the device host such as "Switch" in the "Device

Type" field. Click "Next" to proceed to next screen. 5. Ensure the required device information are listed in the "DESTINATION DIRECTORY" and

click "Next" to proceed to final screen of the Package Wizard. 6. Select the "ManagingObjectName" value from the Parameter list and provide the value

"${name}" in the "Value" text field. Click "Modify" button to change the values in the list as in the figure below. This is to provide the ManageObjectName that dynamically changes depending on the Map node (the application is invoked from the Map node) in Web NMS Client.

AdventNet Inc. 112

Page 114: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

7. Click "Finish" button to close the Package Wizard to get the confirmation dialog with the message "Chassis_Tree" created successfully at <specified location>.

8. Import the NAR in the Studio EMS Project using the Import Nar Wizard in Studio with the required menu name and menu item.

Note: The above project is also available in <Web NMS Home>/StudioTools/ClientBuilder/projects directory with the project name EMS_Chassis. You can also load and see this project for your reference.

AdventNet Inc. 113

Page 115: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2 Building Configuration Screen Building Switch Configuration Application

The Configuration Management of the Network Elements is an integral part of the Element Management Application. In this section, you learn to build Configuration Application for configuring the Switch details using StudioTools > ClientBuilder > Configuration Wizard. The built Configuration Application is packaged as NAR (NMS ARchive) and imported into EMS Tutorial Studio project as a Client NAR. The imported NAR will be installed in Web NMS. The Installed Configuration Application is invoked from the Web NMS Client by invoking a menu on the Map node, where the Map nodes are representing the Switch Devices. The application invoked from a Map node is shown in the figure below. Final Output

Pre-requisites To learn the basics on using Configuration Wizard and configuration related terms and definitions refer the following topics available under the Studio > Client Builder > Configuration Wizard Help. Copy the following images from the Web NMS to <Client Builder Home>/images directory.

Image Source Directory ems_tut_switch_tick.jpg <Web NMS

Home>/StudioTools/Studio/projects/EMS_Tutorial/WebNMS/images logo.png <Web NMS

Home>/StudioTools/Studio/projects/EMS_Tutorial/WebNMS/images properties.png <Web NMS Home>/images

AdventNet Inc. 114

Page 116: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Device Information

• BRIDGE-MIB - It is used as Device Information for building Switch Configuration Application. Since you are building a Configuration Application for representing Map Nodes for Switch device, the BRIDGE-MIB is used as Device Information to build the Configuration Management Application.

• RFC1213-MIB - The device details such as System Name, Description, Physical Location, User/Contact Name are configured or displayed in Switch Configuration Application using this MIB.

Getting Started With Development Follow the steps given below to create a configuration project in AdventNet Client Builder - Configuration Wizard

Opening Configuration Wizard

To invoke Chassis Wizard from Web NMS Launcher, double-click Web NMS IDE icon in the Web NMS Launcher. From here, double-click the Configuration Wizard icon. Alternatively, you can use startConfigurationWizard.bat/.sh present in <Web NMS Home>/StudioTools/ClientBuilder/bin.

Creating the Project and Loading Device Information

1. Select File > New > Project to invoke the "Project Details" dialog to create a new

configuration project. 2. Provide the "Project Name" field with the value "EMS_Configuration" if it does not

exists. 3. Provide the "Package Name" field with the value

"com.adventnet.nms.tutorials.ems". 4. Click OK button to create the project in the projects folder under the <Client Builder

Home>. You can find the project named "EMS_Confiugration" in the project tree. 5. Load the BRIDGE-MIB under the <Client Builder Home>/mibs directory using the

load XML/MIB button . Similarly load the RFC1213-MIB. 6. Invoke the "Screen Properties" dialog using Properties > Screen Properties.

Change the "Title" value to "Screen Configuration" and click OK.

Configuring the Required Classes and JARs

1. Invoke the "Project Properties" dialog using Properties > Project Properties.

2. In the "General" tab, click the browse button against the "Project Parameters" field to invoke the "Project Parameters List". Add the entry "COMMUNITY=public;to the existing list and click OK button.

3. Switch to "Classpath Settings" tab and click the browse button against the "Classpath" field to invoke the "Classpath List" dialog. Add the <Web NMS Home> /classes directory using the "Browse" button. Click "OK" button to close the dialog

4. Click the browse button against the "Required Jars" field to invoke the "Containing Jars List" dialog. Add the "NMSClientClasses.jar" available under <Web NMS Home>/classes directory using the "Browse" button. Similarly, add the <Web NMS Home>/StudioTools/Studio/projects/EMS_Tutorial/classes. Click OK to close the dialog.

5. Click OK to close the 'Project Properties" dialog.

AdventNet Inc. 115

Page 117: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Steps Involved in Building Project and Packaging the Application The steps involved in building the Configuration Management Application, Packaging the Application as NAR and installing the NAR in Web NMS Client are given below

1. Designing Main Screen - Switch Configuration Screen 2. Designing Panels for Main Screen

a. System Configuration Panelb. Spanning Tree Details Panelc. Port Parameters Panel

3. Integrating Panels and Adding Actions for Buttons 4. Compiling and Packaging the Application

AdventNet Inc. 116

Page 118: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.1 Designing Main Screen - Switch Configuration Screen The main screen of the Configuration Management Application has a tree in the left side, tabbed pane in the right side and a panel with buttons at the bottom of the screen. The figure below shows the components in the main screen. Design Time View

Steps Involved Initial Settings

1. Create a new screen under the "EMS_Configuration" project and rename it as "SwitchConfiguration".

2. Change the build type of the Screen to "NMS Frame" using the menu command Build > Type > NMS Frame.

3. Change the layout of the Screen to "Border Layout" by right-clicking the Draw Area to invoke the screen pop-up menu, select Layouts > Border Layout.

AdventNet Inc. 117

Page 119: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Dropping and Laying out the Components

1. Drop the AdventNetTree bean and change its instance name by following the steps below a. Switch to the "Project Classes" tab of Beans Palette. b. Provide the value "com.adventnet.beans.utilbeans.AdventNetTree" in the "Enter

the Class Name" text field. c. Click and drop the "bean" button in the "West" position of the Draw Area . d. Change the instance name of the AdventNetTree bean instance as "Switch_Tree"

using the Property Form.

2. Drop the JTabbedPane bean and change its instance name by following the steps below a. Switch to the "SwingBeans.list" tab of Beans Palette. b. Click and drop the JTabbedPane bean in the "Center" position of the Draw Area. c. Change the instance name of the JTabbed bean instance as "Details_TabbedPane"

using the Property Form.

3. Drop the JPanel bean and change its instance name by following the steps below a. Switch to the "SwingBeans.list" tab of Beans Palette. b. Click and drop the "JPanel" bean in the "South" position of the Draw Area. c. Change the instance name of the JPanel bean instance as "Button_Panel" using the

Property Form.

Invoke the "Border Layout" dialog to arrange the components by right-clicking the Draw Area and select "Layout Properties" menu item. Select each component in the "Component" combo box and ensure the parameters are as in the table given below, if not provide the values and click "OK" button to close the dialog.

Component Position HGap VGap Button_panel South Switch_Tree West Details_TappedPane Center

5 5

Designing Switch_Tree Bean

1. Double-click the "Switch_Tree" bean to invoke the Property Form. 2. Select the TreeValues and Click "Click to edit Titles and class or File names" button

against it to invoke the "Tree Values" dialog. 3. Add the "Configure Switches" node by following the steps below

a. Provide the value "Configure Switches" in the "Node Name" text field. b. Select the "logo.png" from the <Client Builder Home>/images using the "Browse"

button. c. Click the "Add" button.

Similarly, add following nodes under the root node (Configure Switches) of the tree with the respective icons as given in the table below.

Node Name Icon Name

Switch Name ems_tut_switch_tick.jpg View Result properties.png

4. Click "Apply" button after adding the above nodes and Click "Close" to close the dialog. 5. Close the Property Form using the "Close" button. 6. Right-click the "Switch_Tree" bean, select Interaction Wizard > treeSelection >

valueChanged to get a rubber band line. Bring the rubber band line into "Switch_Tree" bean itself to invoke the Interaction Wizard.

AdventNet Inc. 118

Page 120: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

a. Ensure that the "Create New Connection class" option is selected in the first screen of the Interaction Wizard. click "Next" button.

b. Ensure the "General Component Interaction" is selected and Click "Next" button twice to go to the final screen of the Interaction Wizard.

c. Insert the following code in the valueChanged method String name=null; TreePath tp=arg0.getNewLeadSelectionPath(); if(tp != null) { AdventNetTreeNode an=(AdventNetTreeNode)tp.getLastPathComponent(); name=an.getName(); if(name.equals("View Result")) { Details_TabbedPane.setEnabledAt(0,false); if (userOperations.toString().indexOf("Ems") != -1) { if ( userOperations.contains("Ems Configure All") && (! userOperations.contains ("Ems Configure None"))) { Details_TabbedPane.setEnabledAt(1,false); Details_TabbedPane.setEnabledAt(2,false); } } if (userOperations.toString().indexOf("Ems") == -1) { Details_TabbedPane.setEnabledAt(1,false); Details_TabbedPane.setEnabledAt(2,false); } if(Details_TabbedPane.indexOfTab("Results") == -1) Details_TabbedPane.insertTab("Results",null,Results_Panel,null,Details_ TabbedPane.getTabCount()); Details_TabbedPane.setSelectedIndex(Details_TabbedPane.getTabCount()-1); configure.setEnabled(false); refresh.setEnabled(false); } if(name.equals(getParameter("HOST"))) { if((Details_TabbedPane.indexOfTab("Results")) != -1) { Details_TabbedPane.removeTabAt(Details_TabbedPane.indexOfTab("Results")); } Details_TabbedPane.setEnabledAt(0,true); if (userOperations.toString().indexOf("Ems") != -1) { if ( userOperations.contains("Ems Configure All") && (! userOperations.contains("Ems Configure None"))) { Details_TabbedPane.setEnabledAt(1,true); Details_TabbedPane.setEnabledAt(2,true); } } Details_TabbedPane.setSelectedIndex(0); refresh.setEnabled(true); if (userOperations.toString().indexOf("Ems") != -1) { if ( (userOperations.contains("Ems Configure Scalar") || userOperations.contains("Ems Configure All")) && ! userOperations.contains("Ems Configure None")) { configure.setEnabled(true);

AdventNet Inc. 119

Page 121: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

} } if (userOperations.toString().indexOf("Ems") == -1) { Details_TabbedPane.setEnabledAt(1,true); Details_TabbedPane.setEnabledAt(2,true); configure.setEnabled(true); } } }

• Click "Finish" to close the Interaction Wizard.

7. Switch to Source View tab and scroll to the setVisible method. Write the following code under the //<End_setVisible_boolean> tag.

if(bl) { String icon2="../images/ems_tut_switch_small.png"; AdventNetTreeNode node=Switch_Tree.getNode(getParameter("HOST"),icon2); Switch_Tree.setSelectionInterval(1,1); Switch_Tree.addNode(node); Switch_Tree.selectNode(node); if (userOperations.toString().indexOf("Ems") != -1) { if(userOperations.contains("Ems Configure Scalar") && ( ! userOperations.contains("Ems Configure All") && ! (userOperations.contains("Ems Configure None")) )) { Details_TabbedPane.removeTabAt(Details_TabbedPane.indexOfTab("STP")); Details_TabbedPane.removeTabAt(Details_TabbedPane.indexOfTab("PortParameters")); } if (userOperations.contains("Ems Configure None")) { configure.setEnabled(false); } } }

8. Add the following code under the package import declarations as given below : import java.net.*; import javax.swing.tree.TreePath; import java.util.Vector; import java.rmi.Naming; import com.adventnet.beans.utilbeans.AdventNetTreeNode; import com.adventnet.nms.util.NmsClientUtil; import com.adventnet.nms.util.BrowserControl; import com.adventnet.security.authorization.AuthorizationEngine;

9. Add the following code under the package variable declarations as given below : private Vector userOperations=new Vector();

10. Add the following code in the init method before the closing braces ("}") of this method as given below :

CheckUserOperations(); setResizable(false);

AdventNet Inc. 120

Page 122: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

11. Add the following code in stop method before the closing braces ("}") of this method as given

below : PortDetails1.stop();

12. Add the following code in start method after the opening braces ("{") of this method as given below :

PortDetails1.start(); Custom code that need to be added in the Configuration management screen to cater for Security administration In the Configuration wizard, we have created the screens for configuring the Switches. In the SwitchConfiguration.java file of the EMS configuration project, the following code was accommodated in order to cater for Security administration. When the switch configuration screen is invoked from the client, the checkUserOperations() method makes a RMI lookup to the AuthorizationEngineAPI for retrieving the operations for the logged-in user. private void checkUserOperations() { try{ URL BE_Url = NmsClientUtil.applet.getCodeBase(); String BEHostName = "localhost"; BEHostName = BE_Url.getHost(); if(BE_Url != null && BEHostName != null) { String name = "//" + BEHostName + "/NmsAuthEngineAPI"; AuthorizationEngine authEngine = (AuthorizationEngine) Naming.lookup(name); if(authEngine == null) { System.out.println("Could not get rmi handle to AuthAPI"); } else { String userName = NmsClientUtil.getUserName(); userOperations = authEngine.getOperationsForUser(userName); } } }catch(Exception exp) { System.out.println("Exception while getting RMI handle to Authorization Engine " + exp.getMessage()); } } Whenever a component in the UI is added, disabled or enabled, a check is made if the user logged in has the required permission to perform the operation. Based on the user operation, the component is enabled or disabled.

AdventNet Inc. 121

Page 123: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

if(userOperations.toString().indexOf("Ems") != -1) { if (userOperations.contains("Ems Configure None")) { configure.setEnabled(false); } }

13. Switch back to Screen View tab. Designing the Button_Panel Bean

1. Change the layout of Button_Panel to flow layout 2. Drop a JButton from the SwingBeans.list tab of BeansPalette and change its instance name

as "configure" and provide "text" property value "Configure" in the Property Form. Similarly drop three more JButtons and change their properties in Property Form as given in the table below:

Instance Name Text Property refresh Refresh help Help close Close

3. Resize the bean components to the required size (refer the Design Time View screen shot).

Note: The actions for each of the above buttons are provided after the panel screens are designed and integrated.

AdventNet Inc. 122

Page 124: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.2. Designing Panels for Main Screen The Main Screen - - Switch Configuration Screen contains a Tabbed Pane (Details_TabbedPane) in which four tabs are present, in which you have already designed the Results_Table Panel. This section explains the designing of other panels.

• Designing System Configuration Panel • Designing Spanning Tree Details Panel • Designing Port Parameters Panel

AdventNet Inc. 123

Page 125: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.2.1 Designing System Configuration Panel The System Configuration Panel is to show the Device Details such as Name, Description, Physical Location, and User/Contact Name and configure them at run time. This Panel is the default tab in the Switch Configuration Application at run time. This topic explains the step-by-step procedure to build this panel screen. Steps Involved Initial Settings

1. Create a new screen under the "EMS_Configuration" project and rename it as "SystemConfig".

2. Change the build type of the Screen to "Panel" using the menu command Build > Type > Panel.

3. Change the layout of the Screen to "Border Layout" by right-clicking the Draw Area to invoke the screen pop-up menu, select Layouts > Border.

Dropping and Laying Out Components

1. Switch to the "SwingBeans.list" tab of Beans Palette. 2. Click and drop a JPanel bean in the "Center" position of the Draw Area and change its

instance name as "Sys_Details_Panel". 3. Change the layout of the "Sys_Details_Panel" to "GridBag Layout" by right-clicking the

Draw Area to invoke the screen pop-up menu, select Layouts > GridBag Layout. 4. Drop a JLabel from the SwingBeans.list tab of BeansPalette and change its instance name

as "nameL" and provide "text" property value "Name" in the Property Form. Similarly drop three more JLabel and change their properties in Property Form as given in the table below

Instance Name Text Property descL Description phys_locL Physical Location cont_nameL User/Control Name

5. Expand the RFC1213-MIB node in the XML tree and scroll down to RFC1213-MIB > org >

dod > internet > mgmt > mib-2 > system. 6. Click and drop the "sysName" representation (View1 node under this node) and change the

instance name as nameTF. Similarly drop the representation for the nodes given in the table below and change the their respective instance name.

Representation for the Node Instance Name

sysDescr descTF sysLocation phy_locTF sysContact cont_nameTF

7. Invoke the "GridBag Layout Customizer" window for the "Sys_Details_Panel" by right-

clicking the screen and select "Layout Properties". 8. In the GridBag Layout Customizer, set the following properties for all the components:

AdventNet Inc. 124

Page 126: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Property Value Fill Horizontal Anchor Center Insets 5,5,5,5

8. Arrange the components in the "GridBag Layout Customizer" window as given

below

Grid Component (Identified with Instance Name)

GridX GridY Anchor IPadX WeightX

nameL 0 descL 1 phys_locL 2 cont_nameL

0

3

EAST 4 0.0

nameTF 0 descTF 1 phy_locTF 2 cont_nameTF

1

3

WEST 0 0.1

This design of "System Configuration Panel" screen is complete. Save the "SystemConfig" screen using the menu command File > Save > Screen. Compile the "SystemConfig" screen using the menu command Build > Compile.

AdventNet Inc. 125

Page 127: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.2.2 Designing Spanning Tree Details Panel The Spanning Tree Details Panel is to show the Spanning Tree Details such as Bridge Priority, Maximum Age, Hello Time, and Forward Delay and configure them at run time. This Panel is in the "STP" tab of the Switch Configuration Application at run time. This topic explains the step-by-step procedure to build this panel screen. Steps Involved Initial Settings

1. Create a new screen under the "EMS_Configuration" project and rename it as "STP". 2. Change the build type of the Screen to "Panel" using the menu command Build > Type >

Panel. 3. Change the layout of the Screen to "Border Layout" by right-clicking the Draw Area to

invoke the screen pop-up menu, select Layouts > Border. Dropping and Laying Out Components

1. Switch to the "SwingBeans.list" tab of Beans Palette. 2. Click and drop a JPanel bean in the "Center" position of the Draw Area and change its

instance name as "ST_Details_Panel". 3. Change the layout of the "ST_Details_Panel" to "GridBag Layout" by right-clicking the

Draw Area to invoke the screen pop-up menu, select Layouts > GridBag Layout. 4. Drop a JLabel from the SwingBeans.list tab of BeansPalette and change its instance name

as "bridge_priorityL" and provide "text" property value "Bridge Priority" in the Property Form. Similarly drop three more JLabel and change their properties in Property Form as given in the table below

Instance Name Text Property max_ageL Max.Age hello_timeL Hello Time forw_delayL Forward Delay

5. Expand the BRIDGE-MIB node in the XML tree and scroll down to BRIDGE-MIB > mib-2 >

dot1dBridge > dot1dStp. 6. Click and drop the "dot1dStpPriority" representation ("View1" node under this node) from

the XML tree in the "ST_Details_Panel" bean. Change the instance name of the dropped bean "bridge_priorityTF".

7. Drop a JTextField from the SwingBeans.list tab of BeansPalette and change its instance name as "max_ageTF". Similarly, drop two more text fields and change their instance names as "hello_timeTF" and "forw_delay_TF" respectively.

8. Switch to the Config tab. 9. Select the "dot1dStpBridgeMaxAge" node from the XML Tree, and click the "Add

Attribute" button to add the attributes from the Xml Tree to the Config Tree. 10. Edit the code in the "Code Area" and change the bolded code line as given below.

Properties valueProp = new Properties(); valueProp.setProperty(LABEL,"dot1dStpBridgeMaxAge"); valueProp.setProperty(TYPE,"2"); valueProp.setProperty(VALUE,String.valueOf(max_ageTF.getText())); return valueProp;

AdventNet Inc. 126

Page 128: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

11. Similarly repeat the above steps for the nodes dot1dStpBridgeHelloTime, dot1dStpBridgeForwardDelay. The corresponding code lines to be modified are respectively.

valueProp.setProperty(VALUE,String.valueOf(hello_timeTF.getText())); valueProp.setProperty(VALUE,String.valueOf(forw_delay_TF.getText()));

12. Click and drop the "dot1dStpBridgeMaxAge" node from the XML Tree on the "max_ageTF"

bean to invoke the Client Property dialog. Select the "setText" method from the "Result Method" list and click OK button to close the Client Property dialog.

13. Follow the above step (Step-7) to drop the nodes and setting the "setText" method in Client Property dialog.

Bean Instance

Name Node to be Dropped from XML Tree

hello_timeTF dot1dStpBrideHelloTime forw_delay_TF dot1dStpBridgeForwardDelay

14. Invoke the "GridBag Layout Customizer" window for the "Sys_Details_Panel" by right-

clicking the screen and select "Layout Properties". 15. Arrange the components in the "GridBag Layout Customizer" window as given below. 16. In the GridBag Layout Customizer, set the following properties for all the components:

Property Value Fill Horizontal Insets 5,5,5,5

Grid Component

(Identified with Instance Name) GridX GridY

Anchor IPadX WeightX

bridge_priorityL 0 max_ageL 1 hello_timeL 2 forw_delayL

0

3

EAST 4 0.0

bridge_priorityTF 0 max_ageTF 1 hello_timeTF 2 forw_delay_TF

1

3

WEST 0 0.1

This design of "Spanning Tree Details" screen is complete. Save the "STP" screen using the menu command File > Save > Screen. Compile the "STP" screen using the menu command Build > Compile.

AdventNet Inc. 127

Page 129: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.2.3 Designing Port Parameters Panel The Port Parameters Panel displays the details of the Ports, The Port Parameters Panel is in the "PortParameter" tab of the "Details_TabbedPane" in the Main Screen. The designing Port Panel Details Panel is explained in this topic. Follow the steps given below to build the Port Parameters Panel. Steps Involved Initial Settings

1. Create a new screen under the "EMS_Configuration" project and rename it as "PortDetails".

2. Change the build type of the Screen to "Panel" using the menu command Build > Type > Panel.

3. Change the layout of the Screen to "Border Layout" by right-clicking the Draw Area to invoke the screen pop-up menu, select Layouts > Border.

Dropping and Laying Out Components

1. Click and drop a JScrollPane bean from SwingBeans.list tab of Beans Palette in the "Center" position of the Draw Area. Change its instance name as "Details_ScrollPane".

2. Drop a SortTable bean from AdventNetUtils.jar of the Beans Palette in the "Details_ScrollPane" bean. Change the SortTable bean instance name as "Port_Details_Table".

Creating and Dropping the Virtual Table Model

1. Right-click the "Virtual Table Model" node in the XML Tree and select "Add" menu item to invoke the "Create New Virtual Table Model" Wizard.

2. Modify the "Virtual Table Model Name" as "PortParametersTable1". 3. Select the following columnar nodes from XML tree to "Selected Nodes" list using the

button. These nodes are present under the "dot1dStpPortTable" table node in the path BRIDGE-MIB > mib-2 > dot1dBridge > dot1dStp > dot1dStpPortTable of the XML tree

• dot1dStpPort • dot1dStpPortPriority • dot1dStpPortState • dot1dStpPortEnable • dot1dStpPortPathCost • dot1dStpPortForwardTransistion

4. Click the "Advanced Properties" button and change the 'PollInterval' to "0". 5. Click "Next" button to proceed to final screen of the Wizard. 6. Scroll down to end of the Class and add the following methods namely "getColumnClass",

"getValueAt", and "setValueAt" before the closing brace ("}") of the class. public Class getColumnClass(int c) { if(c == 3) { return Boolean.class; } else { return super.getColumnClass(c); } }

AdventNet Inc. 128

Page 130: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

public Object getValueAt(int row, int col) { if(col == 3) { String portEnabled = super.getValueAt(row,col).toString(); if(portEnabled.indexOf("1") != -1) { return Boolean.TRUE; } else { return Boolean.FALSE; } } else { return super.getValueAt(row,col); } } public void setValueAt(Object value , int row , int col) { if(col == 3) { Boolean enabled = (Boolean)value; if(enabled.booleanValue()) { super.setValueAt("1",row,col); } else { super.setValueAt("2",row,col); } } else { super.setValueAt(value,row,col); } }

7. Click "Finish" button to close the Virtual Table Model Wizard. 8. Click and drop the "PortParametersTable1" node under the "Virtual Table Model" node of

the XML tree outside the Draw Area. You can find the name of dropped bean is "PortParmetersTable11" .

9. Double-click the "Port_Details_Table" to invoke the Property Form. Select the "model" and choose the "PortParmetersTable11" from the combo box.

Dropping and Configuring ConfigCache Bean

1. Click and drop the ConfigCache bean from AdventNetMSBeans.jar of Beans Palette outside the Draw Area.

2. Switch to the Source View tab and scroll down of the screen's class. 3. Insert the following methods namely "saveTableValues", "getSavedTableValues" and

"getStringConfigValueFor" before the closing braces of the class ("}"). This code is to save the values from the table.

AdventNet Inc. 129

Page 131: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

public String getStringConfigValueFor(String gnameArg, String identifierNameArg, String identifierArg, String indexArg, Object[] userData) { if(gnameArg.equals("group1")) { if(identifierNameArg.equals("dot1dStpPortPriorityInstance")) { int index = Integer.parseInt((String)userData[0]); return (String)SortTable1.getValueAt(index, 1); } else if(identifierNameArg.equals("dot1dStpPortEnableInstance")) { int index = Integer.parseInt((String)userData[0]); String val=SortTable1.getValueAt(index,3).toString(); if(val.equals("true")) { return "1"; } else return "2"; } else if(identifierNameArg.equals("dot1dStpPortPathCostInstance")) { int index = Integer.parseInt((String)userData[0]); return (String)SortTable1.getValueAt(index, 4); } } return null; } public void saveTableValues() { ConfigCache1.resetAll(); for(int i=0;i<Port_Details_Table.getRowCount();i++) { try{ ConfigCache1.saveConfigInfo("this_group1"+i, "group1", PortDetails.this, new String[]{""+i}); }catch(Exception ex) { System.out.println("Error in Configuration "+ex); } } } public GroupInfoCache[] getSavedTableValues() { return ConfigCache1.getGroupInfoCaches(); }

4. Add the following code under the package import declarations as given below : import com.adventnet.beans.configuration.GroupInfoCache;

5. Switch to the Config tab. 6. Select the "dot1dStpPortPriorityInstance" node from the XML Tree, and click the "Add

Attribute" button to add the attributes from the Xml Tree to the Config Tree. 7. Edit the code in the "Code Area" and the following code

AdventNet Inc. 130

Page 132: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

String valueStr = getStringConfigValueFor(gnameArg, identifierNameArg, identifierArg, indexArg, userData); if(valueStr == null) { return null; }

8. Change the bolded code line as given below. Properties valueProp = new Properties(); valueProp.setProperty(LABEL,"dot1dStpPortPriorityInstance"); valueProp.setProperty(TYPE,"2"); valueProp.setProperty(VALUE,valueStr); return valueProp;

9. Similarly repeat the above steps for the nodes "dot1dStpPortEnableInstance","dot1dStpPortPathCostInstance". The corresponding code lines to be modified are given below :

valueProp.setProperty(VALUE,valueStr);

10. Add the following the code against the index attribute in the code area int index = Integer.parseInt((String)userData[0]); return (String)Port_Details_Table.getValueAt(index, 0); This design of "Port Details" panel screen is complete. Save the "PortDetails" screen using the menu command File > Save > Screen. Compile the "PortDetails" screen using the menu command Build > Compile.

AdventNet Inc. 131

Page 133: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.3 Integrating Panels and Adding Actions for Button The Main Screen has "Details_TabbedPane" (tabbed pane bean) containing four tabs, but the Main Screen currently has only tab named "Results_Panel" (The "Results" in figure below). This topic explains the integration of the three panel screens into to the Main Screen as tabs of the "Details_TabbedPane" bean and setting action for each button in the "Button_Panel". Follow the steps given below to achieve the same Design Time View

Steps Involved

1. Switch to "Project Classes" tab of the Beans Palette and select "com.adventnet.nms.tutorials.ems.SystemConfig" from the "Enter Class Name" combo box. Click and drop the button in the "Details_TabbedPane" bean. Thus you have dropped the "SystemConfig" class as bean. You can find tab with the name "SystemConfig1" in the "Details_TabbedPane" bean. Similarly drop the "com.adventnet.nms.tutorials.ems.STP" and "com.adventnet.nms.tutorials.ems.PortDetails" in the "Details_TabbedPane" bean. You can find the "STP1" and "PortDetails1" in the "Details_TabbedPane" bean.

AdventNet Inc. 132

Page 134: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

2. Designing the Details_TabbedPane Bean • Drop a JPanel1 in "Details_TabbedPane" bean and change its instance name as

"Results_Panel" using the Property Form. • Change the layout of the "Results_Panel" bean to "Border" layout. • Click and drop a "ConfigResultTableModel" bean from AdventNetMSBeans.jar tab

of the Beans Palette outside the Draw Area. You can find the instance name of the dropped "ConfigResultTableModel" bean is "ConfigResultTableModel1".

• Switch to Component tab and edit the ConfigurationResultEventAction under the connections node. Remove the code in the configPerformed method and add the following code :

try { ConfigResultTableModel1.addConfigResult( arg0); } catch(java.lang.NullPointerException ex) { ex.printStackTrace(); }

• Drop a JTable bean from "SwingBeans.list" tab of Beans Palette in the

"Results_Panel" bean and change its instance name as "Results_Table". • Invoke the Property Form for the "Results_Table" bean and set the model property

with "ConfigResultTableModel1" and close the Property Form. 3. Ensure that the order of screen instance and panel beans in the "Details_TabbedPane" is as

in the above Design Time View screen shot. 4. Invoke the "Layout Properties" dialog for the "Details_TabbedPane" bean by right-clicking

it and selecting "Layout Properties" menu item.

5. Provide the "Title" text field value for "SystemConfig1" bean as "System Configuration" (refer the above figure).

Similarly, provide the "Title" text field value for the other beans in the "Details_TabbedPane" as given in the table below

Bean Title STP1 STP PortDetails1 PortParameters Results_Panel Results

AdventNet Inc. 133

Page 135: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Inserting Methods for Button Actions

1. Switch to Source View tab and scroll down to end of the screen's class. 2. Insert the following methods "checkUserOperations", "helpAction" and,

"screenConfiguration" before the closing braces ("}") for the screen's class. These methods are required for configuring button actions.

private void checkUserOperations() { try{ URL BE_Url = NmsClientUtil.applet.getCodeBase(); String BEHostName = "localhost"; BEHostName = BE_Url.getHost(); if(BEHostName.trim().equalsIgnoreCase("localhost")) try { BEHostName = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException unknownhostexception1) { System.err.println("unknown host : " + unknownhostexception1); } if(BE_Url != null && BEHostName != null) { String name = "//" + BEHostName + "/NmsAuthEngineAPI"; AuthorizationEngine authEngine = (AuthorizationEngine) Naming.lookup(name); if(authEngine == null) { } else { String userName = NmsClientUtil.getUserName(); userOperations = authEngine.getOperationsForUser(userName); } } }catch(Exception exp) { System.out.println("Exception while getting RMI handle to Authorization Engine " + exp.getMessage()); } } public void helpAction() { BrowserControl bc = new BrowserControl(); bc.displayURL(System.getProperty("user.dir")+File.separator+"tutorials"+ File.separator+"ems_tutorial"+File.separator+"help"+File.separator+ "ems_tutorial"+ File.separator+"implementation"+ File.separator+"configtutdoc.html"); } public void screenConfiguration() { try{ ConfigResultTableModel1.clearAllRows(); Configurator1.resetAll(); Configurator1.setTaskName("SwitchConfiguration_task"); Configurator1.addGroup("group1", SystemConfig1, null); if (userOperations.toString().indexOf("Ems") != -1) { if ( userOperations.contains("Ems Configure All") && (! userOperations.contains("Ems Configure None")))

AdventNet Inc. 134

Page 136: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

{ Configurator1.addGroup("group1", STP1, null); PortDetails1.saveTableValues(); Configurator1.addGroupInfoCaches( PortDetails1.getSavedTableValues()); } } else { Configurator1.addGroup("group1", STP1, null); PortDetails1.saveTableValues(); Configurator1.addGroupInfoCaches( PortDetails1.getSavedTableValues()); } Configurator1.doConfiguration(); Switch_Tree.setSelectionInterval((Switch_Tree.getRowCount())-1,(Switch_Tree.getRowCount())-1); } catch(java.lang.Exception ex) { ex.printStackTrace(); } } Setting Action for Buttons

For "configure" button

1. Right-click the "configure" button, select Interaction Wizard > action > actionPerformed to get a rubber band line. Bring the rubber band line into "configure" button itself to invoke the Interaction Wizard.

2. Ensure that the "Create New Connection class" option is selected in the first screen of the Interaction Wizard. click "Next" button.

3. Select the "Task based Configuration with Roll Back and Multiple Device Support " option as you need this option in this case.

4. Click "Next" button. Steps to be followed in Interaction Wizard

Specifying How to Apply the Configuration

The Configuration is performed by the Configurator Bean. The Configurator Bean does this task by task, each task containing one or more groups.

5. Select the Configurator Bean to be used for applying the Configuration. This is

applicable when there are some Configurator Beans already available in the Screen. Since you do not have a Configurator Bean till now, this Select Instance combo box is disabled. This means you need to instantiate a new one.

6. Specify the Instance Name in the New Instance Name text field (default is Configurator1).

Processing the Configuration Result

7. Ensure that the "Create Result Event Connection" is checked, since you need the

result of the Configuration in a dialog. The Result Event connection can be created with a name of your choice. This name can be specified in the text field corresponding to Connection Class Name. If you are not in need of the Result Processing Part, the Check Box can be unchecked. Click "Next" button.

AdventNet Inc. 135

Page 137: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Specifying the Device(s) to be Configured

This screen displays a list where you specify the Devices on which the Configuration need to be applied.

8. Click "Next" button.

Configuration Task Details

This screen asks for information on the configuration task like the Name, whether an option is needed to revert to the previous configuration on failure and if so based on which document that contains the configuration profile.

9. Ensure the name is "EditedValueChecker_task". If you require details on Roll Back

you follow the topic Rolling Back to previous Configuration. Click "Next" button.

Specifying the Group of Interest

This screen displays a group tree on the left, This Tree contains all the available groups in the Screen. Since you have defined only one group, this will be listed. The list on the right contains the different groups that are to be configured with the current operation. You can see that the group has already been added to the Selected Groups list.

10. Click "Next" button.

Generate the Code for Configuration with the Details Provided

This brings up the screen that has a list (on the left) that displays the components being used in the Screen and components for which references are needed can be added to the list on the right.

11. Click "Next" button.

In this screen, you can find the code is generated automatically within the actionPerformed method based on the information furnished through all the steps so far in Interaction Wizard. Remove the existing code and Insert the following code in this method

screenConfiguration();

12. Click "Finish" to close the Interaction Wizard. If you now go to the Component Tree

and click "Connections" you find two new connections created. This completes the construction of the application.

For "refresh" Button

1. Right-click the "refresh" button, select Interaction Wizard > action >

actionPerformed to get a rubber band line. Bring the rubber band line into "refresh" button itself to invoke the Interaction Wizard.

2. Ensure that the "Create New Connection class" option is selected in the first screen of the Interaction Wizard. click "Next" button.

3. Ensure the "General Component Interaction" is selected and Click "Next" button twice to go to the final screen of the Interaction Wizard.

4. Insert the following code in the actionPerformed method PortDetails1.PortParametersTable11.refresh(); SystemConfig1.refresh(); STP1.refresh();

5. Click "Finish" to close the Interaction Wizard.

AdventNet Inc. 136

Page 138: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

For "close" Button

1. Right-click the "close" button, select Interaction Wizard > action > actionPerformed to get a rubber band line. Bring the rubber band line into "close" button itself to invoke the Interaction Wizard.

2. Ensure that the "Create New Connection class" option is selected in the first screen of the Interaction Wizard. click "Next" button.

3. Ensure the "General Component Interaction" is selected and Click "Next" button twice to go to the final screen of the Interaction Wizard.

4. Insert the following code in the actionPerformed method setVisible(false);

5. Click "Finish" to close the Interaction Wizard.

For "help" Button

1. Right-click the "help" button, select Interaction Wizard-->action--

>actionPerformed to get a rubber band line. Bring the rubber band line into "help" button itself to invoke the Interaction Wizard.

2. Ensure that the "Create New Connection class" option is selected in the first screen of the Interaction Wizard. click "Next" button.

3. Ensure the "General Component Interaction" is selected and Click "Next" button twice to go to the final screen of the Interaction Wizard.

4. Insert the following code in the actionPerformed method helpAction();

5. Click "Finish" to close the Interaction Wizard.

This completes the building of Main Screen.

AdventNet Inc. 137

Page 139: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.8.2.4 Compiling and Packaging the Application The Packaging of applications built using ClientBuilder to NAR (NMS ARchive) is done using the Package Wizard. The Configuration project must be compiled first. The created NAR is imported into the Studio project of EMS Tutorial. Follow the steps given below to compile the project. Compiling the Project

1. Regenerate the Project using the menu command Project > Regenerate Project. 2. Compile the Project using the menu command Project > Compile Project. You will get the

message "Compilation succeeded for EMS_Configuration" in status bar. Packaging the Classes using Package Wizard

1. Invoke the Package Wizard for creating the Device Specific NAR using the menu command Tools > Package for Web NMS > Device Specific. For detailed explanation on using the Package Wizard follow the topic Integration with Web NMS.

2. Select the value "com.adventnet.nms.tutorials.ems.SwitchConfiguration" from the Classes list and click "Next" button to proceed to next screen.

3. Choose the required destination directory where the NAR has to be created using the browse button. Click "Next" button to proceed to next screen.

4. Provide the corresponding device type that of the device host such as "Windows NT", "Linux", or "Solaris" in the "Device Type" field. Click "Next" button to proceed to next screen.

5. Ensure the required device information are listed in the "DESTINATION DIRECTORY" and click "Next" button to proceed to final screen of the Package Wizard.

Note: For security features, include four classes from the package com.adventnet.security.authorization located in <Web NMS Home>/classes directory into in <Client Builder Home>/projects/EMS_Configuration/classes directory. The required classes are AuthorizationException.class, AuthorizationEngine.class, AuthorizationEngineImpl.class, and AuthorizationEngineImpl_Stub.class.

AdventNet Inc. 138

Page 140: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

6. Click Finish button to close the Package Wizard to get the confirmation dialog with the

message SwitchConfiguration.nar created successfully at <specified location>.

7. Import the NAR into the EMS Project of Studio, using the Import Wizard of Studio. 8. Deploy the NAR in Web NMS Client using the Deployment Wizard in Web NMS with the

required menu name and menu item

Note: The above project is also available in <Web NMS Home>/StudioTools/ClientBuilder/projects directory as EMS_Configuration that can be loaded for your reference.

AdventNet Inc. 139

Page 141: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.9 Re-branding In building your EMS, you may wish to customize the basic user interface functions. Web NMS supports such customization for creating new products in multiple ways. To illustrate how this can be done, you will make a few changes to the user interface to build an EMS that we will call as Acme EMS. These are only a subset of the many changes that can be made to the user interface for specific applications. Aim This section details on how to re-brand the application built to suit the customers requirements. Re-branding includes changing the name of the product its version, splash images, logo images etc. Re-branding can be achieved using the I18N Editor and Re-branding tool. For details on using i18N Editor Tool, refer to the Web NMS Studio Help documentation. For details on Rebranding the Project, refer to the Web NMS Studio Help documentation. Instructions Follow the steps given below to re-brand the EMS.

Step 1: Invoking the I18nEditor Select the node EMS_Tutorial in the Project tree. From the menubar, choose the menu Tools > I18nEditor Step 2: Selecting Entities to be Modified Select EnglishToNative.properties file from <Project-Home>/WebNMS/html directory. Right click on the nodes to be modified and then specify the new entry for it. The details of the change are explained below. Change the value of the following Property Keys <PROMINENT_KEY>AdventNet - Acme <PROMINENT_KEY>Web NMS - EMS <PROMINENT_KEY>Version x.x - 1.0 Step 3: Invoke the Rebranding tool from Tools menu Change the values for LOGO_URL, FRAME_ICON and LOGO_URL as specified in the table below. Re-branded Entities: Entity Name Values Logo Icon acme.png Frame Icon logo.png F(Sp)lash Image screen.png Progressbar Foreground Color 90-190-150 Progressbar Background Color 255-255-255 Web Logo logo.jpg

Logo URL www.adventnet.com

Result The AdventNet Web NMS is re-branded as Acme EMS. The final step towards creating EMS follows next - Packaging and Installation.

AdventNet Inc. 140

Page 142: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

5.10 Packaging the Project This topic explains about compiling and packaging the Studio project.

• • •

Compile the project Importing Client side classes as NAR Package the application

Compile the project

After building the project, save and compile it.

• Select File > Save • Select the Project > Compile menu from the Studio.

Importing Client NARs

Import the Chassis and Configuration Screen Client NARs into the Studio Project of this application. Package the application

After compiling the project, package the application into a NAR file. For details of Packaging Studio Applications of AdventNet Web NMS Studio, refer to the AdventNet Web NMS Studio documentation.

• Select the Project > Package menu from the Studio. Including Menu Files

While packaging the Project as a NAR file, you have to include the required menu files. The files that need to be included are listed below.

File Name Location objectmenu.xml switchmenu.xml trunkmenu.xml

Source Directory: <Web NMS Home>/StudioTools/Studio/projects/EMS_Tutorial/WebNMS/mapdata/menus Destination Directory: <Web NMS Home>/StudioTools/Studio/projects/EMS_User/WebNMS/mapdata/menus

cardmenu.xml portmenu.xml shelfmenu.xml slotmenu.xml switchmenu.xml trunkmenu.xml

Source Directory: <Web NMS Home>/StudioTools/Studio/projects/EMS_Tutorial/WebNMS/listmenus Destination Directory: <Web NMS Home>/StudioTools/Studio/projects/EMS_User/WebNMS/listmenus

Include the mentioned files in the Other Resources and then proceed with packaging the project. This will generate a NAR file called EMS_User1.0.nar. You can deploy this NAR directly into Web NMS to install the application.

AdventNet Inc. 141

Page 143: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

6. Fast Track Implementation This topic will guide you, if you want to try quick modifications in the available project and check the results. It will also guide you through shortcut to the tutorial, if you are unable to complete the Tutorial Project. Successful completion of Project

After the building of application is complete, compile the project and package it as a NAR file. If you are able to create the NAR successfully then skip this topic. Try your requirements quickly in the Project

If you want to try your requirements in the Studio project on your own efforts, then you can use the Studio project of this application which is bundled in AdventNet Web NMS Studio. The Studio project of the application comes bundled in AdventNet Web NMS Studio in the following URL:

<Web NMS Home>/StudioTools/Studio/projects/EMS_Tutorial.proj

Note: If you find difficulty in opening the Project, in the Project Properties check Web NMS Home in the General tab screen and Class Path of various JAR files in the Compiler tab screen. These will be having the values in which they were developed. Change both the parameters with respect to your Web NMS Installation.

AdventNet Inc. 142

Page 144: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

7. Deployment and Testing 7.1 Installation Notes

This application is bundled along with Web NMS 4. You can also download this tutorial from the AdventNet web site. Please use the following URL to download the tutorial:

http://download.adventnet.com/products/webnms/tutorials/ems_tutorial.zip If you are using the downloaded tutorial from the web site, then extract the tutorial under <Web NMS HOME> directory. Installing the Application To install the tutorial application,

• Stop the Web NMS Server if it is running (double-click Shutdown NMS Server icon from the Web NMS Launcher or invoke ShutDown.bat/sh from <Web NMS Home>bin directory

• Run DeploymentWizard.bat/.sh file under <Web NMS HOME>/bin directory. • Select the NarInstall/Uninstall tab. • Select the Install button in the screen. • Click the Browse button in the NAR INSTALLER pop-up screen. • Select the tutorials/ems_tutorial/EMS_Tutorial1.0.nar from the File Chooser pop-up screen

and click the Select button. • Click the OK button in the NAR INSTALLER pop-up screen. • On clicking OK button, NmsPwsNarInstaller screen will pop-up. • In that, select the Application Database (in which you want to run the tutorial) listed from the

combo box. If you select Oracle database, then you can configure the Driver details. • Click the Next button. • In this screen, click Install button. • This will install and show the status in the progress bar. See that the progress is 100%. • Click the Close button. • Now the installation is complete. Three entries will be listed in the Uninstall section of the

Deployment Tool. The entries are EMS_Tutorial1.0.nar, ChassisScreen and SwitchConfiguration.

• Click the Exit button to quit the Deployment Wizard. • Reinitialize Web NMS using reinitialize_nms.bat/.sh under <Web NMS Home>/bin directory.

Both, the data and configuration are reinitialized.

Caution: This tutorial will function only if Web NMS is reinitialized. Hence, after installing the tutorial, reinitialize Web NMS. Ensure you use separate Web NMS installation for tutorial application development and installation. Do not experiment on Web NMS deployed in real world.

When this tutorial application is installed, the existing files which require changes, from the installed Web NMS are backed up. However, when you un-install this tutorial application, the files modified will be restored from the backup.

AdventNet Inc. 143

Page 145: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Uninstalling the Application To uninstall the tutorial application,

• Run the DeploymentWizard.bat/.sh file under <Web NMS HOME>/bin directory. • Select the NarInstall/Uninstall tab. • In the Uninstall section, select the EMS_Tutorial1.0.nar entry • Click Uninstall button in the screen. • On clicking Uninstall button, NmsPwsNarUninstaller screen will pop-up. • In that, click Uninstall button. • This will uninstall and show the status in the progress bar. See that the progress is 100%. • Click Close button. All the three entries pertaining to the Nar will be removed. Now the

uninstallation is complete. • Click Exit button to quit the Deployment Wizard.

Note: To install the NAR created by you, select EMS_User1.0.nar

Modifying the Application If you want to modify the application and try out other features, you can edit the Studio project of this application bundled with this tutorial. To modify,

• Open the project's EMS_Tutorial.proj file from the <Web NMS HOME>/StudioTools/Studio/projects directory

• Make the changes (supported by the AdventNet Web NMS Studio) to the project as per your requirement.

• Save, compile, and package the project into NAR. • Un-install the existing installed NAR and install the new NAR generated with your changes.

Caution: Un-installing the original NAR is mandatory as only one Studio NAR is permitted to be deployed in AdventNet Web NMS.

For complete details of Working with AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation.

AdventNet Inc. 144

Page 146: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

7.2 Testing the Application After installing the tutorial application reinitialize and start the Web NMS server. This tutorial application treats the first five SNMP nodes that are discovered as switches and for each switch the corresponding shelves, slots, cards and ports are added so as to bring out a real time scenario. Ensure you have at least one IP node supporting SNMP on your network or on a remote network that you can add to the Web NMS. Once the server is up and running, start the Java client by executing the startApplicationCliet.bat/.sh file. General testing

4. Check whether switches map has been created and also see whether the first five switches are seen in the map with their interconnections.

1. The splash screen that comes up with the progress bar at the bottom will now show Acme Element Manager instead of the default splash screen.

2. Wherever the name AdventNet appears in the client, it will now be seen as Acme. 3. In the client, the Switches node will be selected by default. The ipnet and all other nodes

under maps will not appear in this tutorial application.

5. In the switch chassis view (i.e., the tree node name ending with _view), see whether all the components of the switch are seen. There should be empty cards in the alternate slots and in each active card there will be a trunk port or four access ports depending on the type of the card.

6. Try to update the status of the ports and see whether corresponding events are generated in the events node.

Testing Transaction control To test Transactions, use a database, which supports transactions like Oracle. Detailed instructions to set up the database can be found in the Installation Guide/ Installation and Setup Options/ Database Set Up page.

Open the project's EMS_Tutorial.proj file from the <Web NMS HOME>/tutorials/ems_tutorial directory, in the AdventNet Web NMS Studio. Modify the tutorial application with below given changes.

To test rollback insert the following code snippet

if (switch_count > 3 ) {

System.out.println(" Throwing Exception for " + trunk.getName()); throw new Exception();

}

anywhere between the following lines in SwitchDiscoveryFilter.java to throw exception after three nodes get discovered, so that addition of trunks to database is rolled back for switch 4 and 5.

api.addObject(trunk); api.updateObject(srcport,false,false); api.updateObject(destport,false,false);

• • •

• Compile the project and package into a NAR. Stop the Web NMS server, if running. Uninstall the tutorial application NAR. Install the tutorial application NAR generated with the above changes.

• Reinitialize Web NMS and start the Web NMS server again.

AdventNet Inc. 145

Page 147: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Once the server is up and running, start the Java client. Check for expected behaviour that is the trunks will not be present for switch 4 and 5 as they would be rolled back. The same can also be verified in the database. You can also use the HTML client for this application. Testing Security Administration Using the Security Administration screen, the users can be configured to belong to other groups and the effect can be seen in the Switch Configuration screen. Steps to be followed for unassigning an Operation to a user at runtime.

• Invoke the Security Administration screen from the tools menu of Web NMS client.

• Select the Permitted Operations for User tab.

• In the Assign Permissions screen, you will see Permissions tree hierarchy.

• Select the Users → root node from the Security tree.

• Click Set Permissions button.

• In the Ems Operations tree under the Operation Tree Root node, un-select the Ems Configure All operation and select the Ems Configure None.

AdventNet Inc. 146

Page 148: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

When the above operation is performed, the configuration UI appears with the Configure button disabled. i.e., not allowing the user to configure any of the switch parameters, but only viewing them. Testing Trap Handling In this application, we have tried to simulate a real time situation in which cards are removed or added physically from a Switch. Whenever a card is removed or added, the agent in the device sends a trap to the manager and notifies the problem. To simulate this condition, we will send separate SNMP V1 traps for adding and removing the cards.

Generating Traps

To Simulate the Add Card Condition To generate the trap execute the addCard.bat/.sh file under <Web NMS Home>/genTrap directory. Before sending the traps, edit the script to change the Agent address and the Slot number in which the card is to be added. To Simulate the Remove Card Condition To generate the trap execute the removeCard.bat/.sh file under <Web NMS Home>/genTrap directory. Before sending the traps, edit the script to change the Agent address and the Slot number from where the card is to be removed. Screen Shot 1 - Card removed The snap shot shows the card and all its ports has been removed (new blank card added) from slot4 after sending the removeCard trap.

AdventNet Inc. 147

Page 149: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Screen shot 2 - Card added The below snap shot shows the card and all its components have been added in Slot2 after sending the addCard trap.

AdventNet Inc. 148

Page 150: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

8. How does the application work? Interaction Diagram for EMS Tutorial

This section outlines the various tasks development of an EMS. The focus is towards examining and understanding the roles of the main Web NMS components and the control/data flows among them. Discovery

This diagram shows the interaction and message flow among Web NMS components while processing a newly discovered network element (device).

AdventNet Inc. 149

Page 151: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

The Discovery engine of Web NMS does the following operations

1. On first run, it reads and creates default map(s) listed in maps.conf file.

9. Map Server is registered as an observer of the Topology Module. The topology module notifies Map Server whenever a ManagedObject gets added for the newly discovered device.

2. It reads the discovery rules: e.g., Discover Local Network (at which Web NMS is attached), Enable SNMP Discovery, Enable ICMP Discovery, Inter-Discovery delay/gap (in Sec), Re-discovery Interval, List of Network, To Discover (including DHCP, IP address range), etc. From this, it identifies the Networks to be discovered. Active discovery is launched for the identified networks, as a parallel task. It then sweeps or enumerates each IP, for the networks identified. It also maintains a list of IP that are possibly active, obtained from seed.file and tl1seed.file entries, ARP table and SNMP/ICMP broadcast.

3. To confirm the existence of the IP or nodes, performs test viz., user-defined test and SNMP/TL1/ICMP ping process. When the whole address range is swept for the networks identified, the discovery engine schedules the rediscovery process.

4. It locates the user-defined discovery filter class from oidtype.data or discovery.filters file. The custom filter is searched in oidtype.data followed by discovery.filters. The device(sysOID)-specific filters are contained in the oidtype.data file, whereas general filters are specified in the discovery.filters file.

5. It then creates a ManagedObject (via TopoAPI) which models the discovered device. It invokes filterObject() method of the custom discovery filter for the discovered device type. General filters are invoked (in sequence as listed in discovery.filters) for every device that has been discovered.

6. Using these filters, the Managed Object properties can be modified, new ones can be added, and existing ones can be deleted before adding the Object to the database.

7. The discovery engine then adds the nodes (objects) into the topology database after carrying out the above operations. The custom discovery filter calls TopoAPI.addObject() method for Topology Module to add the ManagedObject into TopoDB.

8. If a user tester class has been specified in oidtype.data for this device type, Topology Module registers the tester with Polling Engine so that it (tester) will be invoked in poll interval (also defined in oidtype.data) for status poll.

10. Map Server locates the custom map filter for the device type from mapicon.data. General map filters from map.filters are invoked in sequence once the device-specific filter completes execution.

11. Map Server invokes filterMapSymbol() method of the map filter found at Step 10 and passes the ManagedObject.

12. The custom map filter creates map symbol(s) (and link(s) if necessary) for the discovered device. A new map can also be created by the filter.

13. Map Server receives the map symbol(s) (and possibly a new map) from the map filter and saves them into MapDB.

14. Map Server invokes the map renderer to display the symbols on the map panel of the Client.

AdventNet Inc. 150

Page 152: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

Topology Update

This diagram shows the interaction and message flow among Web NMS components when the topology database is updated for any changes in an existing ManagedObject. MO update/delete can be triggered from Client GUI (via Map menus), Trap/event filters and status polls (escalating severity), Policy Engine (deleting orphan objects), or configuration change (via Client).

1. At periodic intervals based on the configured Status Poll interval, Polling Engine invokes test() method of the registered custom poll class (see Step 8 in the Discovery Process above).

2. The default / user defined Tester class performs status checks on the target device and returns an appropriate Severity level (defined in severityinfo.conf).

3. Polling Engine invokes TopoAPI.updateStatus() method if the severity level returned by test() method is different from the current level of the managed object. Topology Module, in turn, updates the managed object in the TopoDB and notifies Map Server for map update (Step 9).

4. User sets configuration parameter(s) for a selected device from Client GUI. Client sends the set request (in XML format) to Config Server.

5. Config Server parses the XML message and performs SNMP SET for requested config parameter(s). If one or more parameters correspond to property(ies) of the managed object in TopoDB, Config Server invokes TopoAPI.updateStatus() method. Topology Module, in turn, updates the managed object in the TopoDB and notifies Map Server for map update (Step 9).

AdventNet Inc. 151

Page 153: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

6. For an incoming trap, Event Server searches (based on trapID) for the corresponding filter class in trap.filters and invokes applyTrapFilter() method for processing.

7. The trap filter calls TopoAPI.updateStatus() if ManagedObject’s status (i.e., severity) needs to be escalated or downgraded, updateObject() if one or more properties are to be changed, or deleteObject() if one or more ManagedObjects are to be deleted (due to removed devices). Topology Module, in turn, updates the managed object in the TopoDB and notifies Map Server for map update (Step 9).

8. Policy Engine invokes a custom Policy Class, if provided, to delete orphan object(s) based on its rule (such as special severity level).

9. After updating the database, Topology Module notifies Map Server. The notification includes the type of change such as deleted (MO removal), manage (MO managed property), status (MO severity), property (other MO properties).

10. Map Server locates the custom map filter for the given device type from mapIcon.data. General map filters from map.filters are invoked in sequence once the device-specific filter completes execution.

11. Map Server invokes update() method and passes the ManagedObject along with update type (“update”/”delete”).

12. The Map Filter walks through all map symbols associated with the ManagedObject and changes the properties of each map symbol (if required). It calls MapAPI.updateSymbol() for Map Server to update MapDB.

13. Map Server invokes renderer to update the map display on Client.

AdventNet Inc. 152

Page 154: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

9. Known Issues

• When this application is installed, it replaces some of the existing conf files with the new ones needed for this tutorial. If the user has made any changes in the already existing filters, then the changes will not take effect during the tutorial session. Though all the original conf files will be restored once the tutorial is uninstalled.

• The Manage/Unmanage option, if invoked for any ManagedObject in Network database panel

will not manage/ unmanage its children respectively.

AdventNet Inc. 153

Page 155: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

10. Trouble Shooting Tips

Problem Solution Switch are not laid out properly in the Switches map.

The custom layout properties may not have been set. Check the layout of the switches map from the properties.

The device is not discovered as Switch. Check if the EMS Tutorial NAR is installed.

Unable to configure the Switch. Getting message "There is no such variable name in the MIB" in the Logs Dialog.

Check if the SNMP Agent Simulator is running with the appropriate Configuration file.

Unable to configure the switch. Getting error message "Request Timed Out" in the Logs Dialog.

Check if the SNMP Agent Simulator is running.

In the "Switch Configuration", unable to configure Variables in Port Parameters Table.

Check if the SNMP Agent Simulator is running with the appropriate Configuration file. Ensure that the Enter key is pressed after entering values in the Port Parameters Table of Switch Configuration. Also ensure that the "Configure" button is pressed before the next polling as the polling is very fast.

AdventNet Inc. 154

Page 156: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

11. Glossary

SLOT

C.O./CO

This glossary list contains some of the definitions for the terms that are used in this tutorial. Click here to see the complete AdventNet Web NMS Glossary List.

SWITCH In networks, a device that filters and forwards packets between LAN segments. Switches operate at the data link layer (layer 2) of the OSI Reference Model and therefore support any packet protocol.

An opening in a switch where you can insert printed cards. CARD A printed circuit board that you can insert into a slot to give it added capabilities.

Access Port This port is the physical gateway between a customer's local loop and the frame relay network. Trunk Port An input on a PABX (Private Automatic Battery Exchange) or KSU (Key Service Unit) that is used to interface the system with C.O. (Central Office) lines. Trunk A telephone communication path or channel between two points, one usually being a Central Office. KSU A central control cabinet serving many multi-button key telephones. Contains equipment which enables the user to pick up and hold PABX or Central Office lines and provide flashing line, steady, busy and wink hold signals. Dial intercom service is also an option.

A main telephone office where switching equipment is housed and customer lines originate. Also contains trunk line connections to other Central Offices.

FAQ

The list of Frequently Asked Questions (FAQ) which serves as a guide to understand the AdventNet Web NMS. To see the Web NMS FAQ click the following link

Web NMS FAQ - These contains questions that will arise in the minds of a Web NMS user.

AdventNet Inc. 155

Page 157: New Table Of Contents - WebNMS · 2016. 1. 4. · EMS Tutorial 1.2 Introduction The purpose of this tutorial is to guide you through designing an EMS and provide working, illustrative

EMS Tutorial

12. Other tutorials AdventNet Web NMS is vast in its capability to serve its different class of users. It would be hard for anyone to understand all of its features at one time. We strongly recommend you to go through some of our other tutorials to get of feel of what could be done on our Web NMS. Building an EMS with CORBA as Southbound Interface

This tutorial explains how developer can build Element Management Systems, which support CORBA as the southbound interface. In this tutorial, we have used TR-005 and TR-035 standards specified by the ANSI T1M1 forum. It explains, how developer can implement the Working Text, WT-046 Version 3.0 as specified in the DSL forum.

CORBA Northbound Tutorial This CORBA Northbound Tutorial shows how easily AdventNet Web Network Management System (NMS) can be used for distributed NMS applications by providing CORBA northbound support to interact with other Northbound Operational Support Systems (OSS).

Managing a TL1 Device This tutorial guides the developer on how to manage a device using the TL1 Protocol. Various features in AdventNet Web NMS to manage a TL1 Device are explained. The design aspects and the usage of Web NMS tools to simplify the development of an EMS and the ease of managing a device using the TL1 Protocol are described here .

XML Southbound Tutorial This tutorial builds an EMS with the information got from an XML enabled device. From the responses received an EMS chassis is built and some other functions are included.

AdventNet Inc. 156