Ad Widget

Collapse

Unsure if my Make Install worked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johnw230873
    Member
    • Aug 2010
    • 54

    #1

    Unsure if my Make Install worked

    I'm using ubuntu 10.10 and decided to install from source to get the lastest build. I followed the install from source instructions and all looked fine until the Make Install.

    It seemed all good but the instructions after that step didn't seem right and also the web pages shows the server as not started.

    So when I made the install file and installed it it installed to in /usr/local/sbin as indicated in the doc but step 11 indicates the folder could be off the root but if I go into that folder there isn't a zabbix_server service in there, there is one in /user/local.sbin but if I run that the web page still indicates the server still isn't running and no data is being collected.

    Where next should I be looking?
  • Ori0n
    Member
    • Dec 2010
    • 35

    #2
    What did your configure command look like? Did you add additional options or just use "./configure"? /usr/local.sbin doesn't seem right. What happens when you execute zabbix_server? Did you specify a config file?

    Did you follow all other parts of the manual install, such as database configuration and the frontend PHP installation into your web root?



    Originally posted by johnw230873
    I'm using ubuntu 10.10 and decided to install from source to get the lastest build. I followed the install from source instructions and all looked fine until the Make Install.

    It seemed all good but the instructions after that step didn't seem right and also the web pages shows the server as not started.

    So when I made the install file and installed it it installed to in /usr/local/sbin as indicated in the doc but step 11 indicates the folder could be off the root but if I go into that folder there isn't a zabbix_server service in there, there is one in /user/local.sbin but if I run that the web page still indicates the server still isn't running and no data is being collected.

    Where next should I be looking?

    Comment

    • johnw230873
      Member
      • Aug 2010
      • 54

      #3
      Thanks for the reply Orion,

      The instructions I was following are here
      http://www.zabbix.com/documentation/...on_from_source

      It does stay in the instructions that the make install will install to /usr/local/sbin

      I didn't see where to say what config to use?

      Question, do I need the agent running on the server as it didn't build or install

      Is there an error log I can view?

      Comment

      • Ori0n
        Member
        • Dec 2010
        • 35

        #4
        In your original message, you mentioned "/usr/sbin.local", which was probably just a typo, so I ignore my comments about it.

        In Step 10 of the link you provided it talks about /etc/zabbix/zabbix.conf. Is that there? If not, you can find a seed file in the source directory you extracted at misc/conf/zabbix_server.conf. Move it to /etc/zabbix/zabbix_server.conf and adjust parameters as necessary. You can specify the log verbosity and where the log file lives in this file as well which might help you.

        Once everything is in place, you can try to run zabbix_server (remember to run as root):
        Code:
        /usr/local/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
        I can't remember if zabbix_server daemonizes or not with that command. If you don't see any output, check the log file that you specified in /etc/zabbix/zabbix_server.conf

        zabbix_server doesn't care about zabbix_agent. Of course, if you want to use checks that depend on this, that's a different story, but it's not strictly required.


        Originally posted by johnw230873
        Thanks for the reply Orion,

        The instructions I was following are here
        http://www.zabbix.com/documentation/...on_from_source

        It does stay in the instructions that the make install will install to /usr/local/sbin

        I didn't see where to say what config to use?

        Question, do I need the agent running on the server as it didn't build or install

        Is there an error log I can view?

        Comment

        • frater
          Senior Member
          • Oct 2010
          • 340

          #5
          This will at least tell you if an executable has been created...
          Code:
          find / -type f -name zabbix_* | xargs ls -l | grep 'x 1 root'
          This is what I used before 'make' and 'make install'
          Code:
          ./configure --with-libcurl --with-net-snmp --with-mysql --enable-agent --enable-server
          You may of course want a different config.

          You need a startup script in /etc/init.d/ (/etc/init.d/zabbix-server) and symlinks in all the /etc/rc*.d/ folders
          "K01zabbix-server" or "S17zabbix-server" (depending on the runlevel)

          Check if they are there.....

          Code:
          # ls -l /etc/rc6.d/K01zabbix-server
          lrwxrwxrwx 1 root root 23 Sep 14 09:09 /etc/rc6.d/K01zabbix-server -> ../init.d/zabbix-server
          
          # ls -l /etc/rc3.d/S17zabbix-server
          lrwxrwxrwx 1 root root 23 Sep 14 09:08 /etc/rc3.d/S17zabbix-server -> ../init.d/zabbix-server
          This is my startup script in /etc/init.d (of course executable)
          But this script is a bit platform dependent.
          Mine is running on Debian (should be good for Ubuntu too)


          ~# cat /etc/init.d/zabbix-server
          Code:
          #! /bin/sh
          ### BEGIN INIT INFO
          # Provides:          zabbix-server
          # Required-Start:    $remote_fs $network
          # Required-Stop:     $remote_fs
          # Default-Start:     2 3 4 5
          # Default-Stop:      0 1 6
          # Should-Start:      mysql
          # Should-Stop:       mysql
          # Short-Description: Start zabbix-server daemon
          ### END INIT INFO
          
          set -e
          
          NAME=zabbix_server
          DAEMON=/usr/local/sbin/$NAME
          DESC="Zabbix server"
          
          test -x $DAEMON || exit 0
          
          DIR=/var/run/zabbix-server
          PID=$DIR/$NAME.pid
          RETRY=15
          
          if test ! -d "$DIR"; then
            mkdir "$DIR"
            chown -R zabbix:zabbix "$DIR"
          fi
          
          export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
          
          # define LSB log_* functions.
          . /lib/lsb/init-functions
          
          case "$1" in
            start)
              log_daemon_msg "Starting $DESC" "$NAME"
                  start-stop-daemon --oknodo --start --pidfile $PID \
                    --exec $DAEMON >/dev/null 2>&1
              case "$?" in
                  0) log_end_msg 0 ;;
                  *) log_end_msg 1; exit 1 ;;
              esac
                  ;;
            stop)
              log_daemon_msg "Stopping $DESC" "$NAME"
                  start-stop-daemon --oknodo --stop --exec $DAEMON --retry $RETRY
              case "$?" in
                  0) log_end_msg 0 ;;
                  *) log_end_msg 1; exit 1 ;;
              esac
                  ;;
            status)
             ls -l /proc/`cat $PID`/exe > /dev/null 2>&1
             if [ $? -eq 0 ]; then
                 echo "$DESC is running"
                 exit 0
             else
                 echo "$DESC is NOT running"
                 exit 1
             fi
             ;;
            restart|force-reload)
                  $0 stop
                  $0 start
                  ;;
            *)
              echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
                  exit 1
                  ;;
          esac
          
          exit 0
          Last edited by frater; 21-09-2011, 08:22.
          Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

          Comment

          • johnw230873
            Member
            • Aug 2010
            • 54

            #6
            Thanks guys in the end it turn out to be the database didn't have its password set in the config, doh. The log was quick to show this.

            I only just got it going before I had to walk out the door last night but it appeared that maybe the checks weren't running, can I ask if the default checks from the install need the agent installed?

            Comment

            • johnw230873
              Member
              • Aug 2010
              • 54

              #7
              Thanks frater, I'm just can't figure out how to get the service to start as boot time.

              I always need to go ./zabbix-server start

              This is what I did
              I copied your zabbix-server to /etc/init.d/ and chmod it +x
              I tested this by going ./zabbix-server start

              I did have either "K01zabbix-server" or "S17zabbix-server" so I created them using
              sudo ln -s /etc/init.d/zabbix-server /etc/rc3.d/S17zabbix-server
              and
              sudo ln -s /etc/init.d/zabbix-server /etc/rc6.d/K01zabbix-server

              I also tested these by typing ./etc/rc3.d/S17zabbix-server start , started fine

              If I only run ./etc/rc3.d/S17zabbix-server I get the return line
              Usage: /etc/init.d/zabbix_server {start|stop|restart|force-reload}


              Any idea why the S17zabbix-server is starting the zabbix-server as boot time
              Last edited by johnw230873; 22-09-2011, 04:57.

              Comment

              • frater
                Senior Member
                • Oct 2010
                • 340

                #8
                Do create those symlinks with a relative path and not an absolute one.
                Code:
                sudo rm /etc/rc3.d/S17zabbix-server
                sudo ln -s ../init.d/zabbix-server /etc/rc3.d/S17zabbix-server
                But what you've done shouldn't be a problem...
                You did this for all runlevels?

                BTW the server should start with (without the 'start'):

                /etc/rc3.d/S17zabbix-server

                Because I'm running the much less stable 1.96beta I have this in my /etc/crontab:

                Code:
                # Watchdog for Zabbix-server
                * * * * * root netstat -lntp | grep -q zabbix_server || /etc/init.d/zabbix-server start
                This way the server will start after it crashes....

                To make it complete I wrote an item and trigger to monitor '/var/log/zabbix-server/zabbix_server.log' to check for 'Starting Zabbix'

                I'm using regcount[ /var/log/zabbix-server/zabbix_server.log, 'Starting Zabbix'] for this.
                I wrote this item last year and it has been very handy.....
                Last edited by frater; 22-09-2011, 09:36.
                Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

                Comment

                • johnw230873
                  Member
                  • Aug 2010
                  • 54

                  #9
                  Hi Frater, as a lot of people new to Zabbix I'm also new to Linux and I'm finding it hard to find out simple information on how to set a service up automatically and why.
                  To date this is the information I've read
                  Scripts in the directory "init.d" are used to start/stop/restart services
                  These scripts should be made executable
                  You can run these directly from the terminal /etc/init.d/<servicename> restart
                  By doing this alone won't mean the service will restart each time the server is restarted
                  There are folders called rc folders, these are read whenever the system starts or shuts down
                  Each of these folders have a number e.g. rc1 rc2 etc, this represents the order of folders when they are read
                  In these folders you need to place a Symlink that points to the real file in the /etc/init.d folder.
                  The name of this link needs to start with either a S or K , S links are used on startup and K is used when the server shutting down

                  So following this here are the things I still a bit light on.
                  First off is the above correct or did I read something incorrectly
                  You ask did I do this for each run level, what are run levels?
                  You state the name of the start file as S17 and the stop file K01, Why S17 and not S01?
                  How would the above script start as it looks for a parameter in the case statement, in saying that how does the S and K files tell the service to start and stop, is it something in the operating system.
                  I used absolute path not relative when I set up the Symlinks.

                  Thanks Frater.

                  Comment

                  • frater
                    Senior Member
                    • Oct 2010
                    • 340

                    #10
                    First off is the above correct or did I read something incorrectly
                    Yes, I think you're getting it.

                    You ask did I do this for each run level, what are run levels?




                    With the command 'runlevel' you can see how your box started.
                    On Debian (and therefore Ubuntu) it normally starts with runlevel 2

                    All the S* scripts in /etc/rc2.d/ will be executed in alphabetical order.
                    This way you can control the sequence.
                    On my system these scripts were created by the installer and I didn't need to create them manually.

                    These startup-scripts all take parameters. Typically 'stop','start','restart' and sometimes 'status'.

                    On startup all the scripts in their specific runlevel are executed with a 'start' and on shutdown they are executed with a 'stop'


                    I was wrong thinking the full-blown linux systems still took the filename as a parameter. This is how it's done on smaller systems.. I created many of these startup/shutdown scripts and there they are all placed in /etc/init.d

                    On startup the S* scripts are executed and on shutdown it's the K* scripts.
                    If the script doesn't get a parameter it will take the filename and check the first letter...
                    Those scripts often have this code inside (rc is the 'run command'):
                    Code:
                    if [ -z "$1" ] ; then
                        case `echo "$0" | sed 's:^.*/\(.*\):\1:g'` in
                            S??*) rc="start" ;;
                            K??*) rc="stop" ;;
                            *) rc="usage" ;;
                        esac
                    else
                        rc="$1"
                    fi
                    Some of the things are still confusing for me too as some info contradicts the other..
                    As long as things are working as they should I'm not poking in there...


                    BTW...
                    I don't know which part of my install process created these startup scripts and symbolic links. I assume it was the 'make install'
                    Last edited by frater; 25-09-2011, 11:50.
                    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

                    Comment

                    Working...