beanfield wrote:
> This is becoming increasingly frustrating.  We can't effectively monitor our 
> NFS servers as both methods appear broken (one because of net-snmp and the 
> other because of a bug in zenplugins).


I feel your pain, most of the large mounts I need to monitor are on Solaris.
I'm still working on this and think I'm close to getting things to work.
Heres what I have so far:
I put the following script in /etc/sma/snmp (/etc/snmp for linux boxen)



Code:
#!/usr/bin/perl
use strict;
my $option=$ARGV[0];
my $mount;
my $total;
my $units;
my $used;
my $free;


my $line;

my (@cmd)=`df -g`;
#/export            (export            ):       131072 block size           512 
frag size
#72551485440 total blocks 72551485072 free blocks 72551485072 available       
72551485077 total files
#72551485072 free files     47513602 filesys id
#     zfs fstype       0x00000004 flag             255 filename length
my $n=0;
my @lines;
while($cmd[$n]){
        #my $count;
        $line= "$cmd[$n]"."$cmd[$n+1]"."$cmd[$n+2]"."$cmd[$n+3]";
        #$line=~s/\n//g;
        #$line=~s/\s+/  /g;
        $line=~s/\n//g;
        $line=~s/^\s+//g;
        $n+=5;
        push (@lines,"$line");
}

foreach $line(@lines){
#        if ($line=~/\w+\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.*?$)/){
        if ($line=~/^(.*?)\s+\(.*\):\s+.*?\s+(\d+).*?(\d+).*?(\d+).*$/){
                $mount=$1;
                $units=$2;
                $total=$3;
                $free=$4;
                $used=$total-$free;
                unless ($mount =~/fd/){
                        if($option eq 'mount'){
                                print "$mount\n";
                        }elsif($option eq 'units'){
                                print "$units\n";
                        }elsif($option eq 'used'){
                                print "$used\n";
                        }elsif($option eq 'free'){
                                print "$free\n";
                        }elsif($option eq 'total'){
                                print "$total\n";
                        }else{
                                print "$mount $units $total $used\n";
                        }
                }
        }
}
exit;




then I modify my snmpd.conf by adding the following lines:


Code:
exec .1.3.6.1.4.1.2021.82 zfs_stats.pl /etc/sma/snmp/zfs_stats.pl mount
exec .1.3.6.1.4.1.2021.83 zfs_stats.pl /etc/sma/snmp/zfs_stats.pl units
exec .1.3.6.1.4.1.2021.84 zfs_stats.pl /etc/sma/snmp/zfs_stats.pl total
exec .1.3.6.1.4.1.2021.85 zfs_stats.pl /etc/sma/snmp/zfs_stats.pl used




a snmpwalk now looks like this:

Code:
.1.3.6.1.4.1.2021.82.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.82.2.1 = STRING: "zfs_stats.pl"
.1.3.6.1.4.1.2021.82.3.1 = STRING: "/etc/sma/snmp/zfs_stats.pl mount"
.1.3.6.1.4.1.2021.82.100.1 = INTEGER: 0
.1.3.6.1.4.1.2021.82.101.1 = STRING: "/"
.1.3.6.1.4.1.2021.82.101.2 = STRING: "/devices"
.1.3.6.1.4.1.2021.82.101.3 = STRING: "/system/contract"
.1.3.6.1.4.1.2021.82.101.4 = STRING: "/proc"
.1.3.6.1.4.1.2021.82.101.5 = STRING: "/etc/mnttab"
.1.3.6.1.4.1.2021.82.101.6 = STRING: "/etc/svc/volatile"
.1.3.6.1.4.1.2021.82.101.7 = STRING: "/system/object"
.1.3.6.1.4.1.2021.82.101.8 = STRING: "/lib/libc.so.1"
.1.3.6.1.4.1.2021.82.101.9 = STRING: "/var"
.1.3.6.1.4.1.2021.82.101.10 = STRING: "/tmp"
.1.3.6.1.4.1.2021.82.101.11 = STRING: "/var/run"
.1.3.6.1.4.1.2021.82.101.12 = STRING: "/export"
.1.3.6.1.4.1.2021.82.101.13 = STRING: "/export/junk"
.1.3.6.1.4.1.2021.82.102.1 = INTEGER: 0
.1.3.6.1.4.1.2021.83.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.83.2.1 = STRING: "zfs_stats.pl"
.1.3.6.1.4.1.2021.83.3.1 = STRING: "/etc/sma/snmp/zfs_stats.pl units"
.1.3.6.1.4.1.2021.83.100.1 = INTEGER: 0
.1.3.6.1.4.1.2021.83.101.1 = STRING: "1024"
.1.3.6.1.4.1.2021.83.101.2 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.3 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.4 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.5 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.6 = STRING: "4096"
.1.3.6.1.4.1.2021.83.101.7 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.8 = STRING: "1024"
.1.3.6.1.4.1.2021.83.101.9 = STRING: "1024"
.1.3.6.1.4.1.2021.83.101.10 = STRING: "4096"
.1.3.6.1.4.1.2021.83.101.11 = STRING: "4096"
.1.3.6.1.4.1.2021.83.101.12 = STRING: "512"
.1.3.6.1.4.1.2021.83.101.13 = STRING: "512"
.1.3.6.1.4.1.2021.83.102.1 = INTEGER: 0
.1.3.6.1.4.1.2021.84.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.84.2.1 = STRING: "zfs_stats.pl"
.1.3.6.1.4.1.2021.84.3.1 = STRING: "/etc/sma/snmp/zfs_stats.pl total"
.1.3.6.1.4.1.2021.84.100.1 = INTEGER: 0
.1.3.6.1.4.1.2021.84.101.1 = STRING: "22212980"
.1.3.6.1.4.1.2021.84.101.2 = STRING: "0"
.1.3.6.1.4.1.2021.84.101.3 = STRING: "0"
.1.3.6.1.4.1.2021.84.101.4 = STRING: "0"
.1.3.6.1.4.1.2021.84.101.5 = STRING: "0"
.1.3.6.1.4.1.2021.84.101.6 = STRING: "57865232"
.1.3.6.1.4.1.2021.84.101.7 = STRING: "0"
.1.3.6.1.4.1.2021.84.101.8 = STRING: "22212980"
.1.3.6.1.4.1.2021.84.101.9 = STRING: "12118266"
.1.3.6.1.4.1.2021.84.101.10 = STRING: "57863624"
.1.3.6.1.4.1.2021.84.101.11 = STRING: "57863656"
.1.3.6.1.4.1.2021.84.101.12 = STRING: "72551485440"
.1.3.6.1.4.1.2021.84.101.13 = STRING: "72551485440"
.1.3.6.1.4.1.2021.84.102.1 = INTEGER: 0
.1.3.6.1.4.1.2021.85.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.85.2.1 = STRING: "zfs_stats.pl"
.1.3.6.1.4.1.2021.85.3.1 = STRING: "/etc/sma/snmp/zfs_stats.pl used"
.1.3.6.1.4.1.2021.85.100.1 = INTEGER: 0
.1.3.6.1.4.1.2021.85.101.1 = STRING: "6607166"
.1.3.6.1.4.1.2021.85.101.2 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.3 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.4 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.5 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.6 = STRING: "1608"
.1.3.6.1.4.1.2021.85.101.7 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.8 = STRING: "6607166"
.1.3.6.1.4.1.2021.85.101.9 = STRING: "136258"
.1.3.6.1.4.1.2021.85.101.10 = STRING: "0"
.1.3.6.1.4.1.2021.85.101.11 = STRING: "32"
.1.3.6.1.4.1.2021.85.101.12 = STRING: "368"
.1.3.6.1.4.1.2021.85.101.13 = STRING: "368"




now I just need to rewrite the zenoss.snmp.HRStorage collector to use the new 
MIB space and add that to its own class. I'm new to python so it may take some 
time (procrastination [Rolling Eyes] )




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=27254#27254

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to