On stabilise le plugin Python en virant toute occurrence de print.
* Désolé. \o/
This commit is contained in:
parent
2c27a030ee
commit
4b36a51d99
102 changed files with 513 additions and 703 deletions
|
@ -14,11 +14,9 @@ def check_cert(host='localhost', port=443, user="www-data", filename=None):
|
|||
'filename': filename,
|
||||
}
|
||||
if filename:
|
||||
print "43 7 * * * %(user)s /usr/scripts/utils/check_cert.py --filename %(filename)s" %\
|
||||
params
|
||||
out("43 7 * * * %(user)s /usr/scripts/utils/check_cert.py --filename %(filename)s" % params)
|
||||
else:
|
||||
print "42 7 * * * %(user)s /usr/scripts/utils/check_cert.py %(host)s %(port)s" %\
|
||||
params
|
||||
out("42 7 * * * %(user)s /usr/scripts/utils/check_cert.py %(host)s %(port)s" % params)
|
||||
|
||||
# Host specific
|
||||
if has('https-server') or has('https_cert'):
|
||||
|
|
|
@ -12,12 +12,12 @@ random.seed(admip())
|
|||
header("Régénération du pare-feu")
|
||||
|
||||
min=random.randint(0,59)
|
||||
print "# Regénération des règles MAC-IP du firewall"
|
||||
print "%s 1 * * * root /usr/scripts/gestion/gen_confs/firewall4/firewall4.py test_mac_ip > /dev/null" % min
|
||||
@# Regénération des règles MAC-IP du firewall
|
||||
out("%s 1 * * * root /usr/scripts/gestion/gen_confs/firewall4/firewall4.py test_mac_ip > /dev/null" % (min,))
|
||||
|
||||
print "# Régénération des blacklists du firewall"
|
||||
print "%s 2 * * * root /usr/scripts/gestion/gen_confs/firewall4/firewall4.py blacklists > /dev/null" % min
|
||||
@# Régénération des blacklists du firewall
|
||||
out("%s 2 * * * root /usr/scripts/gestion/gen_confs/firewall4/firewall4.py blacklists > /dev/null" % (min,))
|
||||
|
||||
if has("odlyd"):
|
||||
print "# Base pour redonner un accès temporairement aux non réadhérents"
|
||||
print "30 * * * * root /usr/sbin/ipset flush CONFIRMATION"
|
||||
@# Base pour redonner un accès temporairement aux non réadhérents
|
||||
@30 * * * * root /usr/sbin/ipset flush CONFIRMATION
|
||||
|
|
|
@ -12,4 +12,4 @@ random.seed(admip())
|
|||
header("Régénération de la configuration des services")
|
||||
|
||||
min=random.randint(0,9)
|
||||
print "%s-%s/10 * * * * root /usr/scripts/gestion/gen_confs/generate.py > /dev/null" % (min, 50+min)
|
||||
out("%s-%s/10 * * * * root /usr/scripts/gestion/gen_confs/generate.py > /dev/null" % (min, 50+min))
|
||||
|
|
|
@ -33,7 +33,7 @@ data = {
|
|||
# Si ce serveur possède un nfs, on génère le cron qui écrit dedans
|
||||
if has_shared_scripts(metadata):
|
||||
comment("Copie de `monit status` sur le nfs")
|
||||
print cron_tpl_nfs % data
|
||||
out(cron_tpl_nfs % data)
|
||||
|
||||
# Pour les autres serveurs, c'est le serveur autostatus qui récupère
|
||||
if has('autostatus'):
|
||||
|
@ -41,4 +41,4 @@ if has('autostatus'):
|
|||
for client in metadata.query.all():
|
||||
if not has_shared_scripts(client):
|
||||
data['host'] = client.hostname.split('.', 1)[0]
|
||||
print cron_tpl_nonfs % data
|
||||
out(cron_tpl_nonfs % data)
|
||||
|
|
|
@ -18,6 +18,6 @@ for group in metadata.groups:
|
|||
header("""Commandes cron pour les plugins munin custom Cr@ns""")
|
||||
|
||||
if cron_lines:
|
||||
print '\n\n'.join(cron_lines)
|
||||
out('\n\n'.join(cron_lines))
|
||||
else:
|
||||
print '# Rien à voir ici...'
|
||||
out('# Rien à voir ici...')
|
||||
|
|
|
@ -5,7 +5,8 @@ info["group"] = "root"
|
|||
info["mode"] = 0644
|
||||
|
||||
header("Cronjob munin-node")
|
||||
print """
|
||||
|
||||
out("""
|
||||
MAILTO=root
|
||||
|
||||
# If the APT plugin is enabled, update packages databases approx. once
|
||||
|
@ -13,21 +14,15 @@ MAILTO=root
|
|||
# happen), but ensure that there will never be more than two hour (7200
|
||||
# seconds) interval between updates..
|
||||
|
||||
"""
|
||||
|
||||
print """# J'ai trouve ce workaround sur :
|
||||
# J'ai trouve ce workaround sur :
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687912
|
||||
# le bugreport pretend que la derniere version de munin fix le probleme, mais non
|
||||
# --
|
||||
# 20-100, le 20/01/2013
|
||||
MUNIN_PLUGSTATE=/var/lib/munin-node/plugin-state/root
|
||||
|
||||
"""
|
||||
|
||||
print """
|
||||
# Quand on le fait trop vite, parfois la tache precedente n'a pas eu le temps
|
||||
# de finir et donc la suivante crashe parce qu'elle n'arrive pas a prendre
|
||||
# le lock
|
||||
*/10 * * * * root if [ -x /etc/munin/plugins/apt_all ]; then /etc/munin/plugins/apt_all update 7200 12 >/dev/null; elif [ -x /etc/munin/plugins/apt ]; then /etc/munin/plugins/apt update 7200 12 >/dev/null; fi
|
||||
"""
|
||||
|
||||
""")
|
||||
|
|
|
@ -6,8 +6,8 @@ info["mode"] = 0644
|
|||
|
||||
if has('connexion-secours-test'):
|
||||
header("Teste la disponibilité de la connexion normale et passe en secours si besoin")
|
||||
print "* * * * * root /usr/scripts/secours/secours.py test > /dev/null"
|
||||
@* * * * * root /usr/scripts/secours/secours.py test > /dev/null
|
||||
else:
|
||||
header("Mise en place de la connexion de secours suivant l'état du maitre")
|
||||
print "* * * * * root /usr/scripts/secours/secours.py > /dev/null"
|
||||
@* * * * * root /usr/scripts/secours/secours.py > /dev/null
|
||||
|
||||
|
|
|
@ -12,6 +12,6 @@ include("ip")
|
|||
|
||||
@# On vérifie si les clef ssh de la machine ont changés. Si oui, on les mets à jours dans ldap
|
||||
min=int(admip().split('.')[3])%60
|
||||
print "%s 9 * * * root /usr/scripts/gestion/gen_confs/populate_sshFingerprint.py" % min
|
||||
out("%s 9 * * * root /usr/scripts/gestion/gen_confs/populate_sshFingerprint.py" % (min,))
|
||||
@# On met à jour le known_hosts global
|
||||
print "%s 10 * * * root /usr/sbin/bcfg2 -b knownhosts -q" % min
|
||||
out("%s 10 * * * root /usr/sbin/bcfg2 -b knownhosts -q" % (min,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue