Known Names (knownnames.cgi) September 23, 2010

Issue

OpenNMS stores name information from several sources in its database but only makes some of it available in the web interface. It’s useful to see all this information in one place for auditing and searching. It’s also important to check which name (Manually set by administrator, DNS, NetBIOS (SMB), SNMP, or lowest numbered IP) OpenNMS has chosen for a node’s label and have quick access to edit it

See How are node labels determined? for more information on how OpenNMS chooses node labels.

Solution

The knownnames.cgi script lists all names known to OpenNMS and indicates which have been used for node labels. Links are provided for quick access to change a node’s label. The page can be searched with a web browser’s “find on page” feature to determine if a particular name appears in OpenNMS’s database.

Synopsis

http://your-server/knownnames.cgi

Description

The cgi script produces a sorted table of nodes. Each row lists all the names known to OpenNMS for a node and indicates which name is being used as the node label. To the right is an “edit” link which links directly to the OpenNMS Change Node Label page. Before using this script, you might want to check for any DNS inconsistencies with the check-dns script.

Implementation

Prerequisites

  1. Setting up Scripts
  2. Setting up Custom Web Pages and Single Sign On

Install

Download the knownnames file and copy it to $NOCBASE/view-bin/knownnames.cgi.  This script is installed in the view-bin because it is also used in view based reports which will be posted later. Make sure to enable the execute bit with chmod as shown below. Then create a link $NOCBASE/http/knownnames.cgi which points to $NOCBASE/view-bin/knownnames.cgi.

/bin/bash
source /etc/noc.conf
cd $NOCBASE/view-bin/
wget http://opennms.dougbakewell.ca/downloads/view-bin/knownnames
mv knownnames knownnames.cgi
chmod a+x knownnames.cgi
cd $NOCBASE/http/
ln -s ../view-bin/knownnames.cgi knownnames.cgi

If you like, a link can be put on your monitoring web site home page:

<a href="/knownnames.cgi">Known Names</a>

Example

OpenNMS Known Names for All

OpenNMS LABEL OpenNMS LABEL SOURCE DNS NAMES NETBIOS NAME SNMP NAME
1

192.168.1.101

IP 192.168.1.101 -> ? ? ? edit
2

Server1

Manual 10.0.2.15 -> ? ? localhost.localdomain edit
3

Server2

SNMP 192.168.1.102 -> ? ? Server2 edit
4

Server3

NetBIOS 192.168.1.200 -> ? Server3 ? edit
5

Router1.dougbakewell.ca

DNS 192.168.1.1 -> Router1.dougbakewell.ca ? Router1-cisco edit

Sun Sep 19 11:20:30 PDT 2010

Share and Enjoy:
  • Print
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
Leave a Reply