Open ka-may opened 2 years ago
Zabbix-Server logs:
2357495:20220819:132837.014 trapper got '{"request":"sender data","data":[{"host":"node","key":"pm2.processes[hello-0,status]","value":"online"},{"host":"node","key":"pm2.processes[hello-0,cpu]","value":"0"},{"host":"node","key":"pm2.processes[hello-0,memory]","value":"53968896"},{"host":"node","key":"pm2.processes[hello-0,restarts]","value":"0"}]}'
2357495:20220819:132837.014 cannot retrieve key "pm2.processes[hello-0,status]" on host "node" from configuration cache
2357495:20220819:132837.014 cannot retrieve key "pm2.processes[hello-0,cpu]" on host "node" from configuration cache
2357495:20220819:132837.014 cannot retrieve key "pm2.processes[hello-0,memory]" on host "node" from configuration cache
2357495:20220819:132837.014 cannot retrieve key "pm2.processes[hello-0,restarts]" on host "node" from configuration cache
2357492:20220819:132837.018 trapper got '{"request":"sender data","data":[{"host":"node","key":"pm2.status","value":"online"},{"host":"node","key":"pm2.cpu","value":"0"},{"host":"node","key":"pm2.memory","value":"61538304"},{"host":"node","key":"pm2.pid","value":"1131"}]}'
What version of zabbix_sender are you using? I'm running into the same kind of issue and notices that it work using zabbix_sender 3.4.15 and it stopped working when I upgraded to 6.0.7.
After some debugging it worked for me when I added the line Defaults:zabbix !requiretty, always_set_home
to the sudoers file. The older version didn't need this.
I have discovered a bug/feature in monitor.js that causes this error. HOSTNAME for Zabbix is NEVER taken from zabbix-agent.conf, but either from --HOSTNAME="hostname" or from os.hostname(); (se line 40) A simple fix that forces zabbix_sender to use HOSTNAME from zabbix-agent.conf: pm2-zabbix --monitor --hostname='-'
systemd / sysv will have to be modified also
Hi, I wanted to get up-to-date data about a running process in PM2 using zabbix. When trying to run pm2-zabbix –monitor:
When trying to run LOG_LEVEL=trace pm2-zabbix –monitor:
i studied this https://github.com/greatcare/pm2-zabbix/blob/master/Troubleshooting.md
pm2-daemon was successfully discovered in zabbix, while there is no information about the child process pm2 --discovery successfully detects running processes.![image](https://user-images.githubusercontent.com/82875438/185594452-cdeba138-a635-49a8-b9e1-efb854d05ad5.png)
The hostname on the node is the same as the hostname in zabbix-agent.conf and is the same as the node on the zabbix server
I can successfully send data using zabbix-sender
Resources used: Ubuntu server 22, NPM 8.5.1, PM2 5.2.0, PM2-zabbix 0.3.2.
I will appreciate any help, thanks