Ad Widget

Collapse

Help! Unable to start zabbix agent with "permission denied" error message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roose
    Junior Member
    • Mar 2013
    • 9

    #1

    Help! Unable to start zabbix agent with "permission denied" error message

    Hi All,

    I am trying to setup a Zabbix server (2.0.5) running on a Fedora 18 box. I installed zabbix components via yum with Fedora's default repository, and I am now able to successfully start the zabbix server. However, I am stuck on starting the zabbix agent!

    Everytime I start the agent, the zabbix_agentd.log file will say:

    Code:
    zabbix_agentd [15308]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [2] No such file or directory
    zabbix_agentd [1734]: cannot create PID file [/tmp/zabbix_agentd.pid]: [13] Permission denied
    I have tried to modify /etc/zabbix_agentd.conf, and played around PidFile parameter, but it still gives me a similar error.

    I have also tried to create /var/run/zabbix directory, did chown -R zabbix and chgrp -R zabbix on it, but still the same problem.

    Rebooting it does not help either.

    I have been doing research on this problem on the internet and this forum, but I can not seem to find the solution.

    Can someone help me on this? Thanks in advance for your help!

    Content of my zabbix_agentd.conf:
    Code:
    # This is a config file for the Zabbix agent daemon (Unix)
    # To get more information about Zabbix, visit http://www.zabbix.com
    
    ############ GENERAL PARAMETERS #################
    
    ### Option: PidFile
    #       Name of PID file.
    #
    # Mandatory: no
    # Default:
    #PidFile=/var/run/zabbix/zabbix_agentd.pid
    PidFile=/tmp/zabbix/zabbix_agentd.pid
    
    ### Option: LogFile
    #       Name of log file.
    #       If not set, syslog is used.
    #
    # Mandatory: no
    # Default:
    # LogFile=
    
    LogFile=/var/log/zabbix/zabbix_agentd.log
    
    ### Option: LogFileSize
    #       Maximum size of log file in MB.
    #       0 - disable automatic log rotation.
    #
    # Mandatory: no
    # Range: 0-1024
    # Default:
    LogFileSize=1024
    
    ### 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
    DebugLevel=4
    
    ### Option: SourceIP
    #       Source IP address for outgoing connections.
    #
    # Mandatory: no
    # Default:
    # SourceIP=
    
    ### Option: EnableRemoteCommands
    #       Whether remote commands from Zabbix server are allowed.
    #       0 - not allowed
    #       1 - allowed
    #
    # Mandatory: no
    # Default:
    # EnableRemoteCommands=0
    
    ### Option: LogRemoteCommands
    #       Enable logging of executed shell commands as warnings.
    #       0 - disabled
    #       1 - enabled
    #
    # Mandatory: no
    # Default:
    # LogRemoteCommands=0
    
    ##### Passive checks related
    
    ### Option: Server
    #       List of comma delimited IP addresses (or hostnames) of Zabbix servers.
    #       Incoming connections will be accepted only from the hosts listed here.
    #       No spaces allowed.
    #       If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
    #
    # Mandatory: no
    # Default:
    # Server=
    
    Server=127.0.0.1
    
    ### Option: ListenPort
    #       Agent will listen on this port for connections from the server.
    #
    # Mandatory: no
    # Range: 1024-32767
    # Default:
    # ListenPort=10050
    
    ### Option: ListenIP
    #       List of comma delimited IP addresses that the agent should listen on.
    #       First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks.
    #
    # Mandatory: no
    # Default:
    # ListenIP=0.0.0.0
    
    ### Option: StartAgents
    #       Number of pre-forked instances of zabbix_agentd that process passive checks.
    #       If set to 0, disables passive checks and the agent will not listen on any TCP port.
    #
    # Mandatory: no
    # Range: 0-100
    # Default:
    # StartAgents=3
    
    ##### Active checks related
    
    ### Option: ServerActive
    #       List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.
    #       If port is not specified, default port is used.
    #       IPv6 addresses must be enclosed in square brackets if port for that host is specified.
    #       If port is not specified, square brackets for IPv6 addresses are optional.
    #       If this parameter is not specified, active checks are disabled.
    #       Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
    #
    # Mandatory: no
    # Default:
    # ServerActive=
    
    ServerActive=127.0.0.1
    
    ### Option: Hostname
    #       Unique, case sensitive hostname.
    #       Required for active checks and must match hostname as configured on the server.
    #       Value is acquired from HostnameItem if undefined.
    #
    # Mandatory: no
    # Default:
    # Hostname=
    
    Hostname=Zabbix server
    
    ### Option: HostnameItem
    #       Item used for generating Hostname if it is undefined.
    #       Ignored if Hostname is defined.
    #
    # Mandatory: no
    # Default:
    # HostnameItem=system.hostname
    
    ### Option: RefreshActiveChecks
    #       How often list of active checks is refreshed, in seconds.
    #
    # Mandatory: no
    # Range: 60-3600
    # Default:
    # RefreshActiveChecks=120
    
    ### Option: BufferSend
    #       Do not keep data longer than N seconds in buffer.
    #
    # Mandatory: no
    # Range: 1-3600
    # Default:
    # BufferSend=5
    
    ### Option: BufferSize
    #       Maximum number of values in a memory buffer. The agent will send
    #       all collected data to Zabbix Server or Proxy if the buffer is full.
    #
    # Mandatory: no
    # Range: 2-65535
    # Default:
    # BufferSize=100
    
    ### Option: MaxLinesPerSecond
    #       Maximum number of new lines the agent will send per second to Zabbix Server
    #       or Proxy processing 'log' and 'logrt' active checks.
    #       The provided value will be overridden by the parameter 'maxlines',
    #       provided in 'log' or 'logrt' item keys.
    #
    # Mandatory: no
    # Range: 1-1000
    # Default:
    # MaxLinesPerSecond=100
    
    ### Option: AllowRoot
    #       Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent
    #       will try to switch to user 'zabbix' instead. Has no effect if started under a regular user.
    #       0 - do not allow
    #       1 - allow
    #
    # Mandatory: no
    # Default:
    # AllowRoot=0
    
    ############ ADVANCED PARAMETERS #################
    
    ### Option: Alias
    #       Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.
    #
    # Mandatory: no
    # Range:
    # Default:
    
    ### Option: Timeout
    #       Spend no more than Timeout seconds on processing
    #
    # Mandatory: no
    # Range: 1-30
    # Default:
    # Timeout=3
    
    ### 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_agentd.userparams.conf
    # Include=/etc/zabbix_agentd.conf.d/
    
    ####### USER-DEFINED MONITORED PARAMETERS #######
    
    ### Option: UnsafeUserParameters
    #       Allow all characters to be passed in arguments to user-defined parameters.
    #       0 - do not allow
    #       1 - allow
    #
    # Mandatory: no
    # Range: 0-1
    # Default:
    # UnsafeUserParameters=0
    
    ### Option: UserParameter
    #       User-defined parameter to monitor. There can be several user-defined parameters.
    #       Format: UserParameter=<key>,<shell command>
    #       See 'zabbix_agentd' directory for examples.
    #
    # Mandatory: no
    # Default:
    # UserParameter=
  • Colttt
    Senior Member
    Zabbix Certified Specialist
    • Mar 2009
    • 878

    #2
    please post the output from ls -la /var/run
    Debian-User

    Sorry for my bad english

    Comment

    • roose
      Junior Member
      • Mar 2013
      • 9

      #3
      ls -la

      Hi Coltt,

      Here is the result of the command:

      Code:
      [root@m1xx118 zabbix]# ls -la /var/run
      lrwxrwxrwx. 1 root root 6 Jan 10 01:14 /var/run -> ../run
      [root@m1xx118 zabbix]#

      Comment

      • Colttt
        Senior Member
        Zabbix Certified Specialist
        • Mar 2009
        • 878

        #4
        sorry i mean /var/run/
        Debian-User

        Sorry for my bad english

        Comment

        • roose
          Junior Member
          • Mar 2013
          • 9

          #5
          Hi Colttt,

          Here it is:

          Code:
          [root@m1xx118 zabbix]# ls -la /var/run/
          total 72
          drwxr-xr-x. 39 root   root    1280 Apr 19 12:11 .
          dr-xr-xr-x. 18 root   root    4096 Apr 19 12:08 ..
          drwxr-xr-x.  2 root   root     100 Apr 19 12:07 abrt
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 atd.pid
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 auditd.pid
          drwxr-xr-x.  2 avahi  avahi     80 Apr 19 12:07 avahi-daemon
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 console
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 crond.pid
          ----------.  1 root   root       0 Apr 19 12:07 cron.reboot
          drwxr-xr-x.  3 root   lp        80 Apr 19 12:07 cups
          drwxr-xr-x.  2 root   root      60 Apr 19 12:07 dbus
          -rw-r--r--.  1 root   root       5 Apr 19 12:07 dhclient-em1.pid
          prw-------.  1 root   root       0 Apr 19 12:07 dmeventd-client
          prw-------.  1 root   root       0 Apr 19 12:07 dmeventd-server
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 faillock
          -rw-r--r--.  1 root   root       3 Apr 19 12:07 firewalld.pid
          drwx--x--x.  4 root   root     100 Apr 19 12:07 gdm
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 gdm.pid
          drwx--x---.  3 root   apache   100 Apr 19 12:08 httpd
          drwxr-xr-x.  2 root   root      80 Apr 19 12:07 initramfs
          -rw-------.  1 root   root       4 Apr 19 12:07 iscsid.pid
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 iscsiuio.pid
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 ksmtune.pid
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 libgpod
          drwxr-xr-x.  3 root   root     100 Apr 19 12:07 libvirt
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 libvirtd.pid
          drwxr-xr-x.  6 root   root     120 Apr 19 12:07 lock
          drwxr-xr-x.  3 root   root      60 Apr 19 12:07 log
          drwx------.  2 root   root      60 Apr 19 12:07 lvm
          srwxr-xr-x.  1 root   root       0 Apr 19 12:07 mcelog-client
          -rw-r--r--.  1 root   root       3 Apr 19 12:07 mcelog.pid
          drwx--x---.  2 root   root      40 Apr 19 12:07 mdadm
          drwxr-xr-x.  2 root   root      80 Apr 19 12:07 mount
          drwxr-xr-x.  2 mysql  mysql     60 Apr 19 12:08 mysqld
          drwxrwxr-x.  2 root   root      40 Apr 19 12:07 netreport
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 NetworkManager
          drwx--x---.  2 root   openvpn   40 Apr 19 12:07 openvpn
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 plymouth
          drwxr-xr-x.  4 root   root      80 Apr 19 12:07 pm-utils
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 ppp
          drwxr-x---.  2 root   root      40 Apr 19 12:07 pptp
          drwxr-xr-x.  2 radvd  radvd     40 Apr 19 12:07 radvd
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 restorecond.pid
          -r--r--r--.  1 root   root       0 Apr 19 12:07 rpcbind.lock
          srw-rw-rw-.  1 root   root       0 Apr 19 12:07 rpcbind.sock
          -rw-r--r--.  1 root   root       0 Apr 19 12:07 rpc.statd.pid
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 samba
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 saslauthd
          srw-rw-rw-.  1 root   root       0 Apr 19 12:07 sdp
          -rw-------.  1 root   smmsp     33 Apr 19 12:07 sendmail.pid
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 sepermit
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 setrans
          drwxr-xr-x.  2 root   root      60 Apr 19 12:11 setroubleshoot
          -rw-r--r--.  1 smmsp  smmsp     49 Apr 19 12:07 sm-client.pid
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 spice-vdagentd
          -rw-r--r--.  1 root   root       5 Apr 19 12:07 sshd.pid
          -rw-r--r--.  1 root   root       4 Apr 19 12:07 syslogd.pid
          drwxr-xr-x. 13 root   root     300 Apr 19 12:11 systemd
          drwxr-xr-x.  6 root   root     160 Apr 19 13:23 udev
          drwx------.  2 root   root      40 Apr 19 12:08 udisks2
          drwxr-xr-x.  4 root   root      80 Apr 19 12:08 user
          -rw-rw-r--.  1 root   utmp    1920 Apr 19 13:22 utmp
          drwxr-xr-x.  2 root   root      40 Apr 19 12:07 vpnc
          drwxr-xr-x.  2 zabbix zabbix    40 Apr 19 12:07 zabbix
          [root@m1xx118 zabbix]#

          Comment

          • Colttt
            Senior Member
            Zabbix Certified Specialist
            • Mar 2009
            • 878

            #6
            hmm ok, are you sure that is nothing in the /var/run/zabbix/ ?

            zabbix_agentd start with the right configuration(config-file)?
            Debian-User

            Sorry for my bad english

            Comment

            • roose
              Junior Member
              • Mar 2013
              • 9

              #7
              Hi Colttt,

              I tried to create the ZABBIX_agentd.pid file inside that directory while I was testing, so, there is one file there.

              I tried to put DEBUG=4 on the /etc/zabbix_agentd.conf but it is not showing much in the log file.

              So, how would I know whether it is starting normally when putting debug on the conf file is not giving much anything either?
              Last edited by roose; 19-04-2013, 17:28.

              Comment

              • roose
                Junior Member
                • Mar 2013
                • 9

                #8
                Manual start working

                Okay, as mentioned, I installed zabbix through Fedora yum package, so whenever I want to start zabbix-agent, I did a

                Code:
                # service zabbix-agent start
                Using this will produce this error.

                So, I tried manually executing it via

                Code:
                # /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
                and it finally worked!

                So, question now is, when I execute the command service zabbix-agent start, which .conf file is it looking at? Can someone else enlighten me on this? Thanks again for your help!

                Comment

                • rulo4
                  Junior Member
                  • Apr 2013
                  • 3

                  #9
                  Fixed this problem

                  Whit the command:

                  Code:
                  setenforce 0
                  and then restarting the httpd service.

                  I have no idea why it works, but it works.

                  I hope also for you.

                  Comment

                  • neogan
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Sep 2011
                    • 118

                    #10
                    Originally posted by roose
                    Okay, as mentioned, I installed zabbix through Fedora yum package, so whenever I want to start zabbix-agent, I did a

                    Code:
                    # service zabbix-agent start
                    Using this will produce this error.

                    So, I tried manually executing it via

                    Code:
                    # /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
                    and it finally worked!

                    So, question now is, when I execute the command service zabbix-agent start, which .conf file is it looking at? Can someone else enlighten me on this? Thanks again for your help!
                    I think you need check init file. There is also point to where create pid file.

                    Comment

                    Working...