Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout while executing a shell script. #12

Open
Fesenych opened this issue Jun 27, 2019 · 6 comments
Open

Timeout while executing a shell script. #12

Fesenych opened this issue Jun 27, 2019 · 6 comments

Comments

@Fesenych
Copy link

Fesenych commented Jun 27, 2019

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
Copy link
Contributor

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.

  • Install ngrep
  • run on separate terminals ngrep port 10050 and ngrep port 10051 on monitored host (with RabbitMQ)
    If your configuration of the host in Zabbix server is correct you should see the following output

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":"[email protected]","clock":1561636276},..........
...
...
...
...

@Fesenych
Copy link
Author

Fesenych commented Jun 27, 2019

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
Copy link
Contributor

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
Copy link
Author

Fesenych commented Jul 2, 2019

Checked, grep didn't return anything.

@tears-of-noobs
Copy link
Contributor

@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
Copy link
Author

Fesenych commented Jul 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants