1
2
3 """Fonctionnement de CUPS
4 """
5 from zephir.monitor.agent.agent import MicroAgent
6 import commands
7
8 -class Cups(MicroAgent):
9 """Test CUPS
10 """
12 self.name="cups"
13 self.description="""Fonctionnement du serveur d'impression CUPS"""
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:631"
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 Cups()
32