PDA

View Full Version : User Parameter: Syntax changed in 1.6.1 or 2


NOB
23-01-2009, 16:15
Hi

I use a lot of user parameters for the AIX agent because up to now it
was necessary to even receive the simplest data.

Up to and including ZABBIX agent version 1.6 the syntax I used was:
UserParameter=usr.loadavg1,uptime | sed 's/,//'g | awk '{printf $(NF-2)}'
This worked fine for the 1.4.4 and the 1.6 agents.

Starting from 1.6.2 - using the same zabbix_agentd.conf file - new error
messages appear in the logfile of the agent and the agent does no longer start up.

Error messages:
1765384:20090123:155215 UserParameter "usr.loadavg1,uptime | sed 's/,//'g | awk
'{printf $(NF-2)}'" FAILED: Invalid format.


Obviously, the syntax changed, i.e. I had to quote the statement like:
UserParameter=usr.loadavg1,"uptime | sed 's/,//'g | awk '{printf $(NF-2)}'"

Problem: If you have to use quotes inside the statement. You have to use """" (that are four ") for every single " in the statement instead.

Example:
" ... | awk '{printf """"%d"""", $ 2}'"

You have be warned !

Regards

Norbert.

Sasha
23-01-2009, 17:08
Hello!

UserParameter syntax changed in version 1.6.1. ... and I rollback this changes in version 1.6.2 rev. 6619 (pre1.6.3). You can download this version from http://www.zabbix.com/downloads/nightly/pre-zabbix-1.6.tar.gz

Best regards.
Alexander Vladishev,
Zabbix developer.

Alexei
24-01-2009, 13:14
The source of the problem is in incorrect processing of commas. You should have no problems if commas are not used inside the command.

NOB
25-01-2009, 16:57
Hello!

UserParameter syntax changed in version 1.6.1. ... and I rollback this changes in version 1.6.2 rev. 6619 (pre1.6.3). You can download this version from http://www.zabbix.com/downloads/nightly/pre-zabbix-1.6.tar.gz

Best regards.
Alexander Vladishev,
Zabbix developer.

Thanks a lot.
Good to know the revision, I already downloaded 6626 for a different reason (malloc).

Regards

Norbert.