Ad Widget

Collapse

proc.num with comma

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ninguno
    Junior Member
    • Nov 2011
    • 29

    #1

    proc.num with comma

    I'm trying to create a proc.num item with a comma in the last parameter but it fails.

    My test was
    zabbix_agent -t proc.num[ruby,,,"server.rb -p 1,2"]
    proc.num[ruby,,,ruby server.rb -p 1,2] [m|ZBX_NOTSUPPORTED]

    If i remove the comma it works
    zabbix_agent -t proc.num[ruby,,,"server.rb -p 1"]
    proc.num[ruby,,,server.rb -p 1] [u|1]

    Is this an expected behaviour? Shouldn't the comma be allowed?
  • ninguno
    Junior Member
    • Nov 2011
    • 29

    #2
    Sorry, anybody knows this?

    Comment

    • nelsonab
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2006
      • 1233

      #3
      Have you tried to escape the comma in the quotation? This is part of a longstanding bug in Zabbix and how it parses quoted strings.
      RHCE, author of zbxapi
      Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
      Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

      Comment

      • ninguno
        Junior Member
        • Nov 2011
        • 29

        #4
        Hi nelson. Yes i tried escaping with the slash but didn't work either

        zabbix_agent -t proc.num[ruby,,,"server.rb -p 1\,2"]
        proc.num[ruby,,,server.rb -p 1\,2] [m|ZBX_NOTSUPPORTED]

        Is there any other character to escape?
        Thanks in advance!

        Comment

        • nelsonab
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2006
          • 1233

          #5
          Have a look at the following ticket. It's closed with a wontfix, but it shows a workaround: https://support.zabbix.com/browse/ZBX-3957

          There is this one from a while ago as well: https://support.zabbix.com/browse/ZBX-694

          Alternatively since you're using a ruby program you might be able to get around this another way. Are you using the split method on the values passed in? If so you could pass split a different character to be used as the delimiter, in which case you might be able to use the ^ character for instance. That's only if you wrote the ruby script you're using. Along those lines, you could set up another command line option in which you pass the delimiter, you will want to pull the delimiter first in your code however. ;-)
          RHCE, author of zbxapi
          Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
          Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

          Comment

          • ninguno
            Junior Member
            • Nov 2011
            • 29

            #6
            Nelson, thank you very much for your help! After reading the threads yo send me I get it working making "requoting" of command with single quotes like this.

            zabbix_agent -t proc.num[ruby,,,'"server.rb -p 1,2"']
            proc.num[ruby,,,"server.rb -p 1,2"] [u|1]

            Now its working great!
            Last edited by ninguno; 23-11-2011, 19:36.

            Comment

            Working...