Ad Widget

Collapse

Can't run agent - Cannot create IPC key for agent collector

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • devboy
    Junior Member
    • Oct 2010
    • 11

    #1

    Can't run agent - Cannot create IPC key for agent collector

    Hi,

    I've recently installed Zabbix Server and several agents on our production machines. Today I tried to install the agents on a batch of VMs that we have. These VMs are of a different configuration than the production machines and are running CentOS 5.5 (production are running CentOS 5.4).

    When I get to the point I need to start zabbix_agentd it fails. In the log I find this batch of messages:
    Code:
    zabbix_agentd [9297]: Can not create IPC key for path '/etc/zabbix/zabbix_agentd.conf', try to create for path '.' [Permission denied]
      9297:20101031:142428.035 Zabbix Agent started. Zabbix 1.8.3 (revision 13928).
    zabbix_agentd [9297]: Cannot create IPC key for path [/etc/zabbix/zabbix_agentd.conf] id [l] error [Permission denied]
    zabbix_agentd [9297]: Cannot create IPC key for agent collector
    zabbix_agentd [9997]: Can not create IPC key for path '/etc/zabbix/zabbix_agentd.conf', try to create for path '.' [Permission denied]
      9997:20101031:142853.791 Zabbix Agent started. Zabbix 1.8.3 (revision 13928).
    zabbix_agentd [9997]: Cannot create IPC key for path [/etc/zabbix/zabbix_agentd.conf] id [l] error [Permission denied]
    zabbix_agentd [9997]: Cannot create IPC key for agent collector
    I googled and found regarding stuck semaphores and removed them using ipcrm, but next time I try and run it does the same thing.

    Any idea where this could be coming from? If it's permissions, then permissions on what exactly?

    Cheers,
    DB
  • devboy
    Junior Member
    • Oct 2010
    • 11

    #2
    Solved

    Took me 4 hours but figured it out eventually...
    I was missing permissions on the /etc/zabbix/ where zabbix_agentd.conf resides.

    Did 'chmod -R 755 /etc/zabbix/' and solved it.

    Comment

    • walterheck
      Senior Member
      • Jul 2009
      • 153

      #3
      Hmm, took me a while to figure out as well, going through the same process. Pretty annoying. Are you using the RPM's from http://repo.andrewfarley.com as well?
      Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

      Comment

      • onefang
        Junior Member
        • Feb 2011
        • 1

        #4
        I'm getting the same issue, two of the production servers are reporting that error, the rest are fine. A new install of 1.8.4. All servers had /etc/zabbix copied from the original one I compiled things on. I tried that chmod, but I still get the same errors.

        So, what else should I try?

        Comment

        • devboy
          Junior Member
          • Oct 2010
          • 11

          #5
          I've used this to install the server the first time. Now that I migrated our production I did it from source to not have to disable selinux on the Zabbix Server box (the script demands it for some reason).

          For the client I always installed from source and customized some script for myself.

          Here's the procedure I'm following installing an agent on a vanilla CentOS 5.5. (you might need yum install gcc as well)

          Download, extract and cd into your Zabbix release (verified on 1.8.3 and 1.8.4) and do the following:

          Code:
          sudo ./configure --enable-agent --prefix=/usr/local/zabbix
          sudo make install 
          sudo /usr/sbin/adduser zabbix
          sudo mkdir /etc/zabbix
          sudo cp misc/conf/zabbix_agentd.conf /etc/zabbix
          sudo vi /etc/zabbix/zabbix_agentd.conf
          	Server=your.server.ip
          sudo vi /etc/init.d/zabbix_agentd
          	Paste init.d script from below
          sudo chmod 755 /etc/init.d/zabbix_agentd
          sudo chmod -R 755 /etc/zabbix/
          sudo chkconfig --level 345 zabbix_agentd on
          sudo /sbin/service zabbix_agentd start
          The init.d/zabbix_agentd script:
          Code:
          #!/bin/bash
          #
          # chkconfig: - 55 45
          # description: zabbix_agentd
          # probe: false
          
          # Source function library.
          . /etc/rc.d/init.d/functions
          
          # Source networking configuration.
          . /etc/sysconfig/network
          
          # Check that networking is up. If you are running without a network, comment this out.
          [ "${NETWORKING}" = "no" ] && exit 0
          
          RETVAL=0
          progdir="/usr/local/zabbix/sbin/"
          prog="zabbix_agentd"
          
          start() {
                  # Start daemons.
                  if [ -n "`/sbin/pidof $prog`" ]; then
                          echo -n "$prog: already running"
                          failure $"$prog start"
                          echo
                          return 1
                  fi
                  echo -n $"Starting $prog: "
                  # we can't seem to use daemon here - emulate its functionality
                  su -c $progdir$prog - $USER
                  RETVAL=$?
                  usleep 100000
                  if [ -z "`/sbin/pidof $progdir$prog`" ]; then
                          # The child processes have died after fork()ing, e.g.
                          # because of a broken config file
                          RETVAL=1
                  fi
                  [ $RETVAL -ne 0 ] && failure $"$prog startup"
                  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog && success $"$prog startup"
                  echo
                  return $RETVAL
          }
          stop() {
                  RETVAL=0
                  pid=
                  # Stop daemons.
                  echo -n $"Stopping $prog: "
                  pid=`/sbin/pidof -s $prog`
                  if [ -n "$pid" ]; then
                   kill -TERM $pid
                  else
                   failure $"$prog stop"
                   echo
                   return 1
                  fi
                  RETVAL=$?
                  [ $RETVAL -ne 0 ] && failure $"$prog stop"
                  [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog && success $"$prog stop"
                  echo
                  return $RETVAL
          }
          restart() {
                  stop
          # wait for forked daemons to die
                  usleep 1000000
                  start
          }
          
          # See how we were called.
          case "$1" in
                  start)
                          start
                          ;;
                  stop)
                          stop
                          ;;
                  restart)
                          restart
                          ;;
                  condrestart)
                          [ -f /var/lock/subsys/$prog ] && restart
                          ;;
                  *)
                          echo $"Usage: $0 {start|stop|restart|condrestart}"
                          exit 1
          esac
          
          exit $?
          Disclaimer: I'm no linux guru. I might have done awfully stupid things and will have no idea! Having said that, I'm serving half a million unique users a day with boxes with this setup so...

          Comment

          Working...