Ad Widget

Collapse

User parameter fails when running maven

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tklo
    Junior Member
    • Aug 2013
    • 3

    #1

    User parameter fails when running maven

    Hi,

    I have a problem with user parameter. I have a git repo in which I have some cucumber tests - I would like to run them using zabbix_agent.

    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.

    What could be the problem? Maybe the output of third test.sip3 is too long?
  • tklo
    Junior Member
    • Aug 2013
    • 3

    #2
    Example how does it look

    Code:
    [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"

    Code:
    [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

    Code:
    [root@dt-p-nexus-a1 ~]# zabbix_get -s 127.0.0.1 -k "test.sip3"
    ZBX_NOTSUPPORTED
    The question is why the third option does not work? I can run the command as a zabbix user manually.

    Comment

    • tklo
      Junior Member
      • Aug 2013
      • 3

      #3
      OK, I know what is the problem. I thought that it is a bug and submited it to Zabbix jira here:


      And it occured that the problem is of timeout - zabbix agent has a default timeout of 3 sec. I've change it to the max possible timeout which is 30 sec, but still it doesn't help me much, because my "maven clean install" works longer than 30 sec. Anyone has an idea how to work around this problem?

      Comment

      Working...