snmptrapd.py 644 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. from comar.service import *
  3. serviceType = "server"
  4. serviceDesc = _({"en": "Simple Network Management Protocol (SNMP) Trap Daemon",
  5. "tr": "Simple Network Management Protocol (SNMP) Trap Servisi"})
  6. serviceConf = "snmptrapd"
  7. pidfile = "/run/snmptrapd.pid"
  8. @synchronized
  9. def start():
  10. startService(command="/usr/sbin/snmptrapd",
  11. args="-p %s %s" % (pidfile, config.get("SNMPTRAPD_FLAGS", "")),
  12. pidfile=pidfile,
  13. donotify=True)
  14. @synchronized
  15. def stop():
  16. stopService(pidfile=pidfile, donotify=True)
  17. def status():
  18. return isServiceRunning(pidfile)