PDA

View Full Version : UserParameter and awk


root_master
05-01-2006, 11:24
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
05-01-2006, 11:28
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.

bbrendon
25-04-2007, 03:38
You saved me! Thanks!