Skip to content

Commit

Permalink
plugins: fix the params handling
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschnepp committed Apr 24, 2013
1 parent 98b7943 commit a8b7021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions plugins/node.d/snmp__if_multi.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!@@GOODSH@@

export host=${host:-$(basename $0 | cut -f2 -d '_' | tr '_' '.')}
# Handle caps
if [ "$1" = "config" -a "$2" = "cap" ]; then
HOSTNAME=$(basename $0 | cut -f2 -d '_' | tr '_' '.')
[ "$HOSTNAME" = "localhost" ] || echo "host_name $HOSTNAME"
[ "$host" = "localhost" ] || echo "host_name $host"
echo "multigraph dummy"
exit 0
fi


@@PERL@@ -w <<__END__
@@PERL@@ -w "$@" <<'__END__'
# -*- cperl -*-

=head1 NAME
Expand Down Expand Up @@ -130,7 +130,6 @@ be able to use 64 bit counters - if the device supports them.
This problem is a feature of the device SNMP implementation or your
usage of it, it is nothing the plugin can fix. In the future Munin

__END__
may be able to run the plugin more often than the counter wraps
around.

Expand Down Expand Up @@ -850,3 +849,5 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
}

do_fetch();

__END__
6 changes: 3 additions & 3 deletions plugins/node.d/snmp__uptime.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!@@GOODSH@@

export host=${host:-$(basename $0 | cut -f2 -d '_' | tr '_' '.')}
# Handle caps
if [ "$1" = "config" -a "$2" = "cap" ]; then
HOSTNAME=$(basename $0 | cut -f2 -d '_' | tr '_' '.')
[ "$HOSTNAME" = "localhost" ] || echo "host_name $HOSTNAME"
[ "$host" = "localhost" ] || echo "host_name $host"
echo "multigraph dummy"
exit 0
fi


@@PERL@@ -w <<__END__
@@PERL@@ -w "$@" - <<'__END__'
# -*- cperl -*-
# vim: ft=perl

Expand Down

0 comments on commit a8b7021

Please sign in to comment.