greatcare / pm2-zabbix

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

error while running command : pm2-zabbix --monitor #36

Open 03sameerh opened 5 years ago

03sameerh commented 5 years ago

Hi team, I got below error while running pm2-zabbix --monitor command , can anyone please help to resolve this issue. please find error logs:

{"name":"pm2-zabbix","hostname":"Dev-210-APP","pid":70413,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/devops//usr/local/share/.pm2/pm2.pid"},"msg":"Failed to send PM2 status: Error: ENOENT: no such file or directory, open '/home/devops//usr/local/share/.pm2/pm2.pid'","time":"2019-03-20T14:10:06.108Z","v":0} {"name":"pm2-zabbix","hostname":"Dev-210-APP","pid":70413,"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-03-20T14:10:06.431Z","v":0}

03sameerh commented 5 years ago

any update

xfengfeng commented 5 years ago

I have the same problem.

{"name":"pm2-zabbix","hostname":"localhost.localdomain","pid":367,"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":"2019-04-02T05:03:34.230Z","v":0} {"name":"pm2-zabbix","hostname":"localhost.localdomain","pid":367,"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":"2019-04-02T05:03:34.273Z","v":0}

rkaw92 commented 5 years ago

Hi, These are actually two separate issues. @xfengfeng Code 1 means there's a connectivity problem - the client (zabbix_sender) cannot connect to the server. Check your zabbix_agentd config and whether you can ping the Zabbix server's IP. If the problem persists despite a correct network configuration, please open a separate issue instead of adding to an unrelated issue, thanks.

@03sameerh Are you running the latest version of pm2-zabbix? This looks like a path handling problem. We've had a buggy implementation of path handling in the past, but now we use the same logic as pm2, so this should not normally happen. What's your PM2_HOME?

Try taking a look at the upstream path resolution logic: https://github.com/Unitech/pm2/blob/a3f5e1068b7fa0f022abd4259d139753430dbf7d/paths.js#L10

Does it match what you're seeing?

I've noticed there is another error in your pasted log - error code 2 from zabbix_sender. This means the target Items do not exist on the server - see https://github.com/greatcare/pm2-zabbix/blob/master/Troubleshooting.md