Ad Widget

Collapse

zabbix and bash built-in 'time'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simonc
    Member
    • Jul 2009
    • 73

    #1

    zabbix and bash built-in 'time'

    Hi all,

    I have a problem with the builtin 'time' in bash.
    When I do a "time ls" in the shell, I get this:

    real 0m0.008s
    user 0m0.000s
    sys 0m0.000s

    But if I use a UserParameter=blop,time ls and then do a zabbix_get -s host -k blop, I get this:

    0.00user 0.00system 0:00.00elapsed 57%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (0major+710minor)pagefaults 0swaps

    The problem is that /usr/bin/time is used by the zabbix agent instead of the built-in 'time'.

    Does anyone know how to force Zabbix to use the built-in 'time' ?
  • simonc
    Member
    • Jul 2009
    • 73

    #2
    Ok i found that /bin/sh was linked to /bin/dash under my new debian Lenny instead of /bin/bash under debian Etch.
    I changed the link to /bin/bash to get the 'time' keyword.

    Problem solved.

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #3
      or, to avoid system-wide changes, you can call bash in the user parameter directly
      Zabbix 3.0 Network Monitoring book

      Comment

      Working...