1
2
3 """Fonctionnement de Samba
4 """
5 from zephir.monitor.agent.agent import MicroAgent
6 import commands
7
9 """Test Samba
10 """
12 self.name="samba"
13 self.description="""Fonctionnement du partage de fichiers Samba"""
14
15 MicroAgent.__init__(self)
16 self._system()
17 self.dump_xml()
18 self.dump_html()
19
21 """Récupère une sortie système
22 """
23 exec_cmd = "tcpcheck 3 localhost:139"
24 s = commands.getoutput(exec_cmd)
25 if s.count("alive") > 0:
26 return 1
27 self.set_status("0")
28 return 0
29
30 if __name__ == "__main__":
31 Samba()
32