I have written a python script to parse the passenger-status output while I need to setup LLD for the number of process that passenger is running.
[root@ip-10-1-1-1 cronjob]# ./passenger_status.py discovery trapper
- passenger.threads.discovery {"data": [{"{#THREADNO}":"1"},{"{#THREADNO}":"2"},{"{#THREAD NO}":"3"},{"{#THREADNO}":"4"},{"{#THREADNO}":"5"}, {"{#THREADNO}":"6"},{"{#THREADNO}":"7"},{"{#THREAD NO}":"8"}]}
Then I have tried to send the discover to zabbix server using zabbix trapper as:-
And then I setup a discovery rule
When I run the command, it success:-
[root@ip-10-1-1-1 cronjob]# ./passenger_discovery.sh
zabbix_sender [12836]: DEBUG: answer [{
"response":"success",
"info":"processed: 1; failed: 0; total: 1; seconds spent: 0.010336"}]
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.010336"
sent: 1; skipped: 0; total: 1
Then I assume everything is OK, and then I setup some testing key.
And then I tried to send the server some data for testing.
[root@ip-10-1-1-1 cronjob]# ./passenger_status.sh
zabbix_sender [13041]: DEBUG: answer [{
"response":"success",
"info":"processed: 0; failed: 250; total: 250; seconds spent: 0.002045"}]
info from server: "processed: 0; failed: 250; total: 250; seconds spent: 0.002045"
zabbix_sender [13042]: DEBUG: answer [{
"response":"success",
"info":"processed: 0; failed: 46; total: 46; seconds spent: 0.000431"}]
info from server: "processed: 0; failed: 46; total: 46; seconds spent: 0.000431"
sent: 296; skipped: 0; total: 296
It simply tell me that no key were being accepted.
Then I read from the internet that discovery won't work with sender? Is that true? But anyway, I also performed some changes which is to include the discovery inside the UserParam to be monitored with zabbix_agent but it didn't work as well.
But I have saw from the internet that there are a lot of successful case with custom LLD, what have I done wrong? The zabbix version that I am using is 2.2.8, would that be a possible cause?
[root@ip-10-1-1-1 cronjob]# ./passenger_status.py discovery trapper
- passenger.threads.discovery {"data": [{"{#THREADNO}":"1"},{"{#THREADNO}":"2"},{"{#THREAD NO}":"3"},{"{#THREADNO}":"4"},{"{#THREADNO}":"5"}, {"{#THREADNO}":"6"},{"{#THREADNO}":"7"},{"{#THREAD NO}":"8"}]}
Then I have tried to send the discover to zabbix server using zabbix trapper as:-
Code:
#!/bin/bash
export HOME=/usr/cronjob
tmpFile=`/bin/mktemp`
$HOME/passenger_status.py discovery trapper > ${tmpFile}
/usr/bin/zabbix_sender -vv -c /etc/zabbix/zabbix_agentd.conf -i ${tmpFile}
rm ${tmpFile}
When I run the command, it success:-
[root@ip-10-1-1-1 cronjob]# ./passenger_discovery.sh
zabbix_sender [12836]: DEBUG: answer [{
"response":"success",
"info":"processed: 1; failed: 0; total: 1; seconds spent: 0.010336"}]
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.010336"
sent: 1; skipped: 0; total: 1
Then I assume everything is OK, and then I setup some testing key.
And then I tried to send the server some data for testing.
[root@ip-10-1-1-1 cronjob]# ./passenger_status.sh
zabbix_sender [13041]: DEBUG: answer [{
"response":"success",
"info":"processed: 0; failed: 250; total: 250; seconds spent: 0.002045"}]
info from server: "processed: 0; failed: 250; total: 250; seconds spent: 0.002045"
zabbix_sender [13042]: DEBUG: answer [{
"response":"success",
"info":"processed: 0; failed: 46; total: 46; seconds spent: 0.000431"}]
info from server: "processed: 0; failed: 46; total: 46; seconds spent: 0.000431"
sent: 296; skipped: 0; total: 296
It simply tell me that no key were being accepted.
Then I read from the internet that discovery won't work with sender? Is that true? But anyway, I also performed some changes which is to include the discovery inside the UserParam to be monitored with zabbix_agent but it didn't work as well.
But I have saw from the internet that there are a lot of successful case with custom LLD, what have I done wrong? The zabbix version that I am using is 2.2.8, would that be a possible cause?


Comment