greatcare / pm2-zabbix

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

pm2-zabbix --monitor wont run #49

Open luism-was opened 3 years ago

luism-was commented 3 years ago

hello I followed the tutorial, I've tried replacing the hostname on the monitor.js The connection works fine this is a working zabbix agent node. pm2-zabbix --discover works well and shows all the pm2 processes but pm2-zabbix --monitor gives the following errors

{"name":"pm2-zabbix","hostname":"CentOS-77-64-minimal","pid":25279,"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\n    at ChildProcess.exithandler (child_process.js:303:12)\n    at ChildProcess.emit (events.js:311:20)\n    at maybeClose (internal/child_process.js:1021:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {\n  killed: false,\n  code: 2,\n  signal: null,\n  cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -'\n}","time":"2020-12-15T11:42:40.886Z","v":0}

{"name":"pm2-zabbix","hostname":"CentOS-77-64-minimal","pid":25279,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"killed":false,"code":2,"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\n    at ChildProcess.exithandler (child_process.js:303:12)\n    at ChildProcess.emit (events.js:311:20)\n    at maybeClose (internal/child_process.js:1021:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {\n  killed: false,\n  code: 2,\n  signal: null,\n  cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -'\n}","time":"2020-12-15T11:42:40.891Z","v":0}

{"name":"pm2-zabbix","hostname":"CentOS-77-64-minimal","pid":25279,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"killed":false,"code":2,"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\n    at ChildProcess.exithandler (child_process.js:303:12)\n    at ChildProcess.emit (events.js:311:20)\n    at maybeClose (internal/child_process.js:1021:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {\n  killed: false,\n  code: 2,\n  signal: null,\n  cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -'\n}","time":"2020-12-15T11:42:55.900Z","v":0}

{"name":"pm2-zabbix","hostname":"CentOS-77-64-minimal","pid":25279,"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\n    at ChildProcess.exithandler (child_process.js:303:12)\n    at ChildProcess.emit (events.js:311:20)\n    at maybeClose (internal/child_process.js:1021:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {\n  killed: false,\n  code: 2,\n  signal: null,\n  cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -'\n}","time":"2020-12-15T11:42:55.912Z","v":0}

I can't seem to understand what could be the issues, I've tried with loglevel=trace but still doesn't show any clue.

What could be the issue?