[munin] mise à jour vers la 1.4

darcs-hash:20100205121602-ffbb2-12d71a997e596f35b16c0309949577d4fb727d49.gz
This commit is contained in:
Nicolas Dandrimont 2010-02-05 13:16:02 +01:00
parent 524d0f8107
commit 947162db3a
2 changed files with 15 additions and 4 deletions

View file

@ -77,7 +77,7 @@ hosts_plugins = {
"audimat": "audimat", "audimat": "audimat",
"batiments": "batiments", "batiments": "batiments",
"munin": "munin", "munin": "munin",
"ping_multiprise.adm": "ping_", "ping_multiprise_v6.adm": "ping_",
"stats-ip": "stats-ip", "stats-ip": "stats-ip",
# La suite plus bas... # La suite plus bas...
}, },
@ -110,6 +110,10 @@ for switch in annuaires.all_switchs():
switch = switch.replace('-', '_') switch = switch.replace('-', '_')
hosts_plugins["munin"]["ping_%s.adm" % switch] = "ping_bat_" 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 # On rajoute les stats de connexion
for host in hosts_plugins.keys(): for host in hosts_plugins.keys():
hosts_plugins[host].update({"sockets": "sockets"}) hosts_plugins[host].update({"sockets": "sockets"})

View file

@ -29,6 +29,7 @@ IGNORE_PLUGINS = (
'if_err_', 'if_err_',
'multips', 'multips',
'port_', 'port_',
'sensors_',
'squid_icp', 'squid_icp',
'vlan_', 'vlan_',
) )
@ -77,14 +78,17 @@ def get_munin_plugins():
) )
munin_stdout, munin_stderr = munin.communicate() munin_stdout, munin_stderr = munin.communicate()
if munin.returncode != 0: # if munin.returncode != 0:
raise RuntimeError, "munin-node-configure... Stderr:\n%s" % munin_stderr # raise RuntimeError, "munin-node-configure... Stderr:\n%s" % munin_stderr
munin_output_lines = munin_stdout.splitlines() munin_output_lines = munin_stdout.splitlines()
for line in munin_output_lines: for line in munin_output_lines:
if line.startswith("ln -s"): if line.startswith("ln -s"):
dst, src = line.split()[-2:] dst, src = line.split()[-2:]
if dst[0] == "'":
dst = dst[1:-1]
src = src[1:-1]
src = os.path.basename(src) src = os.path.basename(src)
# filtrage # filtrage
if not os.path.basename(dst) in IGNORE_PLUGINS: if not os.path.basename(dst) in IGNORE_PLUGINS:
@ -111,7 +115,10 @@ def get_all_plugins():
custom_plugins = hosts_plugins.get(hostname, {}) custom_plugins = hosts_plugins.get(hostname, {})
for plugin, dest_file in custom_plugins.iteritems(): 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 return result