Ad Widget

Collapse

External check problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bobrivers
    Senior Member
    • Feb 2007
    • 115

    #1

    External check problem

    Hi,

    I'm trying to use an external check to verify JMX parameters. I'm using jmxclient in order to do it.

    I've build a script like this:

    /usr/lib/jvm/java/bin/java -jar /home/zabbix/jmxclient.jar usr: pass host: port $1 2>&1 | awk -F: '{print $NF}'

    If I execute the script manually (as zabbix user) it will run like a charm:

    ./jmx.sh java.lang:type=Threading\ ThreadCount

    So, I created a new item in zabbix:

    Description:ThreadCount
    Type: External check
    Key: jmx.sh[java.lang:type=Threading\ ThreadCount]


    The script is being called, but I'm receiving an error from jmxclient: Key properties cannot be empty

    This error occurs when jmxclient isn't supplied with a mbean to query.

    So, I'm guessing that my item isn't properly configured.

    What is wrong with my item?

    TIA,

    Bob
    Last edited by bobrivers; 15-06-2010, 14:28.
  • bobrivers
    Senior Member
    • Feb 2007
    • 115

    #2
    Up

    Hi,

    Reading the manual helped a lot...

    The external check will "append" an extra parameter even if you don't especify it. From zabbix manual:

    Execute script check_oracle.sh with parameters ”-h 192.168.1.4”: (check_oracle.sh[-h 192.168.1.4]). Zabbix will execute: check_oracle.sh www1.company.com -h 192.168.1.4.

    So I changed my script. Instead of use $1, I'm using $2 since I don't need the hostname...
    Last edited by bobrivers; 15-06-2010, 14:47. Reason: found answer

    Comment

    Working...