Package zephir :: Package monitor :: Package agent :: Package diagnose :: Module ead
[hide private]
[frames] | no frames]

Source Code for Module zephir.monitor.agent.diagnose.ead

 1  # -*- coding: UTF-8 -*- 
 2   
 3  """Fonctionnement de L'EAD 
 4  """ 
 5  from zephir.monitor.agent.agent import MicroAgent 
 6  import commands,dico 
 7   
8 -class Ead(MicroAgent):
9 """Test EAD 10 """
11 - def __init__(self):
12 self.name="ead" 13 self.description="""Fonctionnement de l'outil d'administration (EAD)""" 14 15 MicroAgent.__init__(self) 16 self._system() 17 self.dump_xml() 18 self.dump_html()
19
20 - def _system(self):
21 """Récupère une sortie système 22 """ 23 ip_eth0 = dico.DicoEole().get_value('adresse_ip_eth0') 24 exec_cmd = "tcpcheck 3 "+ip_eth0+":8501" 25 s = commands.getoutput(exec_cmd) 26 if s.count("alive") > 0: 27 return 1 28 self.set_status("0") 29 return 0
30 31 if __name__ == "__main__": 32 Ead() 33