I create a small script to do tnsping through Zabbix.
In zabbix agent I set it up:
UserParameter=tnsping[*],/opt/scripts/pingOracle.sh $1
If I run /sbin/zabbix_agentd -t tnsping[ORACLE1]
I get
But from zabbix server running zabbix_get -s servername -k tnsping[ORACLE1] I get a empty response.
TImeout in zabbix server and agent is 30.

Zabbix agent log
Code:
#!/bin/bash instance=$1 tnsping=/opt/app/oracle/product/11.2.0/client_1/bin/tnsping var1=$($tnsping $instance) var2=$(echo $var1 |grep -Eoh '[0-9]* msec' |grep -Eoh '*[0-9]*') echo $var2
UserParameter=tnsping[*],/opt/scripts/pingOracle.sh $1
If I run /sbin/zabbix_agentd -t tnsping[ORACLE1]
I get
Code:
tnsping[ORACLE1] [t|15240]
TImeout in zabbix server and agent is 30.
Zabbix agent log
Code:
1681:20180530:104959.716 Requested [tnsping[ORACLE1]] 1681:20180530:104959.716 In zbx_popen() command:'/opt/scripts/pingOracle.sh ORACLE1' 1681:20180530:104959.716 End of zbx_popen():7 1713:20180530:104959.716 zbx_popen(): executing script 1681:20180530:104959.728 In zbx_waitpid() 1681:20180530:104959.728 zbx_waitpid() exited, status:0 1681:20180530:104959.728 End of zbx_waitpid():1713 1681:20180530:104959.728 EXECUTE_STR() command:'/opt/scripts/pingOracle.sh ORACLE1' len:0 cmd_result:'' 1681:20180530:104959.728 Sending back []
Comment