Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-6858

Running user parameter shows "ZBX_NOTSUPPORTED" depending on the result of the triggered command

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 2.1.1
    • Agent (G)
    • None
    • CentOS

      When I trigger "maven clean install" defined as a UserParameter I get either correct ouput (when build fails) or ZBX_NOTSUPPORTED when build is success. I can manually run the command as zabbix user. My guess is that zabbix-agent doesn't support output of the (UserParameter) command longer than some limit.

      Example:

      In file /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf I have three user parameters:

      UserParameter=test.sip1, cd /var/lib/zabbix/myapp/ && /labs/apache-maven-3.0.4/bin/mvn -v
      UserParameter=test.sip2, cd /tmp/ && /labs/apache-maven-3.0.4/bin/mvn clean install
      UserParameter=test.sip3, cd /var/lib/zabbix/myapp/ && /labs/apache-maven-3.0.4/bin/mvn clean install

      As a result test.sip1 works correctly displaying the version of maven, test.sip2 works also correctly (it displays build fails since 'maven clean install' is executed in wrong directory), and last key test.sip3 displays ZBX_NOTSUPPORTED. When I execute "cd /var/lib/zabbix/myapp/ && /labs/apache-maven-3.0.4/bin/mvn clean install" as zabbix user manually, then it works correctly.

      In practice it works like that:

      [root@dt-p-nexus-a1 ~]# zabbix_get -s 127.0.0.1 -k "test.sip1"
      Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
      Maven home: /tlabs/apache-maven-3.0.4
      Java version: 1.7.0_10, vendor: Oracle Corporation
      Java home: /tlabs/jdk1.7.0_10/jre
      Default locale: pl_PL, platform encoding: UTF-8
      OS name: "linux", version: "2.6.32-042stab078.26", arch: "amd64", family: "unix"

      [root@dt-p-nexus-a1 ~]# zabbix_get -s 127.0.0.1 -k "test.sip2"
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 0.198s
      [INFO] Finished at: Wed Aug 07 12:12:31 GMT+00:00 2013
      [INFO] Final Memory: 5M/91M
      [INFO] ------------------------------------------------------------------------
      [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/tmp). Please verify you invoked Maven from the correct directory. -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

      [root@dt-p-nexus-a1 ~]# zabbix_get -s 127.0.0.1 -k "test.sip3"
      ZBX_NOTSUPPORTED

            Unassigned Unassigned
            tklo Tomasz Kłosiński
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: