HP-UX File system snmp indexed query script

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

HP-UX File system snmp indexed query script

#1 Post by invaliduser » Mon Apr 26, 2004 11:24 am

Here is a Perl script I used in order to work around the funky indexes used by HP-UX for the file system tables.

Be sure to install SNMP_Session as well. http://www.switch.ch/misc/leinen/snmp/perl/

Comments, suggestions are most welcome

Brian

30/03/2005: New fields added to support reporting file systems in bytes and percentages.
Attachments
hpux_disk.xml
script query defintion installed into resource/script_queries

Updated: 30/03/2005
(2.66 KiB) Downloaded 1564 times
walk_hpux_disk.txt
Perl script rename to walk_hpux_disk.pl in your scripts directory

Updated: 30/03/2005
(3.74 KiB) Downloaded 2343 times
Last edited by invaliduser on Wed Mar 30, 2005 6:38 pm, edited 4 times in total.

Ingimar
Posts: 7
Joined: Mon Feb 21, 2005 8:53 am

#2 Post by Ingimar » Fri Feb 25, 2005 5:52 am

Hi there.

I just tried this and got the following error after selecting a filesystem that was found in the query:

Code: Select all

Notice: Undefined index: sgg_15 in /var/www/html/cacti/graphs_new.php on line 71

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/cacti/graphs_new.php:71) in /var/www/html/cacti/graphs_new.php on line 310
The Data Query found all disks but creating the graphs caused this error.

Looking at the list of graphs an empty graph has been created:

Code: Select all

Graph Title   Template Name   Size
              None            0x0
Cacti 0.8.6c
HP-UX B.11.00

I haven't looked into it further yet but if anyone has a fix, please post it. :-)

scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

#3 Post by scavenger67 » Fri Mar 25, 2005 12:59 pm

my script if return me nothing !

i've install perl but i don't know how to install SNMP_Session ( have a windows 2000 computer )
can u help me please ?

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#4 Post by invaliduser » Wed Mar 30, 2005 10:21 am

Ingimar wrote:Hi there.

I just tried this and got the following error after selecting a filesystem that was found in the query:

Code: Select all

Notice: Undefined index: sgg_15 in /var/www/html/cacti/graphs_new.php on line 71

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/cacti/graphs_new.php:71) in /var/www/html/cacti/graphs_new.php on line 310
The Data Query found all disks but creating the graphs caused this error.

Looking at the list of graphs an empty graph has been created:

Code: Select all

Graph Title   Template Name   Size
              None            0x0
Cacti 0.8.6c
HP-UX B.11.00

I haven't looked into it further yet but if anyone has a fix, please post it. :-)
If you haven't, you might want to try and create data templates for each field separately. I review my configuration and that is what I did.

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#5 Post by invaliduser » Wed Mar 30, 2005 10:22 am

scavenger67 wrote:my script if return me nothing !

i've install perl but i don't know how to install SNMP_Session ( have a windows 2000 computer )
can u help me please ?
I'm not sure. I did all my development under linux and have not tried to port to win2k.

Found this via Google:

"SNMP_Session package does not need to be compiled because it does not rely on an auxiliary DLL. After you download the archive, extract the *.pm files and install them in your site/lib subtree."

scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

#6 Post by scavenger67 » Wed Mar 30, 2005 1:36 pm

finally it works for me.. have some few problem with the graph and data template..
now i'm looking to have it into percentage instead of available block VS total block.

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#7 Post by invaliduser » Wed Mar 30, 2005 2:05 pm

Shouldn't be difficult just need to multiply number of blocks by fileSystemBsize to convert to bytes.

I'll probably put a new query field into the scripts to do that. Just need to set aside the time to do it.

Ingimar
Posts: 7
Joined: Mon Feb 21, 2005 8:53 am

#8 Post by Ingimar » Thu Mar 31, 2005 8:02 am

Dear invaliduser, could you export your graph templates for use with this script and query and post here?

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#9 Post by invaliduser » Thu Mar 31, 2005 9:30 am

Here is a graph template and the supporting data templates.
Attachments
hpux_disk_graph_template.xml
Graph Template
(10.57 KiB) Downloaded 1713 times
hpux_disk_free_data_template.xml
Disk Free Space Data Template
(4.49 KiB) Downloaded 1507 times
hpux_disk_total_data_template.xml
Disk Space Total Data Template
(4.49 KiB) Downloaded 1425 times
Last edited by invaliduser on Thu Mar 31, 2005 2:40 pm, edited 1 time in total.

scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

#10 Post by scavenger67 » Thu Mar 31, 2005 1:43 pm

Hi, thanks for all these template... but are you sure of the last one "Graph Template" found CISCO router" in it ?

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#11 Post by invaliduser » Thu Mar 31, 2005 2:39 pm

oops...will fix

Thanks for pointing it out.

The correct template is there now.

scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

#12 Post by scavenger67 » Fri Apr 01, 2005 5:57 am

wonderfull invaliduser,

if i can made a little comment.
If the graph template, you put "total" but your script only reports %used and %free.
So i mean that the 'total' you put on the graph template is more %used.

or by total you mean the total number of blocks ?

Thanks.

invaliduser
Posts: 11
Joined: Fri Apr 23, 2004 12:37 pm

#13 Post by invaliduser » Fri Apr 01, 2005 9:50 am

The graph I posted was reporting the disk space utilization in blocks.

If you want to modify it to report in percentages, then total would have a hard limit of 100.

I suggest removing the total field from the graph, turn off autoscale and make sure the max value for the graph is set at 100.

Does this give you what I think your looking for?

scavenger67
Posts: 49
Joined: Fri Mar 18, 2005 7:33 am
Location: France

#14 Post by scavenger67 » Fri Apr 01, 2005 1:39 pm

EXACTLY !
thanks

:D

Post Reply