zarplata / zabbix-agent-extension-rabbitmq

Zabbix agent extension for monitoring RabbitMQ server
MIT License
18 stars 12 forks source link

Timeout while executing a shell script. #12

Open Fesenych opened 5 years ago

Fesenych commented 5 years ago

Hi! I set up everything according to the instructions. I have configured one rabbitmq server. Autodiscovery found rabbitmq server, but the "RabbitMQ" stats element does not work, opposite the exclamation mark and the inscription "Timeout while executing a shell script.". I increased the timeout to 30 seconds, but the error remained. When I try to send a command from zabbix server ."/zabbix_get -s xxx.xxx.xxx.xxx -p 10050 -k "rabbitmq.stats[xxx.xxx.xxx.xxx,http://127.0.0.1:15672,guest,guest,None,example.example.ru]"", then the answer comes "OK". Hostname in Zabbix server = name in /etc/hostname on rabbitmq host = hostname in zabbix-agentd.conf What am I doing wrong? Help please. изображение

tears-of-noobs commented 5 years ago

Hey @Fesenych How did you install the extension, from a package or manually? Does your defined zabbix server host has a correct IP address in Agent interfaces configuration section? And please can you manually perform some debug action.

From ngrep port 10050 command:

########
T ZABBIX_SERVER_IP:RANDOM_PORT -> MONITORED_HOST_IP:10050 [AP] #1004
  ZBXD.^.......rabbitmq.stats[ZABBIX_SERVER_IP,http://127.0.0.1:15672,guest,guest,None,example.example.ru] 

From ngrep port 10051

T MONITORED_HOST:RANDOM_PORT -> ZABBIX_SERVER_IP:10051 [A] #4
  ZBXD.{L......{"request":"sender data","data":[{"host":"example.example.ru","key":"rabbitmq.queu
  e.node[/,api.events]","value":"rabbitmq@example.example.ru","clock":1561636276},..........
...
...
...
...
Fesenych commented 5 years ago

Installed manually from source following these instructions https://github.com/zarplata/zabbix-agent-extension-rabbitmq#from-source-centos-7 The agent interfaces specify IP and DNS. I tried switching between them, but it didn't help. изображение Zabbix agent is a passive, active server. No proxy, NAT or firewall. Other data items work without problems. ngrep on port 10051 - no data. ngrep on port 10051 found such records:

T ZABBIX_SERVER_IP:10051:55630 -> MONITORED_HOST_IP:10050 [AP] #14
  rabbitmq.discovery[http://127.0.0.1:15672,guest,guest,example.example.com].................
#
T MONITORED_HOST_IP:10050 -> ZABBIX_SERVER_IP:10051:55630 [A] #15
  ................
#
T MONITORED_HOST_IP:10050 -> ZABBIX_SERVER_IP:10051:55630 [AP] #16
  ZBXD.:.......{"data":[{"{#QUEUENAME}":"receipts","{#VHOST}":"example"}]}................
...
T ZABBIX_SERVER_IP:56214 -> MONITORED_HOST:10050 [AP] #399
  rabbitmq.aggregate.discovery[None,http://127.0.0.1:15672,guest,guest,example.example.com].................
#
T MONITORED_HOST:10050 -> ZABBIX_SERVER_IP:56214 [A] #400
  haproxy.stats[/v
#
T MONITORED_HOST:10050 -> ZABBIX_SERVER_IP:56184 [AP] #401
  ZBXD.........300................
#
T MONITORED_HOST:10050 -> ZABBIX_SERVER_IP:56184 [AF] #402
  ZBXD.........300
#
T ZABBIX_SERVER_IP:56184 -> MONITORED_HOST:10050 [A] #403
  ZBXD.........0ho
#
T ZABBIX_SERVER_IP:56184 -> MONITORED_HOST:10050 [AF] #404
  ........stats[/v
#
T MONITORED_HOST:10050 -> ZABBIX_SERVER_IP:56184 [A] #405
  No.,.........0,p
#
T MONITORED_HOST:10050 -> ZABBIX_SERVER_IP:56214 [AP] #406
  ZBXD.V.......{"data":[{"{#AGGQUEUENAME}":"receipts","{#AGGVHOST}":"example","{#GROUPNAME}":"None"}]}................
tears-of-noobs commented 5 years ago

Hmmm, so strange. As far as I see only rabbimq.discovery item key executed by zabbix-agent and no one rabbimq.stats was executed. Do you have another "UserParameters" with the same item key name rabbitmq.stats in your zabbix-agent configuration files? Check it, do `grep 'rabbitmq.stats' /etc/zabbix/zabbix_agentd.d/*'.

Fesenych commented 5 years ago

Checked, grep didn't return anything.

tears-of-noobs commented 5 years ago

@Fesenych but it should be returned at least one. This config file should be installed in zabbix-agent include dir, for example - /etc/zabbix/zabbix_agent.d (Path of the include dir depends on settings in the main zabbix-agent configuration) Check out the zabbix-agent config, it should contain Include option, for example

Include=/etc/zabbix/zabbix_agentd.d/

And the extension configuration should be placed into this include directory.

Fesenych commented 5 years ago

Sorry, I executed a command on another node by mistake. Here's what grep returns: /etc/zabbix/zabbix_agentd.d/zabbix-agent-extension-rabbitmq.conf:UserParameter=rabbitmq.stats[*], /usr/bin/zabbix-agent-extension-rabbitmq --zabbix $1 --rabbitmq $2 --rabbitmq-user $3 --rabbitmq-secret $4 --ca $5 --hostname $6