Back System Monitoring with Perl Table Of Contents Next

Example Monitor: NFS

From Jim Trocki's (trockij@transmeta.com) presentation on mon:

        #!/usr/bin/perl
        my @failed;
        my $detail;
        foreach my $item (@ARGV) {
            my $output = `showmount -e $item 2>&1`;
            if ($?) {
                push @failed, $item;
                $detail .= "$item failed:\n$output\n";
            }
            else {
                $detail .= "$item ok:\n$output\n";
            }
        }
        print join (" ", @failed), "\n";
        print $detail;
        @failed == 0 ? exit 0 : exit 1;


Back System Monitoring with Perl Table Of Contents Next