greatcare / pm2-zabbix

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

Problem with pm2-zabbix & varnish-zabbix #41

Open Dave10win opened 4 years ago

Dave10win commented 4 years ago

Hi Im having the same problem, if tried everthing i can find on google but nuthing helps..

I made a replica of two of my servers (nginx + varnish and nodejs), on the original server everthing is working fine with zabbix, however on my replicas i'm havig problems with pm2-zabbix and zabbix-varnish but no problem with system info or nginx info.

image

This is the error i get wen i run (on the node server) "sudo pm2-zabbix --monitor --debug": {"name":"pm2-zabbix","hostname":"nodejs61replica","pid":98546,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"kilt-file -"},"msg":"Failed to send PM2 status: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.c {"name":"pm2-zabbix","hostname":"nodejs61replica","pid":98546,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"killed":false,"code":1,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send PM2 status: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2020-05-03T10:10:03.944Z","v":0}

on my varnish server i run "sudo /usr/local/bin/zabbix-varnish-cache.py -i '' send -c /etc/zabbix/zabbix_agentd.conf" and it seems evrthing is OK but zabbix server dos not recive the info: image

serHelp please!

rkaw92 commented 4 years ago

Hi, As seen above, you're getting an exit code of 1 from zabbix_sender. I see you've checked with another command that sends to Zabbix, and it does not receive anything. Therefore, you should check if you have connectivity and if your zabbix_agentd.conf is configured properly.

Try sending anything manually via zabbix_sender as described here: https://www.zabbix.com/documentation/3.0/manual/concepts/sender - this is most likely a network problem, so debug that first. Always mke sure to inspect the exit code of zabbix_sender.

For example, if your shell is bash, this is how you can print the exit code of the last command: echo $?