Ad Widget

Collapse

Passing parameter containing a comma to UserParameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • symfrog
    Junior Member
    • Oct 2009
    • 12

    #1

    Passing parameter containing a comma to UserParameter

    Hi

    I am using Zabbix 1.8, Is it possible to pass parameters to a UserParameter item that contains a comma. For example I have a jmx UserParameter defined as follows in zabbix_agentd.conf:

    UserParameter=jmx[*],curl -s -u tomcat_user:tomcat_pass http://127.0.0.1:8080/manager/jmxproxy/?qry=$1 | egrep $2 | cut -f2 -d ':' | sed 's/^ *//g' | sed 's/ *$//g'

    I want to be able to use it as follows in the webinterface (and test with zabbix_get):

    jmx[java.lang:type=GarbageCollector,name=ConcurrentMar kSweep][CollectionTime]


    (Also tried jmx["java.lang:type=GarbageCollector,name=ConcurrentMa rkSweep","CollectionTime"] )


    This seems to be not supported (to pass a parameter that itself contains a comma) or I have the incorrect syntax.

    What is the correct syntax for this or is there a work around?
    (I would prefer to not specify a seperate UserParameter for each JMX attribute!)
    Last edited by symfrog; 17-12-2009, 11:57.
  • symfrog
    Junior Member
    • Oct 2009
    • 12

    #2
    I also tried everything mentioned on this thread that claims the problem is fixed:



    None of the suggestions work. Surely this is possible? Anyone know?

    Comment

    • trikke
      Senior Member
      • Aug 2007
      • 140

      #3
      Hi Dunno, but does this work?:

      jmx[java.lang:type=GarbageCollector\,name=ConcurrentMa rkSweep,CollectionTime] --> note the backslash

      greets
      Patrick

      Comment

      • symfrog
        Junior Member
        • Oct 2009
        • 12

        #4
        Nope, doesn't work

        Comment

        • maxlock
          Member
          • Mar 2005
          • 32

          #5
          Bug regression?

          Hiya,

          I'm getting this same problem with Zabbix 1.8.5

          /usr/sbin/zabbix_agent -t jmx.["pirelli","8991","java.lang:type=MemoryPool,name=T enured Gen","Usage"]

          jmx.[pirelli,8991,java.lang:type=MemoryPool,name=Tenure d Gen,Usage] [t|JMX CRITICAL - objectName not found [java.lang:type=MemoryPool]]

          notice the comma inside the 3rd argument, and how the 2nd half (after the comma) of the 3rd argument is missing in the objectnName error output, indicating that the parsing is failing.

          -Cheers Max.

          Comment

          Working...