Ad Widget

Collapse

User Parameter: Syntax changed in 1.6.1 or 2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    User Parameter: Syntax changed in 1.6.1 or 2

    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:
    Code:
    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:
    Code:
    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:
    Code:
    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:
    Code:
    " ... | awk '{printf """"%d"""", $ 2}'"
    You have be warned !

    Regards

    Norbert.
    Last edited by NOB; 23-01-2009, 17:18. Reason: Corrected the last example
  • Sasha
    Zabbix developer
    • Sep 2007
    • 60

    #2
    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/nigh...bix-1.6.tar.gz

    Best regards.
    Alexander Vladishev,
    Zabbix developer.
    ZABBIX Developer
    Riga, Latvia

    Comment

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

      #3
      The source of the problem is in incorrect processing of commas. You should have no problems if commas are not used inside the command.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • NOB
        Senior Member
        Zabbix Certified Specialist
        • Mar 2007
        • 469

        #4
        Originally posted by Sasha
        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/nigh...bix-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.

        Comment

        Working...