Hello,
Using 3.4.1,I have writed my custom traceroute script named tgmtr,which is hacked from system traceroute, it can show the ip info like geoip,it can run correctly on agent like this:
[zabbix@tg36 ~]$ tgmtr -q 1 -n 122.227.42.233
traceroute to 122.227.42.233 (122.227.42.233), 30 hops max, 60 byte packets
1 61.134.34.33 陕西省宝鸡市电信 0.451 ms
2 61.134.34.173 陕西省宝鸡市明乐网吧 0.544 ms
3 219.145.131.41 陕西省宝鸡市电信 0.890 ms
4 219.145.131.9 陕西省宝鸡市电信 3.145 ms
5 *
6 220.188.121.2 浙江省金华市电信 32.849 ms
7 *
8 *
9 122.227.42.233 浙江省金华市电信 37.211 ms
And I add a custom item in the userparams.conf:
UserParameter=net.icmp.mymtr[*],tgmtr -q 1 -n $1
when I run the command on the zabbix server
#/usr/local/zabbix/bin/zabbix_get -s 61.134.34.36 -k net.icmp.mymtr[122.227.42.233]
it returns empty value,and the zabbix_agentd.log shows:
77032:20170921:105643.945 In zbx_popen() command:'tgmtr -q 1 -n 122.227.42.233'
77032:20170921:105643.958 Run remote command [tgmtr -q 1 -n 122.227.42.233] Result [0] []...
But when I use the system traceroute instead of my tgmtr,it works fine!
UserParameter=net.icmp.mymtr[*],traceroute -q 1 -n $1
#/usr/local/zabbix/bin/zabbix_get -s 61.134.34.36 -k net.icmp.mymtr[122.227.42.233]
traceroute to 122.227.42.233 (122.227.42.233), 30 hops max, 60 byte packets
1 61.134.34.33 0.444 ms
2 61.134.34.173 0.579 ms
3 219.145.131.41 0.701 ms
4 219.145.131.1 3.403 ms
5 202.97.78.218 29.262 ms
6 220.188.121.30 32.873 ms
7 *
8 *
9 122.227.42.233 37.446 ms
tgmtr is under /usr/sbin like traceroute.
I'm very trouble about this, any suggestions?
Using 3.4.1,I have writed my custom traceroute script named tgmtr,which is hacked from system traceroute, it can show the ip info like geoip,it can run correctly on agent like this:
[zabbix@tg36 ~]$ tgmtr -q 1 -n 122.227.42.233
traceroute to 122.227.42.233 (122.227.42.233), 30 hops max, 60 byte packets
1 61.134.34.33 陕西省宝鸡市电信 0.451 ms
2 61.134.34.173 陕西省宝鸡市明乐网吧 0.544 ms
3 219.145.131.41 陕西省宝鸡市电信 0.890 ms
4 219.145.131.9 陕西省宝鸡市电信 3.145 ms
5 *
6 220.188.121.2 浙江省金华市电信 32.849 ms
7 *
8 *
9 122.227.42.233 浙江省金华市电信 37.211 ms
And I add a custom item in the userparams.conf:
UserParameter=net.icmp.mymtr[*],tgmtr -q 1 -n $1
when I run the command on the zabbix server
#/usr/local/zabbix/bin/zabbix_get -s 61.134.34.36 -k net.icmp.mymtr[122.227.42.233]
it returns empty value,and the zabbix_agentd.log shows:
77032:20170921:105643.945 In zbx_popen() command:'tgmtr -q 1 -n 122.227.42.233'
77032:20170921:105643.958 Run remote command [tgmtr -q 1 -n 122.227.42.233] Result [0] []...
But when I use the system traceroute instead of my tgmtr,it works fine!
UserParameter=net.icmp.mymtr[*],traceroute -q 1 -n $1
#/usr/local/zabbix/bin/zabbix_get -s 61.134.34.36 -k net.icmp.mymtr[122.227.42.233]
traceroute to 122.227.42.233 (122.227.42.233), 30 hops max, 60 byte packets
1 61.134.34.33 0.444 ms
2 61.134.34.173 0.579 ms
3 219.145.131.41 0.701 ms
4 219.145.131.1 3.403 ms
5 202.97.78.218 29.262 ms
6 220.188.121.30 32.873 ms
7 *
8 *
9 122.227.42.233 37.446 ms
tgmtr is under /usr/sbin like traceroute.
I'm very trouble about this, any suggestions?