Ad Widget

Collapse

UserParameter and awk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • root_master
    Junior Member
    • Dec 2005
    • 18

    #1

    UserParameter and awk

    Hello

    i'll grep the used memory with the UserParameter in the zabbix_agentd.conf

    but if i use awk it doesn't work
    UserParameter=memory.used,free|grep "buffers/cache"|awk '{print $3}'

    i must use the longer script but in my oppinon it very bad
    ,free -b | grep " buffers/cache" | cut -d":" -f2 | rev | cut -d" " -f 2- | rev

    does anybody any idea

    thanks
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Replace

    UserParameter=memory.used,free|grep "buffers/cache"|awk '{print $3}'

    by

    UserParameter=memory.used,free|grep "buffers/cache"|awk '{print $ 3}'

    to make it work.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • bbrendon
      Senior Member
      • Sep 2005
      • 870

      #3
      You saved me! Thanks!
      Unofficial Zabbix Expert
      Blog, Corporate Site

      Comment

      Working...