Zabbix sender fails when used with uname -n:
Because uname returns hostname + domain :
It works when specifying hostname without domain manually :
In opposition to what the doc states, it does not work with IP :
In Zabbix web interface, in hosts configuration, I tried to specify the domain, either in DNS, or in Name field. None solved the problem.
Do you have any idea ? Is it wrong to use uname in zabbix sender commands ? How would you make your scripts generic then ?
Code:
[root@host bin]# /usr/local/sbin/zabbix_sender -s `uname -n` -z zbxserver -k mykey -o `date +%s` Info from server: Failed 1
Code:
[root@host bin]# uname -n myhost.mydomain.fr
It works when specifying hostname without domain manually :
Code:
[root@host bin]# /usr/local/sbin/zabbix_sender -s myhost -z zbxserver -k mykey -o `date +%s` Info from server: "Processed 1
Code:
[root@host bin]# /usr/local/sbin/zabbix_sender -s 10.0.13.19 -z zbxserver -k mykey -o `date +%s` Info from server: "Failed 1
Do you have any idea ? Is it wrong to use uname in zabbix sender commands ? How would you make your scripts generic then ?
Comment