4

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?

32cupo
  • 850
  • 5
  • 18
  • 36

2 Answers2

13

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>
Community
  • 1
  • 1
Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • Thank you, it works for me! I added DNS name, private and public IP address, restarts agentd and got a response. Is there another way to solve this problem? I thought that edited /etc/hosts file might work, but it didn't. – 32cupo Feb 15 '16 at 20:23
0

zabbix-get new version works for me.

root@xxx:/# apt install zabbix-get

root@xxx:/# zabbix_get --version
zabbix_get (Zabbix) 4.4.10

root@xxx:/# zabbix_get -s 127.0.0.1 -k agent.version
4.4.7