greatcare / pm2-zabbix

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

monitor error #37

Open ghost opened 5 years ago

ghost commented 5 years ago

hello im having a issue with pm2-zabbix. im am new to zabbix {"name":"pm2-zabbix","hostname":"pi","pid":26920,"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":"2019-05-10T16:42:58.057Z","v":0} {"name":"pm2-zabbix","hostname":"pi","pid":26920,"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","time":"2019-05-10T16:42:58.112Z","v":0}

liu602348184 commented 5 years ago

hello im having a issue with pm2-zabbix. im am new to zabbix {"name":"pm2-zabbix","hostname":"pi","pid":26920,"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":"2019-05-10T16:42:58.057Z","v":0} {"name":"pm2-zabbix","hostname":"pi","pid":26920,"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","time":"2019-05-10T16:42:58.112Z","v":0}

open the node_module to edit pm2-zabbix or monitor.js find this line var hostname = os.hostname(); and delete it. put var hostname = "your hostname from zabbix_agent.conf"; here. i tried, it works fine.

solick commented 5 years ago

thanks for the hint but a much better solution would be usage off the HostName value from the Zabbix configuration