Outils pour utilisateurs

Outils du site


user:pascal_cabaud:blog:munin_et_sondes_materielles_sur_solaris_10

Munin et sondes matérielles sur Solaris 10

La sortie de prtdiag(1m) a changé entre Solaris 9 et Solaris 10 ; par contre, prtpicl(1m) donne toujours les valeurs des sondes matérielles. Voici comment les récupérer :

#!/usr/pkg/bin/perl
#
if ( $ARGV[0] =~ m/^config/ ) {
        print "graph_title FAN Speed\n";
        #print "graph_args --base 100 -l 0\n";
        print "graph_category sensors\n";
        print "f0.label F0\n";
        print "f1.label F1\n";
        print "f2.label F2\n";
        print "f3.label F3\n";
        print "f0.warning 15000\n";
        print "f1.warning 15000\n";
        print "f2.warning 15000\n";
        print "f3.warning 15000\n";
        print "mb_p0_f0.label MB/P0/F0\n";
        print "mb_p0_f1.label MB/P0/F1\n";
        print "mb_p1_f0.label MB/P1/F0\n";
        print "mb_p1_f1.label MB/P1/F1\n";
        print "mb_p0_f0.warning 17000\n";
        print "mb_p0_f1.warning 17000\n";
        print "mb_p1_f0.warning 17000\n";
        print "mb_p1_f1.warning 17000\n";
        exit 0;
}
my $var;
open (PRTPICL, "/usr/sbin/prtpicl -v -c fan|");
while (<PRTPICL>) {
        chomp;
        if (m/^\s+(\w.+)\s/) {
                $var = $1;
                $var =~ s/_rs\s\(.*//g;
        } elsif (m/:Speed\s+0x.+/) {
                (undef, undef, my $value) = split /\s+/;
                print $var . ".value " . hex($value) . "\n";
        }
}
close PRTPICL;

et pour la température :

#!/usr/pkg/bin/perl
#
if ( "$ARGV[0]" =~ m/^config/ ) {
        print "graph_title Internal Temperatures\n";
        print "graph_category sensors\n";
 
        print "mb_p0.label 1st CPU\n";
        print "mb_p0.warning 55\n";
        print "mb_p0.warning 60\n";
        print "mb_p1.label 2nd CPU\n";
        print "mb_p1.warning 55\n";
        print "mb_p1.warning 60\n";
        print "mb.label Mother Board\n";
        print "mb.warning 28\n";
        print "mb.critical 35\n";
        exit 0;
}
my $var;
open (PRTPICL, "/usr/sbin/prtpicl -v -c temperature-sensor |");
while (<PRTPICL>) {
        chomp;
        if (m/^\s+(\w.+)\s/) {
                $var = $1;
                $var =~ s/_t_.*//g;
        } elsif (m/:Temperature.*/) {
                (undef, undef, my $value) = split /\s+/;
                print $var . ".value $value\n";
        }
}
close PRTPICL;

Il faut adapter les valeurs de warning à la machine ; ici, elles sont adaptées pour une Fire v210.

user/pascal_cabaud/blog/munin_et_sondes_materielles_sur_solaris_10.txt · Dernière modification: 2009/08/03 08:38 par Pascal Cabaud