Changeset 859
- Timestamp:
- 03/29/05 19:45:08 (7 years ago)
- Files:
-
- people/ilmari/modularisation-branch/ChangeLog (modified) (1 diff)
- people/ilmari/modularisation-branch/Makefile (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_bx_fan.in (modified) (2 diffs, 1 prop)
- people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_bx_temp.in (modified) (2 diffs, 1 prop)
- people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_fan.in (modified) (2 diffs, 1 prop)
- people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_temp.in (modified) (2 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/ilmari/modularisation-branch/ChangeLog
r854 r859 11 11 * Node: munin-node didn't treat default_plugin_user properly (Deb#295366). 12 12 * Node: munin-node-configure now properly respect user plugins. 13 * Plugins: Add module Munin::Plugin::SNMP for simplifing SNMP plugins. 13 14 * Plugins: linux/if* now treats ra* interfaces as wireless. 14 15 * Plugins: minor bugfix in generic/bind9. people/ilmari/modularisation-branch/Makefile
r746 r859 61 61 mkdir -p $(LIBDIR)/plugins 62 62 mkdir -p $(SBINDIR) 63 mkdir -p $(PERLLIB)/Munin/Plugin64 63 65 64 mkdir -p $(LOGDIR) … … 88 87 done 89 88 $(INSTALL) -m 0644 build/node/plugins.history $(LIBDIR)/plugins/ 89 90 mkdir -p $(PERLLIB)/Munin/Plugin 91 $(INSTALL) -m 0644 build/node/SNMP.pm $(PERLLIB)/Munin/Plugin/ 90 92 91 93 #TODO: people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_bx_fan.in
- Property cvs2svn:cvs-rev changed from 1.5 to 1.4
r499 r859 22 22 # 23 23 # $Log$ 24 # Revision 1.5 2004/11/23 16:59:38 jimmyo25 # Include SNMP.pm in the files. We don't want any perl modules in the node for the 1.2 series.26 #27 24 # Revision 1.4 2004/11/16 20:08:26 jimmyo 28 25 # License cleanups. … … 41 38 #%# capabilities=snmpconf 42 39 43 package Munin::Plugin::SNMP;44 45 use Net::SNMP;46 @ISA = qw(Net::SNMP);47 48 sub session {49 my $class = shift;50 my $host = $ENV{host} || undef;51 my $port = $ENV{port} || 161;52 my $community = $ENV{community} || 'public';53 my $version = $ENV{version} || undef;54 55 if ($0 =~ /^(?:.*\/)?snmp_([^_]+)_/) {56 $host = $1;57 if ($host =~ /^([^:]+):(\d+)$/) {58 $host = $1;59 $port = $2;60 }61 } elsif (!defined($host)) {62 return unless wantarray; # Scalar or void context63 return (undef, 'Couldn not find monitoring target.'); # Array context64 }65 66 return $class->SUPER::session(-hostname => $host,67 -community => $community,68 -port => $port,69 ($version ? (-version => $version) : ()));70 }71 72 sub get_hash {73 my $self = shift;74 my %args = @_;75 my %ret;76 77 my $base = $args{'-baseoid'};78 my $cols = delete $args{'-cols'} or return;79 80 my $table = $self->get_table(%args)81 or return;82 83 my $subtabs = join '|', keys %$cols;84 my $re = qr/^\Q$base.\E($subtabs)\.(.*)/;85 for my $key (keys %$table) {86 $key =~ $re;87 next unless defined($1 && $2);88 $ret{$2}{$cols->{$1}} = $table->{$key};89 }90 return \%ret;91 }92 93 package main;94 95 40 use strict; 41 use Munin::Plugin::SNMP; 96 42 use Net::SNMP qw(oid_lex_sort); 97 43 people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_bx_temp.in
- Property cvs2svn:cvs-rev changed from 1.5 to 1.4
r499 r859 22 22 # 23 23 # $Log$ 24 # Revision 1.5 2004/11/23 16:59:38 jimmyo25 # Include SNMP.pm in the files. We don't want any perl modules in the node for the 1.2 series.26 #27 24 # Revision 1.4 2004/11/16 20:08:26 jimmyo 28 25 # License cleanups. … … 41 38 #%# capabilities=snmpconf 42 39 43 package Munin::Plugin::SNMP;44 45 use Net::SNMP;46 @ISA = qw(Net::SNMP);47 48 sub session {49 my $class = shift;50 my $host = $ENV{host} || undef;51 my $port = $ENV{port} || 161;52 my $community = $ENV{community} || 'public';53 my $version = $ENV{version} || undef;54 55 if ($0 =~ /^(?:.*\/)?snmp_([^_]+)_/) {56 $host = $1;57 if ($host =~ /^([^:]+):(\d+)$/) {58 $host = $1;59 $port = $2;60 }61 } elsif (!defined($host)) {62 return unless wantarray; # Scalar or void context63 return (undef, 'Couldn not find monitoring target.'); # Array context64 }65 66 return $class->SUPER::session(-hostname => $host,67 -community => $community,68 -port => $port,69 ($version ? (-version => $version) : ()));70 }71 72 sub get_hash {73 my $self = shift;74 my %args = @_;75 my %ret;76 77 my $base = $args{'-baseoid'};78 my $cols = delete $args{'-cols'} or return;79 80 my $table = $self->get_table(%args)81 or return;82 83 my $subtabs = join '|', keys %$cols;84 my $re = qr/^\Q$base.\E($subtabs)\.(.*)/;85 for my $key (keys %$table) {86 $key =~ $re;87 next unless defined($1 && $2);88 $ret{$2}{$cols->{$1}} = $table->{$key};89 }90 return \%ret;91 }92 93 package main;94 95 40 use strict; 41 use Munin::Plugin::SNMP; 96 42 use Net::SNMP qw(oid_lex_sort); 97 43 people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_fan.in
- Property cvs2svn:cvs-rev changed from 1.5 to 1.4
r499 r859 22 22 # 23 23 # $Log$ 24 # Revision 1.5 2004/11/23 16:59:38 jimmyo25 # Include SNMP.pm in the files. We don't want any perl modules in the node for the 1.2 series.26 #27 24 # Revision 1.4 2004/11/16 20:08:26 jimmyo 28 25 # License cleanups. … … 41 38 #%# capabilities=snmpconf 42 39 43 package Munin::Plugin::SNMP;44 45 use Net::SNMP;46 @ISA = qw(Net::SNMP);47 48 sub session {49 my $class = shift;50 my $host = $ENV{host} || undef;51 my $port = $ENV{port} || 161;52 my $community = $ENV{community} || 'public';53 my $version = $ENV{version} || undef;54 55 if ($0 =~ /^(?:.*\/)?snmp_([^_]+)_/) {56 $host = $1;57 if ($host =~ /^([^:]+):(\d+)$/) {58 $host = $1;59 $port = $2;60 }61 } elsif (!defined($host)) {62 return unless wantarray; # Scalar or void context63 return (undef, 'Couldn not find monitoring target.'); # Array context64 }65 66 return $class->SUPER::session(-hostname => $host,67 -community => $community,68 -port => $port,69 ($version ? (-version => $version) : ()));70 }71 72 sub get_hash {73 my $self = shift;74 my %args = @_;75 my %ret;76 77 my $base = $args{'-baseoid'};78 my $cols = delete $args{'-cols'} or return;79 80 my $table = $self->get_table(%args)81 or return;82 83 my $subtabs = join '|', keys %$cols;84 my $re = qr/^\Q$base.\E($subtabs)\.(.*)/;85 for my $key (keys %$table) {86 $key =~ $re;87 next unless defined($1 && $2);88 $ret{$2}{$cols->{$1}} = $table->{$key};89 }90 return \%ret;91 }92 93 package main;94 95 40 use strict; 41 use Munin::Plugin::SNMP; 96 42 use Net::SNMP qw(oid_lex_sort); 97 43 people/ilmari/modularisation-branch/node/node.d/snmp__sensors_fsc_temp.in
- Property cvs2svn:cvs-rev changed from 1.5 to 1.4
r499 r859 22 22 # 23 23 # $Log$ 24 # Revision 1.5 2004/11/23 16:59:38 jimmyo25 # Include SNMP.pm in the files. We don't want any perl modules in the node for the 1.2 series.26 #27 24 # Revision 1.4 2004/11/16 20:08:26 jimmyo 28 25 # License cleanups. … … 41 38 #%# capabilities=snmpconf 42 39 43 package Munin::Plugin::SNMP;44 45 use Net::SNMP;46 @ISA = qw(Net::SNMP);47 48 sub session {49 my $class = shift;50 my $host = $ENV{host} || undef;51 my $port = $ENV{port} || 161;52 my $community = $ENV{community} || 'public';53 my $version = $ENV{version} || undef;54 55 if ($0 =~ /^(?:.*\/)?snmp_([^_]+)_/) {56 $host = $1;57 if ($host =~ /^([^:]+):(\d+)$/) {58 $host = $1;59 $port = $2;60 }61 } elsif (!defined($host)) {62 return unless wantarray; # Scalar or void context63 return (undef, 'Couldn not find monitoring target.'); # Array context64 }65 66 return $class->SUPER::session(-hostname => $host,67 -community => $community,68 -port => $port,69 ($version ? (-version => $version) : ()));70 }71 72 sub get_hash {73 my $self = shift;74 my %args = @_;75 my %ret;76 77 my $base = $args{'-baseoid'};78 my $cols = delete $args{'-cols'} or return;79 80 my $table = $self->get_table(%args)81 or return;82 83 my $subtabs = join '|', keys %$cols;84 my $re = qr/^\Q$base.\E($subtabs)\.(.*)/;85 for my $key (keys %$table) {86 $key =~ $re;87 next unless defined($1 && $2);88 $ret{$2}{$cols->{$1}} = $table->{$key};89 }90 return \%ret;91 }92 93 package main;94 95 40 use strict; 41 use Munin::Plugin::SNMP; 96 42 use Net::SNMP qw(oid_lex_sort); 97 43
