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

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

 1  # -*- coding: UTF-8 -*- 
 2   
 3  """Fonctionnement du VPN 
 4  """ 
 5  from zephir.monitor.agent.agent import MicroAgent 
 6  import commands 
 7   
8 -class Vpn(MicroAgent):
9 """Test VPN 10 """
11 - def __init__(self):
12 self.name="vpn" 13 self.description="""Fonctionnement du réseau virtuel (VPN)""" 14 MicroAgent.__init__(self) 15 16 MicroAgent.__init__(self) 17 self._system() 18 self.dump_xml() 19 self.dump_html()
20
21 - def _system(self):
22 """Récupère une sortie système 23 """ 24 exec_cmd = "service ipsec status | grep IPsec" 25 s = commands.getoutput(exec_cmd) 26 if s.count("running") > 0: 27 return 1 28 self.set_status("0") 29 return 0
30 31 if __name__ == "__main__": 32 Vpn() 33