I have the userparameter:
UserParameter=dicom.echo,/opt/dicom_echo.sh
The dicom_echo.sh:
This echo show 0 if OK and NOT 0 if PROBLEM.
When returning 0 all things work right:
- console in server:
root@zabbix-server:~# zabbix_get -s zabbix.agent -p 10050 -k "dicom.echo"
0
- console in agent:
root@zabbix-agent:# zabbix_agentd -t dicom.echo
dicom.echo [t|0]
BUT when returning NOT 0 we got the problem:
- console in server:
root@zabbix-server:~# zabbix_get -s zabbix.agent -p 10050 -k "dicom.echo"
ZBX_NOTSUPPORTED
- console in agent:
root@zabbix-agent:# zabbix_agentd -t dicom.echo
dicom.echo Alarm clock
When java get the error in stderr the script put it in /dev/null (>&) and returns only a number not 0. But zabbix-agent appears don't recognized it. Any idea?
UserParameter=dicom.echo,/opt/dicom_echo.sh
The dicom_echo.sh:
Code:
#!/bin/bash /opt/dcm4che2/bin/dcmecho [email protected]:11112 -L XXXXX >& /dev/null echo $?
When returning 0 all things work right:
- console in server:
root@zabbix-server:~# zabbix_get -s zabbix.agent -p 10050 -k "dicom.echo"
0
- console in agent:
root@zabbix-agent:# zabbix_agentd -t dicom.echo
dicom.echo [t|0]
BUT when returning NOT 0 we got the problem:
- console in server:
root@zabbix-server:~# zabbix_get -s zabbix.agent -p 10050 -k "dicom.echo"
ZBX_NOTSUPPORTED
- console in agent:
root@zabbix-agent:# zabbix_agentd -t dicom.echo
dicom.echo Alarm clock
When java get the error in stderr the script put it in /dev/null (>&) and returns only a number not 0. But zabbix-agent appears don't recognized it. Any idea?
Comment