Suppression de check_cfengine.py
darcs-hash:20071228111518-61eff-6ba44ad2111cb5420692e07fef53e5c95eeff416.gz
This commit is contained in:
parent
0e787a35e6
commit
9fb1fc62df
1 changed files with 0 additions and 39 deletions
|
@ -1,39 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: iso-8859-15 -*-
|
|
||||||
|
|
||||||
# Vérification de l'état de cfengine
|
|
||||||
|
|
||||||
import sys, os
|
|
||||||
sys.path.append("/usr/scripts/gestion")
|
|
||||||
from email_tools import send_email
|
|
||||||
|
|
||||||
def parse(fichier):
|
|
||||||
resultat = ""
|
|
||||||
accu = ""
|
|
||||||
nb_lignes = 0
|
|
||||||
|
|
||||||
for ligne in fichier.readlines():
|
|
||||||
if ligne.find("Hailing") != -1:
|
|
||||||
# On commence un nouveau serveur
|
|
||||||
if accu != "" and nb_lignes != 7:
|
|
||||||
# Qqch d'anormal s'est passé
|
|
||||||
resultat += accu
|
|
||||||
accu = ligne
|
|
||||||
nb_lignes = 1
|
|
||||||
else:
|
|
||||||
accu += ligne
|
|
||||||
nb_lignes += 1
|
|
||||||
|
|
||||||
# Le dernier
|
|
||||||
if accu != "" and nb_lignes != 7:
|
|
||||||
resultat += accu
|
|
||||||
|
|
||||||
return resultat
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
message = parse(os.popen("/usr/sbin/cfrun -- -n")).decode("ISO-8859-15")
|
|
||||||
if message:
|
|
||||||
message += u"-- \nGénéré par check_cfengine.py\n"
|
|
||||||
send_email("CFEngine (Vert)<root@crans.org>", "roots@crans.org", \
|
|
||||||
u"Machines non synchronisées", message)
|
|
Loading…
Add table
Add a link
Reference in a new issue