Ad Widget

Collapse

zabbix start stop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tx4real
    Junior Member
    • Mar 2006
    • 6

    #1

    zabbix start stop

    Greetings:


    OK, I can start zabbix with ./zabbix_server, but how do
    I stop and/or refresh zabbix ?

    i.e.

    Is there a zabbix start|stop|refresh option that I'm missing ?


    Thanks,



    JZB
  • crs9
    Member
    • Feb 2006
    • 35

    #2
    You can either put in a system startup script or create an init file for it and make it a service. I run fedora/ red hat systems and someone on the forums had an init script already made. There are a few different distros already made for download. Just search on startup script

    Comment

    • tx4real
      Junior Member
      • Mar 2006
      • 6

      #3
      RE: Zabbix start stop

      Thanks ... I will do the search on startup script.

      Comment

      • krusty
        Senior Member
        • Oct 2005
        • 222

        #4
        Originally posted by tx4real
        Thanks ... I will do the search on startup script.
        Watch the directory /.../zabbix/misc/init.d/<your distribution>/

        There you will find the start | stop | restart scripts. But make sure that you have changed the path into the script.

        Comment

        • Padawan.AVT
          Junior Member
          • May 2009
          • 26

          #5
          And how to do the same on Solaris 10?

          Comment

          • untergeek
            Senior Member
            Zabbix Certified Specialist
            • Jun 2009
            • 512

            #6
            Tweak this however you need. This is what I use and put in /etc/init.d/zabbix_server

            Code:
            #!/sbin/sh
            # Donated code that was put under PD license.
            #
            
            umask 022
            
            CAT=/usr/bin/cat
            KILL=/usr/bin/kill
            
            SU_USER=zabbix
            ZABBIX_SERVER=/usr/local/sbin/zabbix_server
            PIDFILE=/var/tmp/zabbix_server.pid
            
            
            stop_service() {
                if [  -r $PIDFILE  -a  ! -z ${PIDFILE}  ]; then
                    PID=`${CAT} ${PIDFILE}`
                fi
                if [  ${PID:=0} -gt 1 -a  ! "X$PID" = "X "  ]; then
                    ${KILL} ${PID}
                else
                    echo "Unable to read PID file $PIDFILE"
                fi
            }
            
            start_service() {
                # XXX We really should check if the service is already going, but
                # XXX we will opt out at this time.
            
                # Start zabbix_server
                echo "starting $ZABBIX_SERVER... \c"         ; 
                su ${SU_USER} -c ${ZABBIX_SERVER}
            
                zabbix_rc=$?
                if [ $zabbix_rc -ne 0 ]; then
                    echo "$0: Error ${zabbix_rc} starting ${ZABBIX_SERVER}... bailing."
                    exit $zabbix_rc
                fi
                echo done.
            }
            
            case $1 in
            
            'start')
                start_service
                ;;
            
            'stop')
                stop_service
                ;;
            
            'restart')
                stop_service
                /usr/bin/sleep 5 && \
                start_service
                ;;
            
            *)
                echo "$0:  usage:  $0 {start|stop|restart}"
                ;;
            esac

            Comment

            • Padawan.AVT
              Junior Member
              • May 2009
              • 26

              #7
              Well, I've already wrote pretty much the same script which in the end just kills the process. I thought there might be a way to tell process to shut down by itself with proper internal exit procedures (like softly close all handles, sessions and so on)

              Comment

              Working...