Ad Widget

Collapse

Installing Zabbix on Debian Etch (Testing)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cstackpole
    Senior Member
    Zabbix Certified Specialist
    • Oct 2006
    • 225

    #1

    Installing Zabbix on Debian Etch (Testing)

    Hello all,
    After several months of work monitoring many machines, we have decided that it is time for us to upgrade our zabbix server to something that can better handle the load. Before we shutdown the old system I decided to build up a fresh clean test system to ensure that the transition will be smooth. We currently use Debian Etch, so I grabbed the latest net install disc and my old how-to on installing Zabbix. It failed quite miserably. Turns out that my old copy relied on apache and an older php and the packages in the repository ask for apache2 and the latest php_5.

    After trying several things I finally found a method that has worked 3 out of 3 times. Since this is something I have just stumbled upon, I probably have steps that are not required and I might be missing something. I ask that if you find something odd / out of order that you let me know so I can fix it and anyone else who may see this will know about it.

    1) Open command line
    type in: su
    enter your password
    type in: adduser zabbix
    remember the password given

    2) open synaptic (or apt-get)
    For some reason I got a lot of errors if I grouped these steps together. Doing each step one at a time works
    Also make sure that you are up-to-date on all of your packages.
    Install mysql-client mysql-server
    Then install zabbix-frontend-php

    3) Restart the computer. I have been doing a bit more testing, but I am unable to find the exact package that needs restarting for the rest of the install to go smoothly. Restarting the whole system works though.

    4) Open command line
    type in: su
    enter your password
    type in: cd /tmp
    Now we are going to set up the root user password for the MySQL database. There are several ways of doing it, but this method does not leave passwords in the history.
    type in: vi mysql.sh (or some other editor of your choice - nano, emacs, gedit, ect)
    Add these lines to that file
    #!/bin/sh
    mysqladmin -u root password EnterYourPasswordHere
    type in: chmod +x mysql.sh
    type in: ./mysql.sh
    type in: rm mysql.sh

    5) Open Synaptic again (or apt-get)
    install zabbix-server-mysql snmpd
    -it will ask for admin password, enter the password from above ( EnterYourPasswordHere message)
    -it will ask for zabbix password, enter your zabbix password
    add the zabbix password to /etc/zabbix/dbconfig.php

    6) Open a browser and go to localhost/zabbix and you should be good to secure and setup from there.

    If you can help improve this guide, I would be very gratefull. I hope this can be usefull to someone.
  • clahti
    Senior Member
    • Jan 2007
    • 126

    #2
    why don't you post this to the new wiki?

    Comment

    • cstackpole
      Senior Member
      Zabbix Certified Specialist
      • Oct 2006
      • 225

      #3
      Originally posted by clahti
      why don't you post this to the new wiki?
      OK. Done. Thanks for the idea, I was unaware of an offical wiki.
      I have added this to the page:
      http://www.zabbix.com/wiki/doku.php?id=howto:debian

      Please comment, edit, improve anything if you find errors.
      Thanks!
      Last edited by cstackpole; 23-03-2007, 18:57.

      Comment

      • slavoie
        Junior Member
        • Apr 2007
        • 6

        #4
        Adding steps to the guide.

        I will add my coments in red

        After several months of work monitoring many machines, we have decided that it is time for us to upgrade our zabbix server to something that can better handle the load. Before we shutdown the old system I decided to build up a fresh clean test system to ensure that the transition will be smooth. We currently use Debian Etch, so I grabbed the latest net install disc and my old how-to on installing Zabbix. It failed quite miserably. Turns out that my old copy relied on apache and an older php and the packages in the repository ask for apache2 and the latest php_5.

        After trying several things I finally found a method that has worked 3 out of 3 times. Since this is something I have just stumbled upon, I probably have steps that are not required and I might be missing something. I ask that if you find something odd / out of order that you let me know so I can fix it and anyone else who may see this will know about it.


        1) Open command line
        type in: su
        enter your password
        type in: adduser zabbix
        remember the password given

        I know it's silly and you said it above but for people like me that need a step by step

        1.2) Install apache2 "apt-get install apache2"


        2) open synaptic (or apt-get)
        For some reason I got a lot of errors if I grouped these steps together. Doing each step one at a time works
        Also make sure that you are up-to-date on all of your packages.
        Install mysql-client mysql-server

        The post on the WIKI does not have the line below.

        Then install zabbix-frontend-php

        Or the restart but I did not have to restart my machine.

        3) Restart the computer. I have been doing a bit more testing, but I am unable to find the exact package that needs restarting for the rest of the install to go smoothly. Restarting the whole system works though.

        4) Open command line
        type in: su
        enter your password
        type in: cd /tmp
        Now we are going to set up the root user password for the MySQL database. There are several ways of doing it, but this method does not leave passwords in the history.
        type in: vi mysql.sh (or some other editor of your choice - nano, emacs, gedit, ect)
        Add these lines to that file
        #!/bin/sh
        mysqladmin -u root password EnterYourPasswordHere
        type in: chmod +x mysql.sh
        type in: ./mysql.sh
        type in: rm mysql.sh

        5) Open Synaptic again (or apt-get)
        install zabbix-server-mysql snmpd
        -it will ask for admin password, enter the password from above ( EnterYourPasswordHere message)
        -it will ask for zabbix password, enter your zabbix password
        add the zabbix password to /etc/zabbix/dbconfig.php

        Every guide and post seems to point to the idea that when you first go to the website there will be an eula to accept and some configuration, but I have yet to get it. On two seperate OS installs and Zabbix installs, I only get the login to manage the server.

        6) Open a browser and go to localhost/zabbix and you should be good to secure and setup from there.

        If you can help improve this guide, I would be very gratefull. I hope this can be usefull to someone.

        Comment

        • glut0r
          Member
          • Mar 2007
          • 38

          #5
          Originally posted by slavoie
          3) Restart the computer. I have been doing a bit more testing, but I am unable to find the exact package that needs restarting for the rest of the install to go smoothly. Restarting the whole system works though.
          LOL. I thought I'm reading 'installing zabbix on windows', but apparentely I'm not.

          Reboot on Linux and *NIX in general is only required when replacing an old kernel with a new one. NOTHING, I repeat, NOTHING, requires reboot. Installing zabbix-frontend-php may require apache server restart (which is supposed to be done automatically, or by hand with /etc/init.d/apache{2}), but not rebooting a whole machine...

          Comment

          • glut0r
            Member
            • Mar 2007
            • 38

            #6
            type in: adduser zabbix
            remember the password given
            what is this for ? you seem not to use debian, but slackware or other derivative.
            The Right Debian Way is the following (as root):

            Code:
            # aptitude install zabbix-server-mysql
            this command does the following:

            1. downloads any dependencies which are:

            Code:
            # apt-cache depends zabbix-server-mysql
            zabbix-server-mysql
              Depends: libc6
              Depends: libldap2
              Depends: libmysqlclient15off
              Depends: libsnmp9
             |Depends: debconf
              Depends: <debconf-2.0>
                cdebconf
                debconf
              Depends: fping
              Depends: adduser
              Depends: dbconfig-common
              Depends: logrotate
              Suggests: zabbix-frontend-php
              Recommends: mysql-server
              Recommends: snmpd
              Conflicts: zabbix-server-pgsql
            #
            of course you can replace zabbix-server-mysql with zabbix-server-pgsql.
            Aptituding zabbix-server-mysql also creates user as preinst|postinst scripts state. You don't even have to install mysql first, as aptitude is smart, and will install it even though mysql-server is in Recommends: section, which is not mandatory to install. If your aptitude is not configured to install recommends, you will have to install it manually before zabbix-server.

            1.2) Install apache2 "apt-get install apache2"

            2) open synaptic (or apt-get)
            For some reason I got a lot of errors if I grouped these steps together. Doing each step one at a time works
            Also make sure that you are up-to-date on all of your packages.
            Install mysql-client mysql-server
            again, what are these for? things are getting done automatically. IF you use aptitude or synaptic.

            Then install zabbix-frontend-php
            yeah, this one's necessary.


            Now we are going to set up the root user password for the MySQL database. There are several ways of doing it, but this method does not leave passwords in the history.
            type in: vi mysql.sh (or some other editor of your choice - nano, emacs, gedit, ect)
            Add these lines to that file
            #!/bin/sh
            mysqladmin -u root password EnterYourPasswordHere
            type in: chmod +x mysql.sh
            type in: ./mysql.sh
            type in: rm mysql.sh
            why can't we just become root and issue what you've put in this script?
            Why creating something that is not necessary at all?

            5) Open Synaptic again (or apt-get)
            install zabbix-server-mysql snmpd
            -it will ask for admin password, enter the password from above ( EnterYourPasswordHere message)
            -it will ask for zabbix password, enter your zabbix password
            add the zabbix password to /etc/zabbix/dbconfig.php

            Every guide and post seems to point to the idea that when you first go to the website there will be an eula to accept and some configuration, but I have yet to get it. On two seperate OS installs and Zabbix installs, I only get the login to manage the server.



            6) Open a browser and go to localhost/zabbix and you should be good to secure and setup from there.
            Almost agree here.

            Now, a bit of summarization:
            First of all, simple oneliner makes it all installing smoothly:

            Code:
            # aptitude install zabbix-server-mysql zabbix-frontend-php
            Of course you can replace zabbix-server-mysql with zabbix-server-pgsql.
            All dependencies will be downloaded and installed. All necessary pre/configuration will be asked. All databases will be populated. All you have to do, is to set up mysql root password.
            Dudes, make your life easier with Debian.
            There's a bunch of good docs of debian administration and stuff on http://debian.org. Use it and be happy

            Comment

            • slavoie
              Junior Member
              • Apr 2007
              • 6

              #7
              Assuming...

              I make life easier for things that I understand well. I don't fully understand Linux yet.

              Now I know this will offend most here, but truth is I am a %100 totally a Microsoft fan. Yes it's true, I play with Windows all day long as a server admin and Owner of a computer company. I love windows, and always will, but what should make everybody happy is that I am not a fanatic about the big three. Truth is, except for the Mac the way we run is, Windows for business structure desktop, Linux for support services, like Zabbix, and Asterisk, and so on, and a Mac at home. I want on of those new dual core powerbooks bad.

              Ok back to Zabbix, maybe I screwed this up when I did not install zabbix-frontend, but I had to install Apache2 first and then the other stuff. My point to the post was that I thought that the original poster assumed people would know to install Apache2 first or that it was standard. I installed from min boot and did not have it. In reality if I had installed zabbix-server-mysql and zabbix-frontend-php, apache2 would have been installed as well.

              Or maybe im crazy. Ya I think im just crazy.

              Comment

              • glut0r
                Member
                • Mar 2007
                • 38

                #8
                If you feel happy with windows, use it. Everyone eventually gets what he deserves I didn't mean to offend anyone, only to correct some mistakes.

                Comment

                • slavoie
                  Junior Member
                  • Apr 2007
                  • 6

                  #9
                  Thanks

                  No offense taken, thanks for the help.

                  BTW, The reason I love windows is because I own a computer company. What tends to break from time to time and needs virus removal and so on and so on?

                  Comment

                  • cstackpole
                    Senior Member
                    Zabbix Certified Specialist
                    • Oct 2006
                    • 225

                    #10
                    update

                    Hey Guys,
                    Thanks for the comments. I know it has been a while since I first posted but I will try to comment.

                    "Reboot on Linux and *NIX in general is only required when replacing an old kernel with a new one. NOTHING, I repeat, NOTHING, requires reboot." - glut0r

                    I agree. At the time I couldn't figure out what needed to be restarted. I had tried restarting apache, zabbix server and agent, and a few other things but I never figured out the exact package needed for it to work properly. A system restart fixed it. I was hoping someone might be able to tell me which package needed to be restarted....Anyway the last time I tried, restarting just Apache worked. I am drafting up a new howto right now as several things have changed.


                    "
                    Quote:
                    type in: adduser zabbix
                    remember the password given

                    what is this for ? you seem not to use debian, but slackware or other derivative.
                    The Right Debian Way is the following (as root):..." -glut0r

                    Aptitude should set up the user and permissions for you. Using apt-get requires certian things to be setup. You are right in the fact that aptitude does indeed take care of quite a bit of things for the user and in this case may be an easier method of installing. I am considering writing the next howto using Aptitude. However, calling it "The Right Debian Way" is so far off the mark it isn't funny. Aptitude installs a lot more then it should at times and if you are not careful you can get a bloated system in no time flat. Bloat and server do not go well together (esp in an environment where you need every space cpu cycle you can get). I would much rather apt-get a file so I know exactly all of the packages that are required and set things up manually so I know what is on my system.

                    As far as Synaptic, I tend not to run any GUI on my server systems so it is not much use. On the systems I do run a GUI on, I rarely use anything but Synaptic.


                    "why can't we just become root and issue what you've put in this script?
                    Why creating something that is not necessary at all?"

                    The reason why I did it in a script is because anything on the command line is recorded in history logs. In some companies (like where I am) the system passwords are issued to all managers who may have some responsibilites on the box (yeah I am not a fan and I b*tch about it all the time). I do not know how compromised a system may be and I really do not like having things stored in history. Yes there are ways to flush history and yes people will notice if the history disappears every time you log on. Thats a discussion for another time. I did the script to protect against the password being in the command line history. If there are enough people who think that is too difficult and not worth the security then by all means edit the wiki and update it. I will not be offended if it helps others out.

                    "I thought that the original poster assumed people would know to install Apache2 first or that it was standard." -slavoie

                    Apache should have been installed regardless, but I may have left something out as I tend to set up apache on my own first for security and custom settings. I will try to address that with the next howto update.


                    I have begun writing the next version of the HowTo since Lenny is the new testing. However, I have also thought about waiting a bit longer as zabbix 1.4 is in unstable and I received word that it should be heading to testing within the next few weeks. I have not used 1.4 yet so I do not know what new adventures await.

                    Thanks again for the posts! I will try to address everything in the next write up so please check back every once in a while as I would like feed back on the new version.

                    Comment

                    • kdclaver
                      Junior Member
                      • Jul 2007
                      • 9

                      #11
                      Hello,
                      On my debian etch I have installed mysql-server-5.0 and when I try to install zabbix-server-mysql snmpd it try to install mysql-server and not mysql-server-5.0.
                      Can you please help me to install zabbix with mysql-server-5.0 ?

                      Thanks more

                      Comment

                      • bbrendon
                        Senior Member
                        • Sep 2005
                        • 870

                        #12
                        Sounds like more of a debian question. Force the install of mysql5:

                        apt-get install mysql-server-5.0
                        Unofficial Zabbix Expert
                        Blog, Corporate Site

                        Comment

                        • kdclaver
                          Junior Member
                          • Jul 2007
                          • 9

                          #13
                          Unable to access zabbix web page

                          Hello all,
                          I've follow the steps to install on my existing apache2, php5 et mysql-server-5.0 zabbix. I only execute #apt-get install zabbix-server-mysql zabbix-php-frontend snmpd. The system does not ask me any question and when I try to access via http://localhost/zabbix I have the below errors messages :
                          Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'zabbix'@'localhost' (using password: NO) in /usr/share/zabbix/include/db.inc.php on line 32

                          Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'www-data'@'localhost' (using password: NO) in /usr/share/zabbix/include/db.inc.php on line 33

                          Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /usr/share/zabbix/include/db.inc.php on line 33
                          Error connecting to database [Access denied for user 'www-data'@'localhost' (using password: NO)]


                          Can you help me to solve the problem ? Thanks more for your reply.

                          Comment

                          • gescheit
                            Senior Member
                            • Jul 2007
                            • 156

                            #14
                            Edit database section in /etc/zabbix/zabbix_server.conf.

                            Comment

                            • kdclaver
                              Junior Member
                              • Jul 2007
                              • 9

                              #15
                              Thanks for your reply,
                              I can't see any file named zabbix_server.conf the files present in /etc/zabbix are :
                              apache.conf
                              zabbix_agentd.conf
                              zabbix_agent.conf
                              dbconfig.php

                              Perhaps I have forgotten something somewhere during the install.

                              My plateform is : Debian Lenny and I have make installation on a running LAMP server.

                              Thanks for your help

                              Comment

                              Working...