PDA

View Full Version : Custom UserParameters not working properly? (beta4)


KarmaPolice
21-12-2005, 17:29
Are custom user parameters not working properly?

I have the following defined:


UserParameter=systemcpuuser[],vmstat 1 2|tail -n1 > /opt/zabbix/temp.cpu;cat /opt/zabbix/temp.cpu|awk '{print $13}'
UserParameter=systemcpusystem[],cat /opt/zabbix/temp.cpu|awk '{print $14}'
UserParameter=systemcpuidle[],cat /opt/zabbix/temp.cpu|awk '{print $16}'
UserParameter=systemcpuwaitio[],cat /opt/zabbix/temp.cpu|awk '{print $15}'
UserParameter=systemcpurunq[],sar -q 1|grep "Average"|awk '{print $2}'


And for whatever/some reason they are returning just static (and incorrect) values... i run each command from the command line though and it returns the proper value

I have them defined as systemcpuuser[] and so on and so forth in the configuration settings as well.

What am i not seeing?

edeus
21-12-2005, 23:22
I posted something similar here:

http://www.zabbix.com/forum/showthread.php?t=1827

I found breaking the format of the awk code to break up $1... $99 worked a treat. i.e. "$ 9" instead of $9. I dont know if this is supported syntax by awk though.

KarmaPolice
22-12-2005, 19:37
Thanks, that fixed it... where did you get the CVS version as you mentioned it was fixed in that...