Closed rmsys closed 7 years ago
What is the actual name (as shown by pm2 l
) of your app - www-0 or API@1.0
? I can't see a connection between those two strings. Definitely something weird going on here.
Hi rkaw92,
first, thank you by the fast response and congrats by the "pm2-zabbix"
Second, sorry by big mistake, but the fix don't worked anyway :(
zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k "pm2.processes[API@1.0,cpu]" -s "api-test" -o 90 -vv
zabbix_sender [19295]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000153"}]
info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000153"
sent: 1; skipped: 0; total: 1
The client (sender) is clearly sending the data items, which the server promptly refuses to process. One oddity that pops up under closer inspection is this:
"{#PROCESS_ID}": "API@1.0",
"{#PROCESS_NAME}": "API@1.0"
Usually, pm2-zabbix
will construct a synthetic PROCESS_ID
like this: processName-number, where number is the sequential process ID in pm2 (starts from 0). The above does not look like an actual process ID generated by pm2-zabbix
. Are you retyping the IDs? Using a modified version of this package?
Anyway, could you inspect in the Zabbix GUI whether the item really was created on the server, with this exact name and the correct type?
Hi rkaw92,
sorry by delay.
I will redoing the installation/process and return.
tks!
Hi all,
Could you help me to find a solution for this ?
`[ ERR ] Periodic sending of process list error: { Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -
at ChildProcess.exithandler (child_process.js:211:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
killed: false, code: 2, signal: null, cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -' }`
@gohackfelipe Please start a separate issue instead of attaching to an existing thread. Before actually posting, have you tried the Troubleshooting guide? Check if the steps there yield any answers, and if not, feel free to open a new issue report.
Sorry @rkaw92 . I will do. Thanks!
Hi, I am doing a run of issue-pruning today and this one looks like it has not seen any activity for a while. Closing; please re-open if the issue persists.
CONFIGS:
1. pm2-zabbix --discover
{ "data": [ { "{#PROCESS_ID}": "API@1.0", "{#PROCESS_NAME}": "API@1.0" } ]
2. /etc/zabbix/zabbix_agentd.conf
############ GENERAL PARAMETERS ################# PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=1 DebugLevel=4 EnableRemoteCommands=1 LogRemoteCommands=1 Server=zabbix.internal.com ServerActive=zabbix.internal.com StartAgents=5 Hostname=api-test
Include=/etc/zabbix/zabbix_agentd.d/
UserParameter
UserParameter=pm2.processes,root /usr/local/nodejs/bin/pm2-zabbix --discover
3. /etc/sudoers
Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
includedir /etc/sudoers.d
zabbix ALL=(ALL) NOPASSWD: ALL Defaults:zabbix !requiretty
4. Server
ERRORS:
[ ERR ] Periodic sending of PM2 status failed: { [Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file - ] killed: false, code: 2, signal: null, cmd: '/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -' }
TROUBLESHOOTING:
from host with zabbix-agent:
- ls /usr/bin/zabbix_sender
/usr/bin/zabbix_sender
- Has the discovery process completed successfully? Are your processes listed in the Zabbix Web UI for the host that you're sending from?
Applications from Template APP PM2
Itens from Application PM2 Processes:
- Does the hostname configured on the server match the hostname that the client is presenting itself as? In particular, compare the output of hostname with the Zabbix Server's notion of your monitored machine's hostname (if using the default HostnameItem setting).
yep, the hostnames match
- If the above does not explain the failure: can you send any data item manually, using zabbix_sender from the CLI?
Test01 --> OK
zabbix_sender -z zabbix.internal.com -s "api-test" -k pm2.cpu -o 43
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000245" sent: 1; skipped: 0; total: 1
Test02 --> FAIL
zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k "pm2.processes[www-0,cpu]" -s "api-test" -o 90 -vv
zabbix_sender [11909]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000113"}] info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000113" sent: 1; skipped: 0; total: 1
from zabbix-server
./usr/local/bin/zabbix_get -s 172.xx.xx.xxx -k pm2.processes { "data": [ { "{#PROCESS_ID}": "API@1.0", "{#PROCESS_NAME}": "API@1.0" } ] }
What/Where's wrong ?