Power Global

 View Only
  • 1.  Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Wed November 01, 2023 05:27 AM

    Installed Nagios 4.4.14 on RHEL 7.9 lpar for monitoring IBMi/AIX lpars, but got a Java ClassNotFoundError, when configuring a IBMi lpar
    (step 3 of: Setting Up Nagios Plug-in for IBM i

    Ibm remove preview
    Setting Up Nagios Plug-in for IBM i
    Nagios provides enterprise-class Open Source IT monitoring, network monitoring, server and applications monitoring. A released version of IBM i plug-in for Nagios has been created to support monitoring IBM i systems.
    View this on Ibm >

    )

    nagios]# /bin/bash /usr/local/nagios/libexec/host_config.sh -i host
    Input the host address(IP):XXXXXX
    Input the userID: YYYYYYY
    Input the password:
    Confirm the password:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400
    at com.ibm.nagios.config.HostConfig.Insert(HostConfig.java:113)
    at com.ibm.nagios.config.HostConfig.main(HostConfig.java:82)
    Caused by: java.lang.ClassNotFoundException: com.ibm.as400.access.AS400
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 2 more

    tried to set $CLASSPATH to the jar files, but still same result.....

    Anyone an idea to fix this problem?



    ------------------------------
    Emiel van ter Beek
    ------------------------------


  • 2.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Fri November 03, 2023 04:06 PM

    It looks like you don't have JT400 or JTOPEN installed . The missing java class com.ibm.as400.access.AS400 it's included on both the .jar files. Have a look here https://www.ibm.com/support/pages/welcome-ibm-toolbox-java-and-jtopen and download JTOpen. 



    ------------------------------
    Alberto Ernestini
    ------------------------------



  • 3.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Fri November 17, 2023 05:33 AM

    Hi Alberto,

    On the Nagios RHEL server the jar file is available, but in https://www.ibm.com/support/pages/setting-nagios-plug-ibm-i nothing is mentioned about installing something on a IBMi lpar?!

    On the RHEL Nagios server:

    # find /usr -name jt*.jar
    /usr/local/nagios/libexec/jt400.jar
    /usr/local/nagios/nagios-for-i-master/Wizard for NagiosXI/ibmiservice/plugins/jt400.jar
    /usr/local/nagios/nagios-for-i-master/libexec/jt400.jar



    ------------------------------
    Emiel van ter Beek
    ------------------------------



  • 4.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Fri November 17, 2023 06:30 AM

    Hello Emiel,

    jt400 should be already installed on your LPAR.

    Check this IBM Document https://www.ibm.com/support/pages/where-should-toolbox-jar-files-be-installed-ibm-i that explain where to install/find the jt400.jar file.

    If as i imagine the connection starts from the RHEL server you should have the jt400 file only on the server side and not necessarily on IBM i LPAR.

    If you have any further debug messages from this "/bin/bash /usr/local/nagios/libexec/host_config.sh -i host" script please post it.



    ------------------------------
    Alberto Ernestini
    ------------------------------



  • 5.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Fri November 17, 2023 07:41 AM

    Hi Alberto,

    The script runs on the Nagios server on RHEL.

    I added the directory where the jar files reside into the CLASSPATH:
     echo $CLASSPATH
    :/usr/local/nagios/libexec/

    ls -l /usr/local/nagios/libexec/*.jar
    -rw-r--r--. 1 501 games  240514 Nov  4  2019 /usr/local/nagios/libexec/gson.jar
    -rw-rw-rw-. 1 501 games 4703153 May 11  2017 /usr/local/nagios/libexec/jt400.jar
    -rw-r--r--. 1 501 games  330473 Apr 10  2020 /usr/local/nagios/libexec/nagios4i.jar

    The contents of the script is:

    # cat host_config.sh
    #!/bin/bash
    java -cp /usr/local/nagios/libexec/nagios4i.jar com.ibm.nagios.config.HostConfig $1 $2

    no idea how to debug that 



    ------------------------------
    Emiel van ter Beek
    ------------------------------



  • 6.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Fri November 17, 2023 08:57 AM

    It looks that you're not "alone" with this problem. Check this blog post https://github.com/IBM/nagios-for-i/issues/17 where someone else had the same problem. It points to another site where you can download a PDF of a fully working Nagios installation. Hope it helps.

    Just for your information i am using CheckMk for monitor IBM i Lpars but there is no avaliable plugin , i've made a port of it and i wrote all the needed plugins for monitor the health and status of every LPAR. The nagios plugin should does almost the same, i hope you will be able to make it working.



    ------------------------------
    Alberto Ernestini
    ------------------------------



  • 7.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Mon November 20, 2023 02:13 AM

    This script is working here:

    #!/bin/bash
    java -cp /usr/local/nagios/libexec/jt400.jar:/usr/local/nagios/libexec/nagios4i.jar com.ibm.nagios.config.HostConfig $1 $2

    Don't forget to create /usr/local/nagios/etc/objects/ and /usr/local/nagios/var/ 😉



    ------------------------------
    Sylvain Manceau
    ------------------------------



  • 8.  RE: Java Class Notfound error setting up Nagios Plug-in for IBMi

    Posted Mon November 20, 2023 04:31 AM

    Thanks, script is working now :-) 



    ------------------------------
    Emiel van ter Beek
    ------------------------------