Open rkaw92 opened 7 years ago
{"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":56575,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/var/www//etc/nodejs_home/.pm2/pm2.pid"},"msg":"Failed to send PM2 status: Error: ENOENT: no such file or directory, open '/var/www//etc/nodejs_home/.pm2/pm2.pid'","time":"2017-09-05T07:18:47.196Z","v":0} {"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":56575,"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":"2017-09-05T07:18:47.208Z","v":0}
I am having the above errors, pm2 is running by www-data with a customized home dir(/etc/nodejs_home/.pm2/), Not sure why pm2-zabbix will try to find the path from "/var/www//etc/nodejs_home/.pm2/pm2.pid"}
There are currently two issues surrounding the use of
$HOME
and$PM2_HOME
, and both originate from lib/PM2Tracker.js:165 :process.env.HOME
is used, instead ofos.homedir()
.PM2_HOME
(defaulted to.pm2
) to produce the path to PM2 pidfile, even though the user may wish to overridePM2_HOME
completely to use an external path, for example/etc/pm2
(as demonstrated in #3 ).This should be fixed by computing the proper path where we expect to find
pm2.pid
, and not using the user's home dir at all ifPM2_HOME
looks like an absolute path.