Ad Widget

Collapse

Can't connect to database (zabbix 1.4)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • selectron
    Junior Member
    • May 2007
    • 17

    #1

    Can't connect to database (zabbix 1.4)

    Hi, All!

    I'm new in Zabbix. I installed server and agent on only station, created DB "zabbix" etc. But zabbix_server can't connect to this DB. I see next record in postgresql log file:
    SSL SYSCALL ERROR: there is end of file
    can't obtain data from client: Connection reset by peer

    I hope that anyone will help me. Thanks.
    I use Ubuntu 7.04 and PostgreSQL 8.2.4.

    Sorry for my english.
  • Niels
    Senior Member
    • May 2007
    • 239

    #2
    Please post your zabbix_server.conf

    Comment

    • selectron
      Junior Member
      • May 2007
      • 17

      #3
      # This is config file for ZABBIX server process
      # To get more information about ZABBIX,
      # go http://www.zabbix.com

      ############ GENERAL PARAMETERS #################

      # This defines unique NodeID in distributed setup,
      # Default value 0 (standalone server)
      # This parameter must be between 0 and 999
      #NodeID=0

      # Number of pre-forked instances of pollers
      # Default value is 5
      # This parameter must be between 0 and 255
      #StartPollers=5

      # Number of pre-forked instances of pollers for unreachable hosts
      # Default value is 1
      # This parameter must be between 0 and 255
      #StartPollersUnreachable=1

      # Number of pre-forked instances of trappers
      # Default value is 5
      # This parameter must be between 0 and 255
      #StartTrappers=5

      # Number of pre-forked instances of ICMP pingers
      # Default value is 1
      # This parameter must be between 0 and 255
      #StartPingers=1

      # Number of pre-forked instances of discoverers
      # Default value is 1
      # This parameter must be between 0 and 255
      #StartDiscoverers=1

      # Number of pre-forked instances of HTTP pollers
      # Default value is 1
      # This parameter must be between 0 and 255
      #StartHTTPPollers=1

      # Listen port for trapper. Default port number is 10051. This parameter
      # must be between 1024 and 32767

      ListenPort=10051

      # Listen interface for trapper. Trapper will listen all network interfaces
      # if this parameter is missing.

      ListenIP=127.0.0.1

      # How often ZABBIX will perform housekeeping procedure
      # (in hours)
      # Default value is 1 hour
      # Housekeeping is removing unnecessary information from
      # tables history, alert, and alarms
      # This parameter must be between 1 and 24

      #HousekeepingFrequency=1

      # How often ZABBIX will try to send unsent alerts
      # (in seconds)
      # Default value is 30 seconds
      SenderFrequency=30

      # Uncomment this line to disable housekeeping procedure
      #DisableHousekeeping=1

      # Specifies debug level
      # 0 - debug is not created
      # 1 - critical information
      # 2 - error information
      # 3 - warnings (default)
      # 4 - for debugging (produces lots of information)

      DebugLevel=3

      # Specifies how long we wait for agent response (in sec)
      # Must be between 1 and 30
      Timeout=5

      # Specifies how many seconds trapper may spend processing new data
      # Must be between 1 and 30
      #TrapperTimeout=5

      # After how many seconds of unreachability treat a host as unavailable
      #UnreachablePeriod=45

      # How ofter check host for availability during the unreachability period
      #UnavailableDelay=15

      # How ofter check host for availability during the unavailability period
      #UnavailableDelay=60

      # Name of PID file

      PidFile=/var/tmp/zabbix_server.pid

      # Name of log file
      # If not set, syslog is used

      LogFile=/tmp/zabbix_server.log

      # Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
      #LogFileSize=1

      # Location for custom alert scripts
      AlertScriptsPath=/home/zabbix/bin/

      # Location of external scripts
      #AlertScriptsPath=/etc/zabbix/externalscripts

      # Location of 'fping. Default is /usr/sbin/fping
      # Make sure that fping binary has root permissions and SUID flag set
      #FpingLocation=/usr/sbin/fping

      # Frequency of ICMP pings (item keys 'icmpping' and 'icmppingsec'). Defauls is 60 seconds.
      #PingerFrequency=60

      # Database host name
      # Default is localhost

      DBHost=localhost

      # Database name
      # SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
      DBName=zabbix

      # Database user

      DBUser=zabbix

      # Database password
      # Comment this line if no password used

      #DBPassword=mogil14

      # Connect to MySQL using Unix socket?

      #DBSocket=/tmp/mysql.sock

      Comment

      • NOB
        Senior Member
        Zabbix Certified Specialist
        • Mar 2007
        • 469

        #4
        Originally posted by selectron
        # This is config file for ZABBIX server process
        # To get more information about ZABBIX,
        # go http://www.zabbix.com

        ############ GENERAL PARAMETERS #################

        [NB: a lot of stuff deleted]

        # Database user

        DBUser=zabbix

        # Database password
        # Comment this line if no password used

        #DBPassword=mogil14

        # Connect to MySQL using Unix socket?

        #DBSocket=/tmp/mysql.sock
        I guess you should set the DBPassword and change the name of the user, if it is not
        "zabbix" !

        HTH,

        Norbert.
        Last edited by NOB; 07-06-2007, 14:48. Reason: Added line with DBUser

        Comment

        • selectron
          Junior Member
          • May 2007
          • 17

          #5
          hmmm

          Line "DBPassword=mogil14" commented in server config file.
          My database itself doesn't have password. It was created by user "zabbix". Аnd when I open database "zabbix" follow:
          $su zabbix
          $psql zabbix
          then all work good and there are no errors in postgres log file.
          This problem appears when user "zabbix" opens database "zabbix".

          Sorry for my english.

          Comment

          • selectron
            Junior Member
            • May 2007
            • 17

            #6
            Hello!

            I think, that I have killed this trouble. I experemented. When I commented line
            "DBHost=localhost" then all begin to work good.
            At this time I see in output
            #ps -ae | grep "zabbix"
            zabbix_server processes and zabbix_agentd processes.
            But I can't see Zabbix in browser (Firefox).
            I type in browser address line
            "127.0.0.1/zabbix" or "127.0.0.1/~zabbix"
            and I see "Not Found
            The requested URL /zabbix was not found on this server.
            Apache/2.2.3 (Ubuntu) PHP/5.2.1 Server at 127.0.0.1 Port 80"

            Please, tell me, where is my error?
            Thanks

            Sorry for my english.

            Comment

            • Niels
              Senior Member
              • May 2007
              • 239

              #7
              Did you copy (or link) frontends/php to your webserver's document root?

              Comment

              • selectron
                Junior Member
                • May 2007
                • 17

                #8
                I did follow:

                #cp -R frontends/php/* /home/zabbix/public_html/
                #cd ../public_html && chown -R zabbix .

                I saw this recomendation here:
                Network Monitoring With Zabbix Zabbix has the capability to monitor just a about any event on your network from network traffic to how many papers a...


                Is it no rigth?

                Comment

                • Niels
                  Senior Member
                  • May 2007
                  • 239

                  #9
                  That guide also tell you how to configure Apache so that it serves /home/<user>/public_html -- did you do that?

                  What do you get if you simply browse to 127.0.0.1?

                  Comment

                  • selectron
                    Junior Member
                    • May 2007
                    • 17

                    #10
                    If I simply browse 127.0.0.1 then I get follow:
                    "Index of /
                    [ICO] Name Last modified Size Description
                    [DIR] apache2-default/ 20-Nov-2004 23:16 -
                    Apache/2.2.3 (Ubuntu) PHP/5.2.1 Server at 127.0.0.1 Port 80"

                    After I open apache2-default directory and see words "It works!"

                    Comment

                    • Niels
                      Senior Member
                      • May 2007
                      • 239

                      #11
                      OK, so we know that the apache-default folder is being served, but not /home/zabbix/public_html.

                      You can either copy frontends/php to the apache-default folder, or you can try to figure out why your Directory configuration doesn't work. I'd go for the first, for now.

                      Comment

                      • selectron
                        Junior Member
                        • May 2007
                        • 17

                        #12
                        Thank you, Niels.

                        But may bee I not understand where I must copy directory "frontends/php".
                        Write full path, please.

                        I copyed frontends/php/* to /home/zabbix/public_html/.
                        And I edited /etc/apach2/httpd.conf

                        Where must I copy this directory yet?

                        Sorry for english.

                        Comment

                        • Niels
                          Senior Member
                          • May 2007
                          • 239

                          #13
                          You copied to /home/zabbix/public_html/, and configured your webserver to serve that folder. But it isn't working.

                          We know that the apache-default folder is being served correctly, so if you put the frontend in there, things should work.

                          This should work:
                          cp -R frontends/php/* /var/www/

                          (better yet: make a zabbix folder in www)

                          Comment

                          • selectron
                            Junior Member
                            • May 2007
                            • 17

                            #14
                            Niels, thank you so much.
                            I've ran zabbix and I see images like as in manual.
                            I didn't see that in manual say about /var/www.
                            May bee it is because of my bad english.

                            Comment

                            • Niels
                              Senior Member
                              • May 2007
                              • 239

                              #15
                              That's because different distributions have different default configurations for Apache. You're on Ubuntu, which uses /var/www.

                              Comment

                              Working...