Problem Creating SNMP Indexed Query for HP-UX Disks

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
jasonmartens
Posts: 8
Joined: Wed Jun 18, 2003 1:07 pm

Problem Creating SNMP Indexed Query for HP-UX Disks

Post by jasonmartens »

I am trying to create a new data query that lists the mounted volumes on a hp-ux server. Unfortunately, all of the other queries use the wrong OIDs for HP-UX, so I started creating my own. The OIDs I have to work with look like this:

fileSystemEntry
fileSystemID1
fileSystemID2
fileSystemName
fileSystemBlock
etc....

The problem I am having is it seems that in HP's infinite wisdom, they used two different OIDs to define each partition. fileSystemID1 has values that look like 1073741825, 1073741827 etc. and the fileSystemID2 has values like 0, 5, 5, 5, etc. the other OIDs like fileSystemName combine these two values. So the OID for fileSystemName would look like:
.1.3.6.1.4.1.11.2.3.1.2.2.1.fileSystemName.1073741825.0 <- for first partition
.1.3.6.1.4.1.11.2.3.1.2.2.1.fileSystemName.1073741827.5 <- for second partion
etc...

I THINK that the problem is that they are using two seperate OIDs for the index value. When I run the query in cacti, it always comes back with the first partition and the last partition, but none in-between.

The XML file I'm using is included below.

Thanks for any help!!!

<interface>
<name>Get HP-UX Partition Information</name>
<oid_index>.1.3.6.1.4.1.11.2.3.1.2.2.1.1</oid_index>

<fields>
<fileSystemID1>
<name>File System ID 1</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.1</oid>
</fileSystemID1>
<fileSystemID2>
<name>File System ID 2</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.2</oid>
</fileSystemID2>
<fileSystemName>
<name>File System Name</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.3</oid>
</fileSystemName>
<fileSystemBsize>
<name>File System Block Size</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.7</oid>
</fileSystemBsize>
<fileSystemDir>
<name>File System Mount Directory</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.10</oid>
</fileSystemDir>

<fileSystemBlock>
<name>File System Blocks</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.4</oid>
</fileSystemBlock>
<fileSystemBfree>
<name>File System Blocks Free</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.5</oid>
</fileSystemBfree>
<fileSystemBavail>
<name>File System Blocks Available</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.11.2.3.1.2.2.1.6</oid>
</fileSystemBavail>
</fields>
</interface>
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I would love to play with this some more, do you have any "test hosts" than can be queried via SNMP? If you don't want to post such a thing to this board, feel free to e-mail me.

-Ian
Guest

Post by Guest »

I tried working with this script and obviously have something messed up somewhere because I only see the first and last filesystems. Any suggestions?
Elmar
Posts: 29
Joined: Mon May 19, 2003 4:25 am
Location: Netherlands

Post by Elmar »

Hi all!
I would like to test this down here. The problem I have is how to create the data query. Can you help me out?
I've created the xml-file, but what are all the extra settings (data input method) and needed scripts or graph settings?

Elmar
rdike

Post by rdike »

Based on the results of getting the first and last filesystem, nothing more, I would have to say that the querry is where the problem is. The standard query for indexed SNMP wont work because it's looking for a single index field???
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Ian, can you remove sticky flag from this thread? I don't think it is so important for the rest of cacti users to be listed on top all the time.

- Piotr
SenSor
Posts: 2
Joined: Thu Oct 14, 2004 3:41 am
Location: The Netherlands
Contact:

Post by SenSor »

Hi,

I'm using Cacti for a couple of weeks now, and I ran into the same issue as the topic starter.
I would like to monitor my HPUX filesystems through SNMP, but it seems that HP is using two ID's which causes to display only the first and the last entry of the index.

Is there any news on how to solve this?
Thanks!

Cheers,

Dennis
DocHolydayIII
Posts: 1
Joined: Fri Oct 15, 2004 5:51 am
Location: Germany

Post by DocHolydayIII »

I haven`t got it to work for me, too.

If you collect data from the disks over snmp from a hp-ux system you get also the problem that the blocksize from each lvol can be differant. So the snmp value will show you free blocks or blocksize and not free, total or used bytes.

I solved this problem with a Script/Command "Data Input Method" with remsh.

I changed the query_unix_partitions.pl a little bit a named it remote_unix_partitions.pl

here it is

#!/usr/local/bin/perl
$host = $ARGV[0];
$volume = $ARGV[1];

open(DF, "remsh $host /usr//bin/bdf -l $volume|");
while (<DF>) {
if (/^(\/\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%\s+(\/\S*)$/) {
my %output = (
device => $1,
mount => $6,
total => $2,
used => $3,
available => $4,
percent => $5
);
print "vol_free:$output{available} vol_used:$output{used}";
}
}
close(DF);

Save this script in your <cacti path>/scripts directory

I have attached a xml file wich you have to import in your cacti0.8.6.b.
This will create your "Data Input Method" and your "Data Template" what you need for the data collection.
Check if you have named the perl script as it was named in the "Data Input Method".

Now you must create a "Data Source"
Console-> Data Sources --> Add
Selected Data Template: HP-UX Hard Drive Space (was created trough the xml import)
Host: Choose from the list
Save it!!
Fill in the custom data:
Hostname: server1
Logical_Volume: /dev/vg00/lvol1
Save it!!

Last step create a graph under
Console->Graph Management --> Add
Selected Graph Template> Unix - Available Disk Space
Host: server1
Save it !!
Title: server1 - /dev/vg00/lvol1
Available Disk Space Data Source: Choose from the list!
Used Disk Space Data Source: Choose from the list!

That's it.

But perhaps anyone has an idea how this can be made "Script Data Indexed" ????

Doc
Attachments
cacti_data_template_hpux_hard_drive_space.xml
XML File which must be imported to cacti. These create the Data Input Method and the Data Template.
(4.93 KiB) Downloaded 325 times
SenSor
Posts: 2
Joined: Thu Oct 14, 2004 3:41 am
Location: The Netherlands
Contact:

Post by SenSor »

Hi Doc!,

Thanks for your reply...
I'll give it try somewhere next week.

Cheers,

Dennis
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests