« OpenNMS .I. | Main | The Cubicle »
July 30, 2004
OpenNMS .II.
Packaging Thresholds
Khoo Kah Jin
v1.0, July 2004
Abstract:
This walkthrough describes threshold maintenance across a range of nodes with various mapped drives or storage allocation units. For this example, a threshold is assigned to trigger whenever disk usage for a particular logical drive and node exceeds its intended cap.
1. Depending on the logical drive you'd like to fix a threshold upon, specify an OID with a relevant alias in datacollection-config.xml. Prior to this, a snmpwalk must be performed on the node in mind to validate their respective values, e.g.
# snmpwalk -c public -v 2c 192.168.10.33 |grep "hrStorage*"
HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageRemovableDisk
HOST-RESOURCES-MIB::hrStorageType.2 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageCompactDisc
HOST-RESOURCES-MIB::hrStorageType.4 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.5 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.6 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.7 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.8 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: A:\
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: C:\ Label: Serial Number 58cfaf67
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: D:\
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: E:\ Label:4096 Serial Number 64889427
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: F:\ Label:2048 Serial Number a079525e
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: G:\ Label:1024 Serial Number 986bffb0
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: H:\ Label:512 Serial Number 3414ec32
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Virtual Memory
HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 0 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 0 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.5 = INTEGER: 2048 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.6 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.7 = INTEGER: 512 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.8 = INTEGER: 65536 Bytes
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 1281175
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 512063
HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 510047
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 514048
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 3068351
HOST-RESOURCES-MIB::hrStorageSize.8 = INTEGER: 8996
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 746309
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 3222
HOST-RESOURCES-MIB::hrStorageUsed.5 = INTEGER: 3863
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 5177
HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 21180
HOST-RESOURCES-MIB::hrStorageUsed.8 = INTEGER: 0
For this instance, we’ll monitor the disk usage from C Drive. We can tell that at least 3GB from the 5GB has been used from the said drive. Now that we have the figures in hand, let’s set a 3.5GB threshold on C.
2. The first thing we need to do is to make sure that ONMS uniquely identifies this OID when the threshold kicks in. We’ll start with the datacollection-config.xml file.
<group name = "windows-host" ifType = "ignore">
<mibObj oid=".1.3.6.1.2.1.25.2.3.1.6" instance="2" alias="usedDriveC35" type="integer" />
</group>
Breaking down a couple of variables from above:
• mibObj oid=".1.3.6.1.2.1.25.2.3.1.6" – Refers to the object-type hrStorageUsed.
• alias="usedDriveC35" – A very generic term was used for this example.
In some cases, hrStorageDescr.2 may not necessarily relate to Drive C. This is where instances come in. They must be referenced accordingly.
Next, we have the thresholds.xml file to configure. Start off by adding a new group for that threshold.
<group name="cused35"
rrdRepository = "/var/opennms/rrd/snmp/">
<threshold type="high" ds-name="usedDriveC35" ds-type="node" value="860000" rearm="733070" trigger="1"/>
</group>
A little explanation:
• group name="cused35" – I only intend to monitor usage on drive C with a 3.5GB threshold. So if you’re planning to have more than 1 threshold on a single group, rename accordingly to ease your preference.
• ds-name="usedDriveC35" – Make sure to match your data source with the alias previously stated in the datacollection configuration.
Do note that, depending on the allocation unit of a logical drive, HrStorage values will differ from one node to another. Therefore you must prescribe a value that reflects on the appropriate allocation unit.
3. Now it’s time to include our packages in the threshd-configuration.xml file.
<package name="cused_35">
<filter>IPADDR IPLIKE *.*.*.*</filter>
<specific>192.168.10.33</specific>
<service name="SNMP" interval="150000" user-defined="false" status="on">
<parameter key="thresholding-group" value="cused35"/>
</service>
</package>
• package name="cused_35" – Once again, name this according to your preference.
• <specific>192.168.10.33</specific> - This will be the node that we’ll bind the threshold into.
• value="cused35" – The group “cused35” is added into this package.
As you could probably tell by now, each node would require its very own package. If you wish to include more thresholds on a single node, just add a service tag with the relevant value (group name).
And that’s it! Save your changes and restart ONMS.
Posted by kahjin at July 30, 2004 04:07 PM
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)