Check access restrictions in Zabbix agent configuration

32cupo picture 32cupo · Feb 14, 2016 · Viewed 19.8k times · Source

I installed Zabbix 3.0.0rc1 from sources on AWS correctly and everything runs okay, but I wanted to run some manual commands to test connectivity with new zabbix agent in network. I used zabbix_get and it worked fine, but I saw something strange. Agent is installed on both machines zabbix.myservers and agent.myservers

I tried to run zabbix_get with DNS name, private and public IP address.

Attempt to get agent version from localhost using DNS name

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s zabbix.myservers -k agent.version
zabbix_get [30903]: Check access restrictions in Zabbix agent configuration

Attempt to get agent version from localhost using private IP address

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s 10.0.0.30 -k agent.version
zabbix_get [30907]: Check access restrictions in Zabbix agent configuration

Attempt to get agent version from localhost using localhost

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s localhost -k agent.version
3.0.0rc1

Attempt to get agent version from server using DNS name

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s agent.myservers -k agent.version
3.0.0rc1

Attempt to get agent version from server using private IP address

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s 10.0.0.31 -k agent.version
3.0.0rc1

Attempt to get agent version from server using public IP address (x.x.x.x is real public IP address)

root@ip-10-0-0-30:/home/ubuntu# zabbix_get -s x.x.x.x -k agent.version
zabbix_get [30913]: Check access restrictions in Zabbix agent configuration

My agentd.conf file is

Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server

and I want to know how to edit configuration file for successfully run zabbix_get. Where is the problem?

Answer

Jan Garaj picture Jan Garaj · Feb 15, 2016

Server=127.0.0.1

ServerActive=127.0.0.1

=> only 127.0.0.1 is allowed to ask for any metric from the agent.

Add IP of your connection there and then you will see response. It can be public ip (x.x.x.x), but it can be more complicated as well. Increase log level and check zabbix agent log, which IP is actually used.

Server=127.0.0.1,<ip of your connection>