Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 288217 Details for
Bug 384921
net-analyzer/munin: merge request for two more patches
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
apc_nis patch
0001-apc_nis-support-rewriting-host-and-port-in-configura.patch (text/plain), 2.27 KB, created by
Diego Elio Pettenò (RETIRED)
on 2011-09-29 11:41:25 UTC
(
hide
)
Description:
apc_nis patch
Filename:
MIME Type:
Creator:
Diego Elio Pettenò (RETIRED)
Created:
2011-09-29 11:41:25 UTC
Size:
2.27 KB
patch
obsolete
>From 1563eb6b72781fecd58495c358b1fc877c904043 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@flameeyes.eu> >Date: Mon, 22 Aug 2011 15:06:11 +0200 >Subject: [PATCH] apc_nis: support rewriting host and port in configuration >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >It is possible for APCUPSD to manage multiple UPSes on the same box, and to >export its information to external systems as well. > >Since each UPS needs its own NIS host/port pair to be accessible, allow the >user to access non-default hosts and ports. This also allows to monitor >remote UPSes with Munin. > >Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> >--- > plugins/node.d/apc_nis.in | 38 +++++++++++++++++++++++--------------- > 1 files changed, 23 insertions(+), 15 deletions(-) > >diff --git a/plugins/node.d/apc_nis.in b/plugins/node.d/apc_nis.in >index 6c06459..9adf96d 100644 >--- a/plugins/node.d/apc_nis.in >+++ b/plugins/node.d/apc_nis.in >@@ -5,17 +5,25 @@ > > apc_nis - Plugin to monitor APC UPS via the nis port of apcupsd > >-=cut >+=head1 CONFIGURATION >+ >+The following configuration parameters are used by this plugin >+ >+ [apc_nis] >+ env.host - hostname to connect to >+ env.port - port number to connect to >+ >+=head2 DEFAULT CONFIGURATION >+ >+ [apc_nis] >+ env.host 127.0.0.1 >+ env.port 3551 > >-# >-# >-# Parameters: >-# >-# config (required) >-# >-# Magic markers (optional - used by munin-config and some installation >-# scripts): >-#%# family=contrib >+=head1 MAGIC MARKERS >+ >+ #%# family=contrib >+ >+=cut > > use IO::Socket; > use strict; >@@ -25,8 +33,11 @@ if($ARGV[0] and $ARGV[0] eq "autoconfig") { > exit 0; > } > >+my $host = exists $ENV{'host'} ? $ENV{'host'} : "127.0.0.1"; >+my $port = exists $ENV{'port'} ? $ENV{'port'} : "3551"; >+ > if($ARGV[0] and $ARGV[0] eq "config") { >- print "graph_title apcupsd\n"; >+ print "graph_title apcupsd $host:$port\n"; > print "graph_args -l 0 --base 1000\n"; > print "graph_vlabel A bit of all (Volt, time, %)\n"; > print "battery_volt.label batt volt (V)\n"; >@@ -50,11 +61,8 @@ if($ARGV[0] and $ARGV[0] eq "config") { > exit 0; > } > >-my $server = "localhost"; >-my $port = "3551"; >- > my $sock = new IO::Socket::INET ( >- PeerAddr => $server, >+ PeerAddr => $host, > PeerPort => $port, > Proto => 'tcp' > ); >-- >1.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 384921
: 288217 |
288219
|
288293