Zabbix monitoring RPM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.3KB

  1. #! /bin/sh
  2. #
  3. # chkconfig: - 85 15
  4. # description: zabbix agent daemon
  5. #
  6. ### BEGIN INIT INFO
  7. # Provides: zabbix-agent
  8. # Required-Start: $local_fs $network
  9. # Required-Stop: $local_fs $network
  10. # Default-Start:
  11. # Default-Stop: 0 1 2 3 4 5 6
  12. # Short-Description: start and stop zabbix agent
  13. # Description: Zabbix Agent
  14. ### END INIT INFO
  15. # zabbix details
  16. ZABBIX_AGENTD=/usr/sbin/zabbix_agentd
  17. CONF=/etc/zabbix/zabbix_agentd.conf
  18. PIDFILE=/var/run/zabbix-agent.pid
  19. # Source function library.
  20. . /etc/rc.d/init.d/functions
  21. # Source networking configuration.
  22. . /etc/sysconfig/network
  23. # Check that networking is up.
  24. [ ${NETWORKING} = "no" ] && exit 0
  25. [ -x $ZABBIX_AGENTD ] || exit 5
  26. [ -e $CONF ] || exit 6
  27. RETVAL=0
  28. case "$1" in
  29. start)
  30. echo -n "Starting Zabbix Agent: "
  31. daemon $ZABBIX_AGENTD -c $CONF
  32. RETVAL=$?
  33. echo
  34. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix-agent
  35. ;;
  36. stop)
  37. echo -n "Shutting down Zabbix Agent: "
  38. killproc zabbix_agentd
  39. RETVAL=$?
  40. echo
  41. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix-agent
  42. ;;
  43. restart|reload)
  44. $0 stop
  45. $0 start
  46. RETVAL=$?
  47. ;;
  48. status)
  49. status zabbix_agentd
  50. RETVAL=$?
  51. ;;
  52. *)
  53. echo "Usage: $0 {start|stop|restart|reload|status}"
  54. exit 1
  55. ;;
  56. esac
  57. exit $RETVAL