HP-UX and Netsaint_statd

Cooley, David DCooley at nuvox.com
Fri Jun 4 17:40:30 CEST 2004


Hi All,
Looking for a bit of direction pointing...
Not very familiar with PERL, and we are now using the netsaint_statd for
Nagios monitoring, as it solved our problem with some machines not wanting
to run the NRPE daemon...
However, we are having a little issue with HP-UX and disk space
monitoring...
Here is a snippet of our bdf -l output:

Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3     204800   54976  140468   28% /
/dev/vg00/lvol1      83733   30841   44518   41% /stand
/dev/vg00/lvol8    1228800 1002685  212144   83% /var
/dev/vg00/lvol7    1228800  561770  625379   47% /usr
/dev/vgdata02/lvol07
                   2048000 1144064  847501   57% /u15
/dev/vgdata02/lvol06
                   4096000 3074152  957988   76% /u14
/dev/vgdata02/lvol05
                   10240000 8400295 1724729   83% /u13

As you can see, all is well until we reach the /dev/vgdata02/lvol07
filesystem...
Then, due to the length of the Filesystem name, bdf supplies the disk space
info on the next line down... However, the netsaint_statd see's nothing past
the Filesystem and decides there is no data, and supplies the first
filesystem on the machine as output...
Any assistanmce appreciated!

Here is the PERL code used to retrieve the data:

sub disk
        {
        my $arg = shift;
        my ($disk, $avail, $capper, $mountpt);

        open(DFOUTPUT,"$commandlist{$os}{dfcommand} |") || die;
        $_ = <DFOUTPUT>;
        DFCHECK: while($_ = <DFOUTPUT>)
                {
                if
(/^([\w\/\:\.\-\=]*)\s*\d*\s*\d*\s*(\d*)\s*(\d*)\%\s*([\w\/\-]*)/)
                        {
                        $disk = $1;
                        $avail = $2;
                        $capper = $3;
                        $mountpt = $4;
                        last DFCHECK if ($disk =~ /$arg/);
                        }
                }
        if ($disk && $mountpt)
                {
                $capper = 100 - $capper;
                print Client "$disk $avail $capper $mountpt ";
                }
        else
                {
                print Client "not found";
                }
        ($disk,$avail,$capper,$mountpt) = undef;
        close(DFOUTPUT);
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040604/da1abb50/attachment.html>


More information about the Users mailing list