Ad Widget

Collapse

Issues with proxies and nodes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • overnet
    Member
    • Mar 2008
    • 33

    #1

    Issues with proxies and nodes

    Hello,

    I have two servers that I want to use with Zabbix 1.6.1.

    I've tried first to use server1 as Zabbix server and server2 as a zabbix proxy. I used the following to build Zabbix with proxy support:

    Code:
    ./configure --enable-proxy --with-mysql --with-net-snmp –with-libcurl
    I've update zabbix_proxy.conf and ran zabbix_proxy, the command didn't show up an error message. But when I did

    Code:
    ps -ef | grep zabbix
    Nothing showed up, is this a normal behavior?

    Then I tried the node mode, I've updated zabbix_server.conf to have NodeID=1 instead of disabled (#NodeID=0), I restart zabbix-agent ran the following:

    Code:
    ./zabbix_server -n 1 -c /etc/zabbix/zabbix_server.conf
    It has been running for over 40 min now, I'm wondering how long does the conversion take?

    Thank you,
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Originally posted by overnet
    Hello,

    I've update zabbix_proxy.conf and ran zabbix_proxy, the command didn't show up an error message. But when I did

    Code:
    ps -ef | grep zabbix
    Nothing showed up, is this a normal behavior?
    No. Not normal. On a box with both proxy and agent running, you should see this:

    Code:
    zabbix@xxxxxx:~$ ps -ef |grep zabbix
    zabbix    4743     1  0 Nov03 ?        00:00:00 /usr/sbin/zabbix_agentd
    zabbix    4745  4743  0 Nov03 ?        00:00:11 /usr/sbin/zabbix_agentd
    zabbix    4746  4743  0 Nov03 ?        00:00:00 /usr/sbin/zabbix_agentd
    zabbix    4747  4743  0 Nov03 ?        00:00:00 /usr/sbin/zabbix_agentd
    zabbix    4748  4743  0 Nov03 ?        00:00:00 /usr/sbin/zabbix_agentd
    zabbix    4749  4743  0 Nov03 ?        00:00:19 /usr/sbin/zabbix_agentd
    zabbix    5337     1  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5338  5337  0 Nov03 ?        00:00:02 /usr/sbin/zabbix_proxy
    zabbix    5339  5337  0 Nov03 ?        00:05:37 /usr/sbin/zabbix_proxy
    zabbix    5340  5337  0 Nov03 ?        00:05:42 /usr/sbin/zabbix_proxy
    zabbix    5341  5337  0 Nov03 ?        00:04:35 /usr/sbin/zabbix_proxy
    zabbix    5342  5337  0 Nov03 ?        00:04:43 /usr/sbin/zabbix_proxy
    zabbix    5343  5337  0 Nov03 ?        00:03:19 /usr/sbin/zabbix_proxy
    zabbix    5344  5337  0 Nov03 ?        00:04:24 /usr/sbin/zabbix_proxy
    zabbix    5345  5337  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5346  5337  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5347  5337  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5348  5337  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5349  5337  0 Nov03 ?        00:00:07 /usr/sbin/zabbix_proxy
    zabbix    5350  5337  0 Nov03 ?        00:00:06 /usr/sbin/zabbix_proxy
    zabbix    5351  5337  0 Nov03 ?        00:00:01 /usr/sbin/zabbix_proxy
    zabbix    5352  5337  0 Nov03 ?        00:04:14 /usr/sbin/zabbix_proxy
    zabbix    5353  5337  0 Nov03 ?        00:00:02 /usr/sbin/zabbix_proxy
    root     30043  4580  1 15:06 ?        00:00:00 sshd: zabbix [priv]
    zabbix   30045 30043  0 15:06 ?        00:00:00 sshd: zabbix@pts/0
    zabbix   30046 30045  8 15:06 pts/0    00:00:00 -bash
    zabbix   30062 30046  0 15:06 pts/0    00:00:00 ps -ef
    zabbix   30063 30046  0 15:06 pts/0    00:00:00 grep zabbix
    In your compile example, you skipped showing everything you did from start to finish, so it is hard to tell what you may have missed. I compile and run the proxy on Ubuntu and the following is from start - finish how I get it working. (Starting from after the source has been downloaded and unzipped)

    Create a zabbix database and populate it:
    Code:
    Start mysql – sudo /etc/init.d/mysql start
    sudo mysql
    create database zabbix;
    grant all on zabbix.* to zabbix@’localhost’ identified by ‘yourMySqlpassword’;
    quit;
    From /home/zabbix/zabbix-1.6.1/
    Code:
    cd create/schema
    cat mysql.sql | mysql -uzabbix -pYourMySqlpassword zabbix
    cd ../data
    cat data.sql | mysql -uzabbix -pYourMySqlpassword zabbix
    cat images_mysql.sql | mysql -uzabbix -pYourMySqlpassword zabbix
    Configure, compile and install the server: (Type it in manually. C&P can get funky)
    Code:
        cd ../..
       ./configure  --prefix=/usr  --with-mysql  --with-net-snmp
        --enable-proxy --enable-agent  
       make
       sudo make install
    Prepare the rest of the system:
    sudo nano /etc/services
    Add at the end:
    Code:
    zabbix_agent 10050/tcp	 # Zabbix ports
    zabbix_trap 10051/tcp
    Save and exit.
    Make and chown dirs:
    Code:
    sudo mkdir /etc/zabbix
    sudo chown -R zabbix.zabbix /etc/zabbix/
    cp misc/conf/zabbix_* /etc/zabbix/
    Copy the init.d scripts to the right spot: Note that in the first copy statement, we are copying the zabbix-server script to the zabbix-proxy script. The server script won't be used and the compile doesn't generate a proxy script.
    Code:
    sudo cp misc/init.d/debian/zabbix-server /etc/init.d/zabbix-proxy
    sudo cp misc/init.d/debian/zabbix-agent /etc/init.d/zabbix-agent
    Edit the zabbix-proxy script and replace all instances of “zabbix-server” with “zabbix-proxy”.
    Code:
    sudo nano /etc/init.d/zabbix-proxy
    Also change the following:
    In zabbix-proxy and zabbix-agent
    Code:
    Look for the following line: 
    DAEMON=/home/zabbix/bin/${NAME}
    and replace it with: 
    DAEMON=/usr/sbin/${NAME}
    Save and exit.

    Now set the correct permissions and set ZABBIX to start when the machine boots:
    Code:
     
    sudo chmod 755 /etc/init.d/zabbix-proxy
    sudo update-rc.d zabbix-proxy defaults
    
    sudo chmod 755 /etc/init.d/zabbix-agent
    sudo update-rc.d zabbix-agent defaults
    Edit the configuration files:


    Change the settings for the Proxy:
    nano /etc/zabbix/zabbix_proxy.conf
    Code:
    Server=xxx.xxx.xxx.xxx
    Hostname=xxxxx
    DBname=zabbix
    DBuser =zabbix
    DBpassword=password  (Uncomment this line and enter password if used)
    Change the settings for the agent:
    nano /etc/zabbix/zabbix_agentd.conf
    Code:
    Server=xxx.xxx.xxx.xxx
    Hostname=xxxxx
    uncomment the userparameter lines at the end of the file.

    Start the services :
    Code:
    sudo /etc/init.d/zabbix-proxy start
    sudo /etc/init.d/zabbix-agent start
    Now check to make sure that they are running:
    ps -ef | grep zabbix
    Last edited by tchjts1; 25-11-2008, 01:51.

    Comment

    • overnet
      Member
      • Mar 2008
      • 33

      #3
      Thanks so much for your great help I really appreciate it.

      This was the missing piece:

      Code:
      sudo cp misc/init.d/debian/zabbix-server /etc/init.d/zabbix-proxy
      I don't recall seeing it in the manual.

      Right now I converted the database to use the nodes. In your experience would be easy to switch back to proxy in case I found node hard to manage?

      Thank you again for your great help.

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Originally posted by overnet
        I don't recall seeing it in the manual.

        Right now I converted the database to use the nodes. In your experience would be easy to switch back to proxy in case I found node hard to manage?

        Thank you again for your great help.
        Yeah, it's not really a manual, but more of a reference guide.

        The code I posted is credited to spascoe who placed the bulk of that on the Zabbix Wiki at this url http://www.zabbix.com/wiki/doku.php?...:ubuntuinstall

        I simply modified it to suit my needs and edited it for proxy/agent only compile.

        As to your question for switching back from nodes... I can't answer that as I haven't done it.

        Comment

        • overnet
          Member
          • Mar 2008
          • 33

          #5
          Thank you for your help, and posting the link to the wiki.

          I try to play with nodes and proxies, and see how this will go.

          Comment

          • overnet
            Member
            • Mar 2008
            • 33

            #6
            I followed the exact steps to enable proxy but when I run

            # /etc/init.d/zabbix-proxy start
            I got this
            Starting Zabbix proxy daemon: zabbix_proxy

            But I did

            Code:
            ps -ef | grep zabbix
            I was able only to see zabbix_agentd but not zabbix_proxy, did I miss anything?

            Here are excerpts from zabbix_proxy.conf and zabbix-proxy:

            zabbix-proxy

            Code:
            NAME=zabbix_proxy
            PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
            DAEMON=/usr/sbin/${NAME}
            DESC="Zabbix proxy daemon"
            PID=/var/tmp/$NAME.pid

            zabbix_proxy.conf

            Code:
            # IP address (or hostname) of ZABBIX servers.
            #This is not the proxy server per this entry in wiki [url]http://www.zabbix.com/wiki/doku.php?id=howto:zabbix_proxy_on_debian_sqlite[/url]
            Server=10.10.1.5
            
            Hostname=zabproxy
            
            # Database host name
            # Default is localhost
            # Proxy DB
            DBHost=10.10.1.10
            
            # Database name
            # SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
            DBName=proxy
            
            # Database user
            
            DBUser=zabbix
            
            # Database password
            DBPassword=zabbix
            Last edited by overnet; 25-11-2008, 20:24.

            Comment

            • tchjts1
              Senior Member
              • May 2008
              • 1605

              #7
              Originally posted by overnet
              I followed the exact steps to enable proxy but when I run



              I got this
              Starting Zabbix proxy daemon: zabbix_proxy

              But I did

              Code:
              ps -ef | grep zabbix
              I was able only to see zabbix_agentd but not zabbix_proxy, did I miss anything?

              Here are excerpts from zabbix_proxy.conf and zabbix-proxy:

              zabbix-proxy

              Code:
              NAME=zabbix_proxy
              PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
              DAEMON=/usr/sbin/${NAME}
              DESC="Zabbix proxy daemon"
              PID=/var/tmp/$NAME.pid

              zabbix_proxy.conf

              Code:
              # IP address (or hostname) of ZABBIX servers.
              #This is not the proxy server per this entry in wiki [url]http://www.zabbix.com/wiki/doku.php?id=howto:zabbix_proxy_on_debian_sqlite[/url]
              Server=10.10.1.5
              
              Hostname=zabproxy
              
              # Database host name
              # Default is localhost
              # Proxy DB
              DBHost=10.10.1.10
              
              # Database name
              # SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
              DBName=proxy
              
              # Database user
              
              DBUser=zabbix
              
              # Database password
              DBPassword=zabbix

              Hmmm. I am not sure on that one. Looks like you have your DB on a separate server than your Zabbix server and your proxy, correct?

              For my proxy servers, I have MySql running on them and keep the DB local for that. That reflects the compile settings and options in my original post. May very well be that you'd have to modify some of these statements:

              Code:
              Start mysql – sudo /etc/init.d/mysql start
              sudo mysql
              create database zabbix;
              grant all on zabbix.* to zabbix@’localhost’ identified by ‘yourMySqlpassword’;
              quit;
              
              From /home/zabbix/zabbix-1.6.1/
              
              cd create/schema
              cat mysql.sql | mysql -uzabbix -pYourMySqlpassword zabbix
              cd ../data
              cat data.sql | mysql -uzabbix -pYourMySqlpassword zabbix
              cat images_mysql.sql | mysql -uzabbix -pYourMySqlpassword zabbix
              One thing I notice is that your DBname is Proxy and in my compile instructions, mine is named zabbix You did change that to reflect your DBname, right?

              Outside of that, I am not sure what to tell you except that the above schema configurations would need to be done on the server where your MySql lives.

              Comment

              • overnet
                Member
                • Mar 2008
                • 33

                #8
                Hmmm. I am not sure on that one. Looks like you have your DB on a separate server than your Zabbix server and your proxy, correct?
                I wasn't exactly sure about the DBs, so I used my Zabbix's Server DB for my proxy as well, so now both are using the same DB. I will try now using the local DB for proxy server, and leave the Zabbix server DB alone and see how it goes.

                Thank you for the help tchjts1, highly appreciate it.

                Comment

                • tchjts1
                  Senior Member
                  • May 2008
                  • 1605

                  #9
                  Check your private messages. Top right of your screen is the link.

                  Comment

                  • overnet
                    Member
                    • Mar 2008
                    • 33

                    #10
                    Originally posted by tchjts1
                    Check your private messages. Top right of your screen is the link.

                    Thank you tchjts1, its working now:

                    Code:
                    zabbix    8725  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8726  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8729  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8731  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8733  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8736  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8738  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8740  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8742  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8744  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8745  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8747  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8748  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8749  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8750  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix    8751  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                    zabbix   25164     1  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                    zabbix   25165 25164  0 10:06 ?        00:00:02 /usr/sbin/zabbix_agentd
                    zabbix   25166 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                    zabbix   25167 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                    zabbix   25168 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                    zabbix   25169 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd

                    Comment

                    • foudendorp
                      Junior Member
                      • Jul 2009
                      • 3

                      #11
                      Originally posted by overnet
                      Thank you tchjts1, its working now:

                      Code:
                      zabbix    8725  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8726  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8729  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8731  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8733  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8736  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8738  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8740  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8742  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8744  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8745  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8747  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8748  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8749  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8750  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix    8751  8715  0 12:11 ?        00:00:00 /usr/sbin/zabbix_proxy
                      zabbix   25164     1  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                      zabbix   25165 25164  0 10:06 ?        00:00:02 /usr/sbin/zabbix_agentd
                      zabbix   25166 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                      zabbix   25167 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                      zabbix   25168 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                      zabbix   25169 25164  0 10:06 ?        00:00:00 /usr/sbin/zabbix_agentd
                      What was the provided solution? I've exactly the same problem.

                      Comment

                      • tchjts1
                        Senior Member
                        • May 2008
                        • 1605

                        #12
                        It's been awhile since that thread, but I believe it was an issue with his compile. I've sent you the install/compile instructions to your e-mail.

                        Comment

                        Working...