Added munin plugins for OpenBSD.
This commit is contained in:
parent
1d260a4997
commit
87afaeb059
11 changed files with 885 additions and 0 deletions
58
munin/files/plugins/irqstats
Executable file
58
munin/files/plugins/irqstats
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Plugin to monitor individual interrupts
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.7.2.1 2005/02/24 17:33:22 jimmyo
|
||||
# linux/irqstats should no longer fail on some systems (Deb#296452).
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
use strict;
|
||||
|
||||
if (defined $ARGV[0] && $ARGV[0] eq 'autoconf') {
|
||||
if(-e '/usr/bin/vmstat -zi') {
|
||||
print "yes\n";
|
||||
exit(0);
|
||||
} else {
|
||||
print "no\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
open my $in, "/usr/bin/vmstat -zi |"
|
||||
or die "Can't run vmstat -zi: $!\n";
|
||||
|
||||
my $header = <$in>; # throw away header line
|
||||
my @irqs;
|
||||
|
||||
while (my $line = <$in>) {
|
||||
my ($irq, $total, $rate) = split(' ', $line);
|
||||
chomp $irq;
|
||||
$irq =~ s/\//_/g;
|
||||
chomp $total;
|
||||
push @irqs, {
|
||||
irq => $irq,
|
||||
total => $total,
|
||||
};
|
||||
}
|
||||
close $in;
|
||||
|
||||
if (defined $ARGV[0] && $ARGV[0] eq 'config') {
|
||||
print "graph_title Individual interrupts \n";
|
||||
print <<EOM;
|
||||
graph_args --base 1000 -l 0;
|
||||
graph_vlabel interrupts / \${graph_period}
|
||||
graph_category system
|
||||
EOM
|
||||
print join(' ', 'graph_order', map {"i" . $_->{irq}} @irqs), "\n";
|
||||
for my $irq (@irqs) {
|
||||
my $f = ($irq->{irq} || $irq->{total});
|
||||
print "i", $irq->{irq}, '.label ', $f, "\n";
|
||||
print "i", $irq->{irq}, '.info Interrupt for device(s): ', $irq->{irq}, "\n";
|
||||
print "i", $irq->{irq}, ".type DERIVE\n";
|
||||
print "i", $irq->{irq}, ".min 0\n";
|
||||
}
|
||||
} else {
|
||||
print "i", $_->{irq}, '.value ', $_->{total}, "\n" for @irqs;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue