From 947162db3a31d716f2c0bc93f4fb985d2ee1c260 Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Fri, 5 Feb 2010 13:16:02 +0100 Subject: [PATCH] =?UTF-8?q?[munin]=20mise=20=C3=A0=20jour=20vers=20la=201.?= =?UTF-8?q?4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20100205121602-ffbb2-12d71a997e596f35b16c0309949577d4fb727d49.gz --- munin/scripts/hosts_plugins.py | 6 +++++- munin/scripts/link_plugins.py | 13 ++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/munin/scripts/hosts_plugins.py b/munin/scripts/hosts_plugins.py index fc65ba24..b3869734 100755 --- a/munin/scripts/hosts_plugins.py +++ b/munin/scripts/hosts_plugins.py @@ -77,7 +77,7 @@ hosts_plugins = { "audimat": "audimat", "batiments": "batiments", "munin": "munin", - "ping_multiprise.adm": "ping_", + "ping_multiprise_v6.adm": "ping_", "stats-ip": "stats-ip", # La suite plus bas... }, @@ -110,6 +110,10 @@ for switch in annuaires.all_switchs(): switch = switch.replace('-', '_') hosts_plugins["munin"]["ping_%s.adm" % switch] = "ping_bat_" +# Et les vigiles... +for lieu in ["0a", "0b", "2b", "0c", "0g", "2g", "4g", "0h", "-1i", "0j", "4j", "0m"]: + hosts_plugins["munin"]["vigile_vigile_%s.adm.crans.org" % lieu.replace('-','_')] = "/usr/scripts/surveillance/vigile" + # On rajoute les stats de connexion for host in hosts_plugins.keys(): hosts_plugins[host].update({"sockets": "sockets"}) diff --git a/munin/scripts/link_plugins.py b/munin/scripts/link_plugins.py index fd461408..d5270556 100755 --- a/munin/scripts/link_plugins.py +++ b/munin/scripts/link_plugins.py @@ -29,6 +29,7 @@ IGNORE_PLUGINS = ( 'if_err_', 'multips', 'port_', + 'sensors_', 'squid_icp', 'vlan_', ) @@ -77,14 +78,17 @@ def get_munin_plugins(): ) munin_stdout, munin_stderr = munin.communicate() - if munin.returncode != 0: - raise RuntimeError, "munin-node-configure... Stderr:\n%s" % munin_stderr +# if munin.returncode != 0: +# raise RuntimeError, "munin-node-configure... Stderr:\n%s" % munin_stderr munin_output_lines = munin_stdout.splitlines() for line in munin_output_lines: if line.startswith("ln -s"): dst, src = line.split()[-2:] + if dst[0] == "'": + dst = dst[1:-1] + src = src[1:-1] src = os.path.basename(src) # filtrage if not os.path.basename(dst) in IGNORE_PLUGINS: @@ -111,7 +115,10 @@ def get_all_plugins(): custom_plugins = hosts_plugins.get(hostname, {}) for plugin, dest_file in custom_plugins.iteritems(): - result[plugin] = os.path.join('/usr/scripts/munin', dest_file) + if dest_file.startswith('/'): + result[plugin] = dest_file + else: + result[plugin] = os.path.join('/usr/scripts/munin', dest_file) return result