Ad Widget

Collapse

Zabbix-server-mysql problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aeson
    Junior Member
    • Feb 2013
    • 11

    #1

    Zabbix-server-mysql problems

    Hi,

    I'm trying to setup zabbix 2.0 on fedora 18 (vm).

    I'm trying to debug the error that I get, which is in the GUI:
    'Zabbix server is not running'.

    I allready checked my conf file, checked with the database settings. I disabled SELinux for testing purposes. After making some changes, that I hoped would solve the problem, I suddenly can't restart the zabbix-server-mysql.service.
    I get following error:

    Code:
    Job for zabbix-server-mysql.service failed.
    In the zabbix_server.log I find:
    Code:
    zabbix_server [12207]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
    And indeed there is no directory 'zabbix' in /var/run , but I don't know why?

    I'm getting a bit confused solving my problem,
    can anyone help me or provide me some suggestions? I couldn't find much more on the internet, and the search.

    Thanks.
  • Tux
    Junior Member
    • Jan 2010
    • 15

    #2
    hi,

    what is, if u create that missing directory and try again to start zabbix-server?

    Comment

    • aeson
      Junior Member
      • Feb 2013
      • 11

      #3
      Hi, thanks for helping me. I created the directory /var/run/zabbix .
      I set the correct ownership and rights.
      But I still get the same error.

      I also tried the following steps, which is suggested for the same problem I have, but I few years ago:


      I don't understand why it can make the /var/run/zabbix/zabbix_agentd.pid file, but it can't make the /var/run/zabbix/zabbix_server.pid ?

      Anyone has some more ideas? Thx

      edit: I tried to add the zabbix_server.pid file manually (cp from the agentd.pid, but with other pid value stored). But without succes + after reboot the file is just deleted again.
      Last edited by aeson; 21-02-2013, 19:08. Reason: addition

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Sounds like you either have a directory missing issue, or a permissions issue. Why not just go with the default /tmp directory for the pid?

        As seen in the zabbix_server.conf file:

        Code:
        ### Option: PidFile
        #       Name of PID file.
        #
        # Mandatory: no
        # Default:
        # PidFile=/tmp/zabbix_server.pid

        Comment

        • aeson
          Junior Member
          • Feb 2013
          • 11

          #5
          Hi tchjts1, thanks for the suggestion.

          I changed my config file to match your suggestion, and I still have the problem that the zabbix-server won't start. But I noticed something,
          my logmessages didn't change to the new directory. So I didn't noticed this before (stupid I know), but the server log file isn't being updated anymore.
          So I can't see what is wrong. I checked also the permissions of the logfile, which are set to zabbix:zabbix , I also set for every directory I know zabbix is located to 777. Just for testing purposes.

          But it still won't go up. I don't know where to find debugging information, if the log files aren't updated?

          Comment

          • aeson
            Junior Member
            • Feb 2013
            • 11

            #6
            Maybe it's useful I give some more information:

            the last update the /var/log/zabbix/zabbix_server.log had:
            Code:
            zabbix_server [10388]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [10942]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [10955]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [11645]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [11665]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [12187]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            zabbix_server [12207]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
            The 'service zabbix-server restart' command:
            Code:
            Redirecting to /bin/systemctl restart  zabbix-server.service
            Job for zabbix-server-mysql.service failed. See 'systemctl status zabbix-server-mysql.service' and 'journalctl -n' for details.
            The output from 'systemctl status zabbix-server-mysql.service'
            Code:
            zabbix-server-mysql.service - Zabbix Server with MySQL DB
            	  Loaded: loaded (/usr/lib/systemd/system/zabbix-server-mysql.service; enabled)
            	  Active: failed (Result: exit-code) since Fri, 2013-02-22 13:03:37 CET; 5min ago
            	 Process: 1469 ExecStart=/usr/sbin/zabbix_server (code=exited, status=1/FAILURE)
            	  CGroup: name=systemd:/system/zabbix-server-mysql.service
            
            Feb 22 13:03:37 kvm-076.stepping-stone.ch systemd[1]: Starting Zabbix Server ...
            Feb 22 13:03:37 kvm-076.stepping-stone.ch zabbix_server[1469]: zabbix_server ...
            Feb 22 13:03:37 kvm-076.stepping-stone.ch systemd[1]: zabbix-server-mysql.ser...
            Feb 22 13:03:37 kvm-076.stepping-stone.ch systemd[1]: Failed to start Zabbix ...
            Feb 22 13:03:37 kvm-076.stepping-stone.ch systemd[1]: Unit zabbix-server-mysq...

            The output of 'ls -la /usr/sbin/zabbix_server'
            Code:
            lrwxrwxrwx. 1 root root 31 Feb 20 14:07 /usr/sbin/zabbix_server -> /etc/alternatives/zabbix-server
            The output of 'ls -la /etc/alternatives/zabbix-server'
            Code:
            lrwxrwxrwx. 1 root root 29 Feb 20 14:07 /etc/alternatives/zabbix-server -> /usr/sbin/zabbix_server_mysql
            The output of 'ls -la /usr/sbin/zabbix_server_mysql'
            Code:
            -rwxr-xr-x. 1 root root 1079904 Jan 17 23:12 /usr/sbin/zabbix_server_mysql
            For testing I changed the permissions of the last directory:
            So output of 'ls -la /usr/sbin/zabbix_server_mysql' becomes:
            Code:
            -rwxrwxrwx. 1 root root 1079904 Jan 17 23:12 /usr/sbin/zabbix_server_mysql
            But I still get the same problem.
            Last edited by aeson; 22-02-2013, 14:20. Reason: Addition

            Comment

            • tchjts1
              Senior Member
              • May 2008
              • 1605

              #7
              I am not familiar with the commands that you are using to start Zabbix server.
              I use binaries that I compile on RedHat.

              Anyway, try starting Zabbix server directly through the binary and referencing the conf file. I do that this way, from whatever directory you have your zabbix_server binary in, and then the path to your zabbix_server.conf file...

              Code:
              ./zabbix_server -c /usr/local/etc/zabbix_server.conf
              It also might be helpful if you show us your zabbix_server.conf file contents.
              (You can edit out any password info)
              Last edited by tchjts1; 22-02-2013, 17:04.

              Comment

              • tchjts1
                Senior Member
                • May 2008
                • 1605

                #8
                By the way, you do see that your binaries are owned by root in your message above?

                Comment

                • aeson
                  Junior Member
                  • Feb 2013
                  • 11

                  #9
                  Ok I tried running the zabbix_server binary directly like you suggested,
                  and this works, the server comes up. So first of all: Thank you very much .

                  The commands I used, I got from a tutorial found on a blog, which states how to install zabbix on fedora. That's why I started using them.

                  I do realize the binaries are owned by root, but I thought that because the permissions are set on 777, they were open to anything that wants to execute them?

                  I still post my conf file of the server, just to be sure that it doesn't has any strange things in it.
                  Code:
                  # This is a configuration file for Zabbix Server process
                  # To get more information about Zabbix,
                  # visit http://www.zabbix.com
                  
                  ############ GENERAL PARAMETERS #################
                  
                  ### Option: NodeID
                  #	Unique NodeID in distributed setup.
                  #	0 - standalone server
                  #
                  # Mandatory: no
                  # Range: 0-999
                  # Default:
                  # NodeID=0
                  
                  ### Option: ListenPort
                  #	Listen port for trapper.
                  #
                  # Mandatory: no
                  # Range: 1024-32767
                  # Default:
                  # ListenPort=10051
                  
                  ### Option: SourceIP
                  #	Source IP address for outgoing connections.
                  #
                  # Mandatory: no
                  # Default:
                  # SourceIP=
                  
                  ### Option: LogFile
                  #	Name of log file.
                  #	If not set, syslog is used.
                  #
                  # Mandatory: no
                  # Default:
                  # LogFile=
                  
                  LogFile=/var/log/zabbix/zabbix_server.log
                  
                  ### Option: LogFileSize
                  #	Maximum size of log file in MB.
                  #	0 - disable automatic log rotation.
                  #
                  # Mandatory: no
                  # Range: 0-1024
                  # Default:
                  LogFileSize=0
                  
                  ### Option: DebugLevel
                  #	Specifies debug level
                  #	0 - no debug
                  #	1 - critical information
                  #	2 - error information
                  #	3 - warnings
                  #	4 - for debugging (produces lots of information)
                  #
                  # Mandatory: no
                  # Range: 0-4
                  # Default:
                  # DebugLevel=3
                  
                  ### Option: PidFile
                  #	Name of PID file.
                  #
                  # Mandatory: no
                  # Default:
                  #PidFile=/var/run/zabbix/zabbix_server.pid
                  #PidFile=/var/run/zabbix-server/zabbix_server.pid
                  PidFile=/tmp/zabbix_server.pid
                  
                  ### Option: DBHost
                  #	Database host name.
                  #	If set to localhost, socket is used for MySQL.
                  #	If set to empty string, socket is used for PostgreSQL.
                  #
                  # Mandatory: no
                  # Default:
                  # DBHost=localhost
                  
                  ### Option: DBName
                  #	Database name.
                  #	For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
                  #
                  # Mandatory: yes
                  # Default:
                  # DBName=
                  
                  DBName=zabbix
                  
                  ### Option: DBSchema
                  #	Schema name. Used for IBM DB2.
                  #
                  # Mandatory: no
                  # Default:
                  # DBSchema=
                  
                  ### Option: DBUser
                  #	Database user. Ignored for SQLite.
                  #
                  # Mandatory: no
                  # Default:
                  # DBUser=
                  
                  DBUser=zabbix
                  #DBUser=root
                  
                  ### Option: DBPassword
                  #	Database password. Ignored for SQLite.
                  #	Comment this line if no password is used.
                  #
                  # Mandatory: no
                  # Default:
                  # DBPassword=
                  DBPassword=*****
                  
                  ### Option: DBSocket
                  #	Path to MySQL socket.
                  #
                  # Mandatory: no
                  # Default:
                  DBSocket=/var/lib/mysql/mysql.sock
                  
                  ### Option: DBPort
                  #	Database port when not using local socket. Ignored for SQLite.
                  #
                  # Mandatory: no
                  # Range: 1024-65535
                  # Default (for MySQL):
                  # DBPort=3306
                  
                  ############ ADVANCED PARAMETERS ################
                  
                  ### Option: StartPollers
                  #	Number of pre-forked instances of pollers.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartPollers=5
                  
                  ### Option: StartIPMIPollers
                  #	Number of pre-forked instances of IPMI pollers.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartIPMIPollers=0
                  
                  ### Option: StartPollersUnreachable
                  #	Number of pre-forked instances of pollers for unreachable hosts (including IPMI).
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartPollersUnreachable=1
                  
                  ### Option: StartTrappers
                  #	Number of pre-forked instances of trappers.
                  #	Trappers accept incoming connections from Zabbix sender, active agents, active proxies and child nodes.
                  #	At least one trapper process must be running to display server availability in the frontend.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartTrappers=5
                  
                  ### Option: StartPingers
                  #	Number of pre-forked instances of ICMP pingers.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartPingers=1
                  
                  ### Option: StartDiscoverers
                  #	Number of pre-forked instances of discoverers.
                  #
                  # Mandatory: no
                  # Range: 0-250
                  # Default:
                  # StartDiscoverers=1
                  
                  ### Option: StartHTTPPollers
                  #	Number of pre-forked instances of HTTP pollers.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartHTTPPollers=1
                  
                  ### Option: JavaGateway
                  #	IP address (or hostname) of Zabbix Java gateway.
                  #	Only required if Java pollers are started.
                  #
                  # Mandatory: no
                  # Default:
                  # JavaGateway=
                  
                  ### Option: JavaGatewayPort
                  #	Port that Zabbix Java gateway listens on.
                  #
                  # Mandatory: no
                  # Range: 1024-32767
                  # Default:
                  # JavaGatewayPort=10052
                  
                  ### Option: StartJavaPollers
                  #	Number of pre-forked instances of Java pollers.
                  #
                  # Mandatory: no
                  # Range: 0-1000
                  # Default:
                  # StartJavaPollers=0
                  
                  ### Option: SNMPTrapperFile
                  #	Temporary file used for passing data from SNMP trap daemon to the server.
                  #	Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file.
                  #
                  # Mandatory: no
                  # Default:
                  # SNMPTrapperFile=/tmp/zabbix_traps.tmp
                  
                  ### Option: StartSNMPTrapper
                  #	If 1, SNMP trapper process is started.
                  #
                  # Mandatory: no
                  # Range: 0-1
                  # Default:
                  # StartSNMPTrapper=0
                  
                  ### Option: ListenIP
                  #	List of comma delimited IP addresses that the trapper should listen on.
                  #	Trapper will listen on all network interfaces if this parameter is missing.
                  #
                  # Mandatory: no
                  # Default:
                  # ListenIP=0.0.0.0
                  
                  # ListenIP=127.0.0.1
                  
                  ### Option: HousekeepingFrequency
                  #	How often Zabbix will perform housekeeping procedure (in hours).
                  #	Housekeeping is removing unnecessary information from history, alert, and alarms tables.
                  #
                  # Mandatory: no
                  # Range: 1-24
                  # Default:
                  # HousekeepingFrequency=1
                  
                  ### Option: MaxHousekeeperDelete
                  #	The table "housekeeper" contains "tasks" for housekeeping procedure in the format:
                  #	[housekeeperid], [tablename], [field], [value].
                  #	No more than 'MaxHousekeeperDelete' rows (corresponding to [tablename], [field], [value])
                  #	will be deleted per one task in one housekeeping cycle.
                  #	SQLite3 does not use this parameter, deletes all corresponding rows without a limit.
                  #	If set to 0 then no limit is used at all. In this case you must know what you are doing!
                  #
                  # Mandatory: no
                  # Range: 0-1000000
                  # Default:
                  # MaxHousekeeperDelete=500
                  
                  ### Option: DisableHousekeeping
                  #	If set to 1, disables housekeeping.
                  #
                  # Mandatory: no
                  # Range: 0-1
                  # Default:
                  # DisableHousekeeping=0
                  
                  ### Option: SenderFrequency
                  #	How often Zabbix will try to send unsent alerts (in seconds).
                  #
                  # Mandatory: no
                  # Range: 5-3600
                  # Default:
                  # SenderFrequency=30
                  
                  ### Option: CacheSize
                  #	Size of configuration cache, in bytes.
                  #	Shared memory size for storing host, item and trigger data.
                  #
                  # Mandatory: no
                  # Range: 128K-1G
                  # Default:
                  # CacheSize=8M
                  
                  ### Option: CacheUpdateFrequency
                  #	How often Zabbix will perform update of configuration cache, in seconds.
                  #
                  # Mandatory: no
                  # Range: 1-3600
                  # Default:
                  # CacheUpdateFrequency=60
                  
                  ### Option: StartDBSyncers
                  #	Number of pre-forked instances of DB Syncers
                  #
                  # Mandatory: no
                  # Range: 1-100
                  # Default:
                  # StartDBSyncers=4
                  
                  ### Option: HistoryCacheSize
                  #	Size of history cache, in bytes.
                  #	Shared memory size for storing history data.
                  #
                  # Mandatory: no
                  # Range: 128K-1G
                  # Default:
                  # HistoryCacheSize=8M
                  
                  ### Option: TrendCacheSize
                  #	Size of trend cache, in bytes.
                  #	Shared memory size for storing trends data.
                  #
                  # Mandatory: no
                  # Range: 128K-1G
                  # Default:
                  # TrendCacheSize=4M
                  
                  ### Option: HistoryTextCacheSize
                  #	Size of text history cache, in bytes.
                  #	Shared memory size for storing character, text or log history data.
                  #
                  # Mandatory: no
                  # Range: 128K-1G
                  # Default:
                  # HistoryTextCacheSize=16M
                  
                  ### Option: NodeNoEvents
                  #	If set to '1' local events won't be sent to master node.
                  #	This won't impact ability of this node to propagate events from its child nodes.
                  #
                  # Mandatory: no
                  # Range: 0-1
                  # Default:
                  # NodeNoEvents=0
                  
                  ### Option: NodeNoHistory
                  #	If set to '1' local history won't be sent to master node.
                  #	This won't impact ability of this node to propagate history from its child nodes.
                  #
                  # Mandatory: no
                  # Range: 0-1
                  # Default:
                  # NodeNoHistory=0
                  
                  ### Option: Timeout
                  #	Specifies how long we wait for agent, SNMP device or external check (in seconds).
                  #
                  # Mandatory: no
                  # Range: 1-30
                  # Default:
                  # Timeout=3
                  
                  ### Option: TrapperTimeout
                  #	Specifies how many seconds trapper may spend processing new data.
                  #
                  # Mandatory: no
                  # Range: 1-300
                  # Default:
                  # TrapperTimeout=300
                  
                  ### Option: UnreachablePeriod
                  #	After how many seconds of unreachability treat a host as unavailable.
                  #
                  # Mandatory: no
                  # Range: 1-3600
                  # Default:
                  # UnreachablePeriod=45
                  
                  ### Option: UnavailableDelay
                  #	How often host is checked for availability during the unavailability period, in seconds.
                  #
                  # Mandatory: no
                  # Range: 1-3600
                  # Default:
                  # UnavailableDelay=60
                  
                  ### Option: UnreachableDelay
                  #	How often host is checked for availability during the unreachability period, in seconds.
                  #
                  # Mandatory: no
                  # Range: 1-3600
                  # Default:
                  # UnreachableDelay=15
                  
                  ### Option: AlertScriptsPath
                  #	Full path to location of custom alert scripts.
                  #	Default depends on compilation options.
                  #
                  # Mandatory: no
                  # Default:
                  AlertScriptsPath=/var/lib/zabbixsrv/alertscripts
                  
                  ### Option: ExternalScripts
                  #	Full path to location of external scripts.
                  #	Default depends on compilation options.
                  #
                  # Mandatory: no
                  # Default:
                  ExternalScripts=/var/lib/zabbixsrv/externalscripts
                  
                  ### Option: FpingLocation
                  #	Location of fping.
                  #	Make sure that fping binary has root ownership and SUID flag set.
                  #
                  # Mandatory: no
                  # Default:
                  # FpingLocation=/usr/sbin/fping
                  
                  ### Option: Fping6Location
                  #	Location of fping6.
                  #	Make sure that fping6 binary has root ownership and SUID flag set.
                  #	Make empty if your fping utility is capable to process IPv6 addresses.
                  #
                  # Mandatory: no
                  # Default:
                  # Fping6Location=/usr/sbin/fping6
                  
                  ### Option: SSHKeyLocation
                  #	Location of public and private keys for SSH checks and actions
                  #
                  # Mandatory: no
                  # Default:
                  # SSHKeyLocation=
                  
                  ### Option: LogSlowQueries
                  #	How long a database query may take before being logged (in milliseconds).
                  #	0 - don't log slow queries.
                  #
                  # Mandatory: no
                  # Range: 1-3600000
                  # Default:
                  # LogSlowQueries=0
                  
                  ### Option: TmpDir
                  #	Temporary directory.
                  #
                  # Mandatory: no
                  # Default:
                  # TmpDir=/tmp
                  
                  ### Option: Include
                  #	You may include individual files or all files in a directory in the configuration file.
                  #	Installing Zabbix will create include directory in /etc, unless modified during the compile time.
                  #
                  # Mandatory: no
                  # Default:
                  # Include=
                  
                  # Include=/etc/zabbix_server.general.conf
                  # Include=/etc/zabbix_server.conf.d/
                  
                  ### Option: StartProxyPollers
                  #	Number of pre-forked instances of pollers for passive proxies.
                  #
                  # Mandatory: no
                  # Range: 0-250
                  # Default:
                  # StartProxyPollers=1
                  
                  ### Option: ProxyConfigFrequency
                  #	How often Zabbix Server sends configuration data to a Zabbix Proxy in seconds.
                  #	This parameter is used only for proxies in the passive mode.
                  #
                  # Mandatory: no
                  # Range: 1-3600*24*7
                  # Default:
                  # ProxyConfigFrequency=3600
                  
                  ### Option: ProxyDataFrequency
                  #	How often Zabbix Server requests history data from a Zabbix Proxy in seconds.
                  #	This parameter is used only for proxies in the passive mode.
                  #
                  # Mandatory: no
                  # Range: 1-3600
                  # Default:
                  # ProxyDataFrequency=1

                  Comment

                  • Tux
                    Junior Member
                    • Jan 2010
                    • 15

                    #10
                    i agree to tchjts1. if i remember correctly, then zabbix can“t start with root rights. you need to chown (mabye recursiv for the directory -R) zabbix:zabbix for the binarys and config files, otherwise choose a higher debug level in the zabbix_server conf.

                    Comment

                    • aeson
                      Junior Member
                      • Feb 2013
                      • 11

                      #11
                      Tux thank you for your reply,
                      I will change the ownership of the files and directories.

                      I get new log entries for the server again:
                      Code:
                        2677:20130222:162900.840 cannot send list of active checks to [127.0.0.1]: host [Zabbix server] not monitored
                      So I guess I'm up to the next problem solving , I will take your suggestion and increase the debug level.

                      Thank you both for your help.

                      Comment

                      • Tux
                        Junior Member
                        • Jan 2010
                        • 15

                        #12
                        hehe, you have a lot to do now

                        The error says, that "zabbix-server" is not monitored. just click enable or set the server to "monitored" in (dashboard) :menu>configuration>host. There must be an entry "NOT MONITORED", on the right side for the host (zabbix-server). just click on it, it will change to "monitored" and green up.
                        Last edited by Tux; 22-02-2013, 17:45.

                        Comment

                        • aeson
                          Junior Member
                          • Feb 2013
                          • 11

                          #13
                          Haha thanks,

                          everything is set up now, so I can go off and read the documentation and start working with zabbix.

                          Comment

                          • Tux
                            Junior Member
                            • Jan 2010
                            • 15

                            #14
                            gl & hf

                            Comment

                            • tchjts1
                              Senior Member
                              • May 2008
                              • 1605

                              #15
                              One last thing... in your original post, you mention "Zabbix 2.0" ... I hope you installed 2.0.4 or 2.0.5

                              Comment

                              Working...