greatcare / pm2-zabbix

A Node.js PM2 monitoring tool for Zabbix.
MIT License
87 stars 60 forks source link

pm2-zabbix --monitor error #28

Open muslihmuslih opened 6 years ago

muslihmuslih commented 6 years ago

i have error while run pm2-zabbix --monitor

{"name":"pm2-zabbix","hostname":"wowza","pid":32726,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":1,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2018-07-24T03:35:19.382Z","v":0}

rkaw92 commented 6 years ago

Exit code 1 essentially means that zabbix_sender could not send the data. This is explained in the manpage of zabbix_sender. Not much pm2-zabbix can do in this situation - it is necessary to verify the configuration in /etc/zabbix/zabbix_agentd.conf, and try sending some keys manually to the server to check connectivity.

muslihmuslih commented 6 years ago

What should I do? what configuration should I add in /etc/zabbix/zabbix_agentd.conf?

thank you

muslihmuslih commented 6 years ago

I have 1 server running pm2, and 1 server for the zabbix server. I installed zabbix_sender, zabbix_agent, pm2-zabbix on the server running pm2. Is that correct?

rkaw92 commented 6 years ago

It's set up correctly w.r.t. process placement. You should check the agent config file on the server running pm2 - look at Server and ServerActive, as they need to point to your Zabbix server's address. You can also check connectivity with normal network tools such as ping, netcat etc.

muslihmuslih commented 6 years ago

pm2-zabbix --discover { "data": [ { "{#PROCESS_ID}": "server-0", "{#PROCESS_NAME}": "server" }, { "{#PROCESS_ID}": "index-1", "{#PROCESS_NAME}": "index" } ] }

muslihmuslih commented 6 years ago

pm2-zabbix --monitor {"name":"pm2-zabbix","hostname":"encoder","pid":17849,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2018-07-31T02:25:54.376Z","v":0}

muslihmuslih commented 6 years ago

My zabbix.agentd.cnf

zabbix_agentd.zip

roshank8s commented 7 months ago

pm2-zabbix --monitor {"name":"pm2-zabbix","hostname":"encoder","pid":17849,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2018-07-31T02:25:54.376Z","v":0}

Just add *Include=/etc/zabbix/zabbix_agentd.d/.conf** In - /etc/zabbix/zabbix_agentd.conf