Ad Widget

Collapse

Counting internet hops

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AndrewK990
    Junior Member
    • Dec 2014
    • 1

    #1

    Counting internet hops

    Hi All.
    I want count traceroute hops. In zabbix_agent i created user parameter, like this:
    UserParameter=traceroutehops[*],traceroute -I -n $1 | wc -l. And restart agent. But when i trying to verify is all correct, use zabbix_get utility.

    zabbix_get -s 127.0.0.1 -p 10050 -k traceroutehops[google.com]
    zabbix_get: No match.


    What's wrong?
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    I tried to repeat your experiment.
    Unfortunately, I cannot use key "-I" under zabbix account
    Code:
    #> grep traceroute /etc/zabbix/zabbix_agentd.conf
    UserParameter=traceroutehops[*],traceroute -I -n $1 | grep -v traceroute | wc -l
    #> zabbix_get -s localhost -k traceroutehops[google.com]
    [B]The specified type of tracerouting is allowed for superuser only
    0[/B]
    But when I remove keyword "-I", it works.
    Code:
    #> grep traceroute /etc/zabbix/zabbix_agentd.conf
    UserParameter=traceroutehops[*],traceroute  -n $1 | grep -v traceroute | wc -l
    #> zabbix_get -s localhost -k traceroutehops[google.com]
    [B]9[/B]
    BTW, I added "grep -v traceroute" to have only the number of hops, not including the service line
    Code:
    traceroute to google.com (173.194.43.97), 30 hops max, 60 byte packets
    Sincerely yours,
    Aleksey

    Comment

    Working...