Ad Widget

Collapse

Zabbix 1.8 agent troubles. (using dashes in command arguments)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • traq911
    Junior Member
    • May 2005
    • 17

    #1

    Zabbix 1.8 agent troubles. (using dashes in command arguments)

    Hi there.

    I've recently upgraded to Zabbix 1.8 (love the new features!)

    The agent, however, seems to fail with ZBX_NOTSUPPORTED when trying to execute a custom user command containing dashes '-' within the passed arguments.

    For example my user command:

    UserParameter=zstat[*],/opt/zabbix/bin/zstat.sh "$1" "$2" "$3"

    When called by:

    zstat[zpool,pool-0,capacity]
    - or -
    zstat[daemon,/opt/syslog-ng/sbin/syslog-ng,root]

    fails with ZBX_NOTSUPPORTED.
  • fips
    Member
    • Sep 2005
    • 38

    #2
    Same problem

    I have the same problem with user items.
    In 1.8 is a restriction of allowed characters in parameters:

    error: Special characters '\'"`*?[-]{}~$!&;()<>|#@' are not allowed in the parameters

    I loose a lot of flexibility for my user items, if I can not use this characters!
    I like to vote to get them back!

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Originally posted by traq911
      Hi there.

      I've recently upgraded to Zabbix 1.8 (love the new features!)

      The agent, however, seems to fail with ZBX_NOTSUPPORTED when trying to execute a custom user command containing dashes '-' within the passed arguments.

      For example my user command:

      UserParameter=zstat[*],/opt/zabbix/bin/zstat.sh "$1" "$2" "$3"

      When called by:

      zstat[zpool,pool-0,capacity]
      - or -
      zstat[daemon,/opt/syslog-ng/sbin/syslog-ng,root]

      fails with ZBX_NOTSUPPORTED.
      To remove the dash restriction here is a patch:

      Code:
      diff -ruN /root/zabbix-original/src/libs/zbxsysinfo/sysinfo.c /root/zabbix/src/libs/zbxsysinfo/sysinfo.c
      --- /root/zabbix-original/src/libs/zbxsysinfo/sysinfo.c    2010-01-18 21:16:48.000000000 -0500
      +++ /root/zabbix/src/libs/zbxsysinfo/sysinfo.c    2010-01-18 21:16:55.000000000 -0500
      @@ -341,7 +341,7 @@
           char buf[MAX_STRING_LEN];
           char command[MAX_STRING_LEN];
           register char *pl, *pr;
      -    const char    suppressed_chars[] = "\\'\"`*?[-]{}~$!&;()<>|#@\0", *c;
      +    const char    suppressed_chars[] = "\\'\"`*?[]{}~$!&;()<>|#@\0", *c;
       
           assert(out);

      Comment

      • gpmidi
        Member
        • Aug 2009
        • 62

        #4
        This is a problem for me too

        This is annoying me too. Will this be fixed in a later release?

        Comment

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

          #5
          Yes, it will be fixed!
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • gpmidi
            Member
            • Aug 2009
            • 62

            #6
            Excellent

            Excellent. I'm happy to hear it.

            Comment

            • ad@kbc-clearing.com
              Member
              • Sep 2005
              • 77

              #7
              In zabbix agent 1.6, the backslash (\) was no problem in a user parameter.
              In zabbix agent 1.8, it has become unsupported. Why ?
              Since we use a lot of backslashes in userparams, we have to stick with the 1.6 agent

              Will this be fixed ?
              Last edited by [email protected]; 30-01-2010, 16:01. Reason: Typo

              Comment

              • vinny
                Senior Member
                • Jan 2008
                • 145

                #8
                Hi Alexei,
                Is it already fixed ?
                It does not seem to be done with the revision 10048...

                And what about the forbidden pipe "|" too ?
                It is very useful on nux & windows....

                In the documentation of Win agent, it is said :
                User-defined parameter to monitor. There can be several user-defined parameters. Value has form <key>,<shell command>. Do not use spaces around pipe ('|') characters! Example:UserParameter=test,echo 1

                Originally posted by Alexei
                Yes, it will be fixed!
                thx,
                vinny
                Last edited by vinny; 10-02-2010, 15:25.
                -------
                Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

                Comment

                • vinny
                  Senior Member
                  • Jan 2008
                  • 145

                  #9
                  Has this problem been fixed in the dev version ?
                  This is very penalizing...

                  Originally posted by Alexei
                  Yes, it will be fixed!
                  vinny
                  -------
                  Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

                  Comment

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

                    #10
                    Originally posted by vinny
                    Has this problem been fixed in the dev version ?
                    This is very penalizing...



                    vinny
                    We introduced new parameter for Zabbix Agent: UnsafeUserParameters. Set it to 1 in order to allow any characters you want.
                    Alexei Vladishev
                    Creator of Zabbix, Product manager
                    New York | Tokyo | Riga
                    My Twitter

                    Comment

                    • vinny
                      Senior Member
                      • Jan 2008
                      • 145

                      #11
                      Great Alexei,
                      thx for the tips !

                      vinny
                      -------
                      Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

                      Comment

                      Working...