Ad Widget

Collapse

Can't connect to agent on CentOS 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Velinath
    Junior Member
    • Sep 2014
    • 2

    #1

    Can't connect to agent on CentOS 7

    Hello!

    I'm running into an interesting issue on my Zabbix monitoring server. I have no trouble connecting to my CentOS 6.5 servers or my Windows servers, but after setting up the agent on CentOS 7, I keep on getting the error "Get value from agent failed: cannot connect to [[CentOS 7 Server IP]:10050]: [111] Connection refused".

    These were the steps I took to get the agent installed:

    Code:
    yum install epel-release
    yum install zabbix22-agent
    
    in /etc/zabbix/zabbix_agentd.conf
    Server=[IP of Zabbix server]
    Commented out ServerActive directive
    ListenPort=10050
    Hostname=[Hostname of CentOS 7 Server]
    
    in /etc/zabbix/zabbix_agent.conf :
    Server=[IP of Zabbix server]
    
    
    service zabbix-agent start
    chkconfig zabbix-agent on
    firewall-cmd --permanent --add-port=10050/tcp --zone=public
    firewall-cmd --reload
    What am I missing?
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    SElinux? It brings a lot of headache...
    Sincerely yours,
    Aleksey

    Comment

    • Velinath
      Junior Member
      • Sep 2014
      • 2

      #3
      It wasn't SELinux, oddly enough.

      It turned out that after installing zabbix22-agent from the EPEL repo, the .conf file automatically points the PID file to /var/run/zabbix, but the yum install script doesn't make that folder. Commenting out that line and having the zabbix agent use the default of /tmp worked fine.

      I don't know what you guys do here, whether this thread should get closed or what, but this is all set. Hopefully this helps someone else down the line!

      Comment

      • refflects
        Junior Member
        • Mar 2013
        • 10

        #4
        Originally posted by Velinath
        .conf file automatically points the PID file to /var/run/zabbix
        Commenting out that line and having the zabbix agent use the default of /tmp worked fine.
        Thank you!

        Comment

        • wisnu
          Junior Member
          • Jun 2016
          • 2

          #5
          Originally posted by Velinath
          It wasn't SELinux, oddly enough.

          It turned out that after installing zabbix22-agent from the EPEL repo, the .conf file automatically points the PID file to /var/run/zabbix, but the yum install script doesn't make that folder. Commenting out that line and having the zabbix agent use the default of /tmp worked fine.

          I don't know what you guys do here, whether this thread should get closed or what, but this is all set. Hopefully this helps someone else down the line!
          Hi, this helped me! Thanks
          I use centos 7, in my case I also need to edit /usr/lib/systemd/system/zabbix-agent.service
          and set
          Code:
          PIDFile=/tmp/zabbix_agentd.pid

          Comment

          Working...