On regroupe les plugins munin dans un rpertoire commun toutes les machines
darcs-hash:20060420130121-72cb0-50f87f8f01382a2ddc9afec1b1b6e02890d8d32c.gz
This commit is contained in:
parent
674ee00ed0
commit
f672fa493b
23 changed files with 1451 additions and 0 deletions
44
munin/iptables_
Executable file
44
munin/iptables_
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
|
||||
# Compteur des règles iptables
|
||||
|
||||
import sys,commands,string
|
||||
|
||||
# On prend l'argument pour définir la table à analyser
|
||||
TABLE = sys.argv[0].split('_')[1]
|
||||
|
||||
if TABLE :
|
||||
IPTABLES = "iptables -t %s -L " % TABLE
|
||||
else :
|
||||
IPTABLES = "iptables -L "
|
||||
|
||||
try :
|
||||
arg = sys.argv[1]
|
||||
except :
|
||||
arg = ''
|
||||
|
||||
CHAINS = commands.getoutput('%s | grep Chain | awk \'{print $2}\'' % IPTABLES).split('\n')
|
||||
|
||||
if arg == "config" :
|
||||
print 'graph_title Firewall %s' % string.lower(TABLE)
|
||||
print 'graph_args --base 1000 --lower-limit 0'
|
||||
print 'graph_category network'
|
||||
print "graph_vlabel nb de regles"
|
||||
for chain in CHAINS :
|
||||
nom = string.lower(chain.replace('_', '').replace('-', ''))
|
||||
label = chain.replace('_', '-')
|
||||
print "%s.label %s" % (nom, label)
|
||||
if CHAINS.index(chain) == 0 :
|
||||
print "%s.draw AREA" % nom
|
||||
else :
|
||||
print "%s.draw STACK" % nom
|
||||
if label == "TEST-MAC-IP" :
|
||||
print "%s.warning 100:" % nom
|
||||
print "%s.critical 1:" % nom
|
||||
|
||||
else :
|
||||
for chain in CHAINS :
|
||||
nom = string.lower(chain.replace('_', '').replace('-', ''))
|
||||
value = int(commands.getoutput('%s %s | wc -l' % (IPTABLES, chain))) - 2
|
||||
print "%s.value %d" % (nom, value)
|
Loading…
Add table
Add a link
Reference in a new issue