1
2
3 """Fonctionnement de LPD
4 """
5 from zephir.monitor.agent.agent import MicroAgent
6 import commands
7
8
9 -class Lpd(MicroAgent):
10 """Test LPD
11 """
13 self.name="lpd"
14 self.description="""Fonctionnement du serveur d'impression LPD"""
15
16 MicroAgent.__init__(self)
17 self._system()
18 self.dump_xml()
19 self.dump_html()
20
22 """Récupère une sortie système
23 """
24 exec_cmd = "tcpcheck 3 localhost:515"
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 Lpd()
33