Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/snmp/multi_snmp_querier | ||
|---|---|---|
| 6 | 6 |
|
| 7 | 7 |
=head1 SYNOPSIS |
| 8 | 8 |
|
| 9 |
This plugin is meant to be called from Munin. You should at least set the
|
|
| 10 |
'hosts' environment variable from Munin's configuration (i.e.
|
|
| 9 |
This plugin is meant to be called from Munin. You should at least set the |
|
| 10 |
'hosts' environment variable from Munin's configuration (i.e. |
|
| 11 | 11 |
/etc/munin/munin.conf) to specify which hosts and how to query. |
| 12 | 12 |
|
| 13 | 13 |
=head1 DESCRIPTION |
| ... | ... | |
| 20 | 20 |
|
| 21 | 21 |
Which SNMP OID should we query on; it defaults to |
| 22 | 22 |
1.3.6.1.2.1.43.10.2.1.4.1.1 (total printed pages - of course, it only |
| 23 |
makes sense to query a printer on this ;-) ).
|
|
| 23 |
makes sense to query a printer on this ;-) ). |
|
| 24 | 24 |
|
| 25 | 25 |
Other known and useful OIDs for printers are |
| 26 | 26 |
1.3.6.1.2.1.43.11.1.1.9.1.1 (total number of pages printed with this |
| ... | ... | |
| 111 | 111 |
total => 'Total', |
| 112 | 112 |
units => 'pages' |
| 113 | 113 |
}, |
| 114 |
'1.3.6.1.2.1.43.11.1.1.8.1.1' =>
|
|
| 114 |
'1.3.6.1.2.1.43.11.1.1.8.1.1' => |
|
| 115 | 115 |
{ title => 'Total projected capacity of this cartridge',
|
| 116 | 116 |
vlabel => 'Total capacity', |
| 117 | 117 |
category => 'printing', |
| ... | ... | |
| 120 | 120 |
total => 'Total', |
| 121 | 121 |
units => 'pages' |
| 122 | 122 |
}, |
| 123 |
'1.3.6.1.2.1.43.11.1.1.9.1.1' =>
|
|
| 123 |
'1.3.6.1.2.1.43.11.1.1.9.1.1' => |
|
| 124 | 124 |
{ title => 'Pages printed with this cartridge',
|
| 125 | 125 |
vlabel => 'Printed pages', |
| 126 | 126 |
category => 'printing', |
| ... | ... | |
| 129 | 129 |
total => 'Total', |
| 130 | 130 |
units => 'pages' |
| 131 | 131 |
}, |
| 132 |
'default' =>
|
|
| 132 |
'default' => |
|
| 133 | 133 |
{ title => "Results for SNMP OID $oid",
|
| 134 | 134 |
vlabel => 'units', |
| 135 | 135 |
category => 'Other', |
| ... | ... | |
| 144 | 144 |
$cmd_arg = $ARGV[0] || ''; |
| 145 | 145 |
if($cmd_arg eq "config") {
|
| 146 | 146 |
my $labels = $known_oids{$oid} || $known_oids{default};
|
| 147 |
# See http://munin.projects.linpro.no/wiki/HowToWritePlugins for
|
|
| 147 |
# See http://munin.projects.linpro.no/wiki/HowToWritePlugins for |
|
| 148 | 148 |
# explanation on the following fields |
| 149 | 149 |
print "graph_title $labels->{title}\n";
|
| 150 | 150 |
print "graph_args --base 1000 -l 0\n"; |
| ... | ... | |
| 184 | 184 |
$ping = Net::Ping->new("tcp", 1);
|
| 185 | 185 |
$ping->ping($host); |
| 186 | 186 |
} |
| 187 |
|
|
| 187 |
|
|
| 188 | 188 |
sub get_hosts {
|
| 189 | 189 |
# Hosts are defined in the 'hosts' environment variable. It's a list of |
| 190 | 190 |
# hosts (and optionally ports) - We parse the list and arrange it neatly |
Formats disponibles : Unified diff