Problem Creating SNMP Indexed Query for HP-UX Disks
Moderators: Developers, Moderators
-
- Posts: 8
- Joined: Wed Jun 18, 2003 1:07 pm
Problem Creating SNMP Indexed Query for HP-UX Disks
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>
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>
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
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
-
- Posts: 1
- Joined: Fri Oct 15, 2004 5:51 am
- Location: Germany
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
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
Who is online
Users browsing this forum: No registered users and 4 guests