Custom categories
From OpenNMS
The rules uses in categories and filter rules are usually along the lines of this:
<rule>IPADDR IPLIKE *.*.*.*</rule>
They are actually quite flexible, and can be built on almost anything in the database. However, it would be nice to easily place a particular device into a category for display on the main page, notifications, etc..
There are four categories:
- Display Category (database field displayCategory)
- This is to be used for grouping devices into a particular category.
- Poller Category (database field pollerCategory)
- This is to be used to define devices in a particular poller package.
- Notification Category (database field notifyCategory)
- This could be something like "serverAdmin" or "networkAdmin" to be used for directing notifications.
- Threshold Category (database field thresholdCategory)
- This is to be used to define devices in a particular thresholding package.
- v1.3.x CategoryName Category (database field categoryname)
- This corresponds to nodes added to categories in the admin console.
Note that there is no "hard coded" meaning to these categories, you could use "poller" for "threshold" etc.. They are just labeled for convenience.
How would you use them? Well, you would need to modify the <rule> tag in the configuration files. Suppose you had two types of polling packages, like "Gold" and "Silver". You would then have a filter like the following for that package in the categories.xml file:
<rule><![CDATA[ipaddr != '0.0.0.0' & displayCategory == "Gold" ]]></rule>
By just adding the name "Gold" or "Silver" to the proper category on the asset screen you can place a particular device into that poller package.
Note that once you have sorted all of your devices, you will need to restart OpenNMS for the poller to reload the proper configuration.
If you want to change the "Percentage change over past 24 hours" table on the Home page you will also want to edit viewsdisplay.xml. This file is in the same directory as categories.xml. You will want to add a new category to the WebConsoleView like:
<category><![CDATA[Gold]]></category>
Any time you change this file you will need to restart opennms.









New Pages