« May 2004 | Main | August 2004 »

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 04:07 PM | Permalink | Comments (0)

July 22, 2004

OpenNMS .I.

Unfortunately I won't be telling my life story in this column :) So my sincere apologies to the technically declined!

Entries in this category will keep track if my onms progress. I've never dealt with any sort of nms system before so this is a good start to reflect and learn. Also, if the onms faq site didn't help much, you might get some answers here.

Anyway I had an interesting problem to fix today. While checking out the cpu utilization graph for a winxp workstation I was polling from, I noticed that it hadn't been updated for the past 12 hours! Now, how could that have happened when none of the xml config files were screwed around with? Sensibly, I did a rrdtool dump on the said winxp node and came up with NaN (not a number) values. Which meant 2 things:

1. The snmp agent on the winxp node somehow altered it's own mib. (Don't know how this is possible, I have yet to view the default set, if any. If anyone knows where I can find mibs in winxp do let me know. Previously installed snmp informant, just in case, but a snmpwalk on one if its oid (object id) didn't fetch anything!)

2. cpuPercentBusy oid was wrongly specified in the datacollection.xml file. (Very unlikely, since polling did graph results after the last alteration)

With these two possibilities in mind, one could tell that not a single value was polled because of an unknown or a non integer value from the cpuPercentBusy oid, hence the NaN values and the empty graph!

So, how was this fixed? With the knowledge that an invalid oid could as well have been the cause, I compared two snmpwalk dumps on the said oid which I did the day before, and a newer one this morning. Which resulted in this:

old dump
HOST-RESOURCES-MIB::hrProcessorLoad.1 = INTEGER: 99

new dump
HOST-RESOURCES-MIB::hrProcessorLoad.2 = INTEGER: 99

How was it possible that the instance changed from 1 to 2 is something i'm trying to figure out. AFAIK the snmp agent on winxp has static mib values, which shouldn't contribute to this problem.

So, a quick change of the instance value from "1" to "2" in the datacollection-config.xml file fixed it:

mibObj oid=".1.3.6.1.2.1.25.3.3.1.2" instance="2" alias="cpuPercentBusy" type="integer"

Restart and wallah, no more NaN!

Posted by kahjin at 06:33 PM | Permalink | Comments (0)

July 18, 2004

Kendo In Malaysia

I just had to do this. Comments from my kendo camp entry are piling up with enquiries, so being that nice bloke who never answers here's a little faq for some of you 'last samurai' inspired zealots :)

+++ ++ +

Malaysia Kendo Association

Location:

Japan Club of Kuala Lumpur, No 2, Jalan 1/86, Off Jalan Taman Seputeh, 58000, KL.

Training Schedule:

Wednesday - 1900hrs > 2100hrs (juniors and seniors)
Saturday - 1600hrs > 1800hrs (juniors) | 1800hrs > 2000hrs (seniors)

Intakes:

Every 3 months, next intake > October, 2004

Attire:

Track pants and t-shirt. Practice swords (shinai) will be provided for the first few classes, after which students will be advised to purchase one for their personal use. A shinai would roughly cost anywhere between RM90 to RM120, depending on quality.

Dojo Etiquettes:

A good, basic list can be found here.

+ ++ +++

Hope this helps!

Posted by kahjin at 01:24 AM | Permalink | Comments (17)

July 08, 2004

Parting Ways

Had my last day in the office. Nostalgia's kicking in. I mean this is where I was given the chance to learn my trade. First jobs are like first loves - you either have rosy memories about it, or it's just something that you want to forget. Fortunately mine is not the latter :)

During my time there I was able to work with some really wonderful people. Might not have always been in the same wavelength at times, but as far as sharing the knowledge we have is concerned, it was an endless exchange of information!

My clients... lol what an experience they were! Had some psychotic ones to deal with, but thankfully patience got the better of me. All I know is that I've learned a thing or two about charisma when it comes to dealing with such parties.

Man... i'm gonna miss my cubicle!

Here's to the past, and future!

Posted by kahjin at 12:29 AM | Permalink | Comments (4)

Copyright © 2002-2009 | inzense.com | All Rights Reserved