Trouble with User Host Profile for IBMi Nagios plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
ptsmit
Posts: 7
Joined: Wed Mar 06, 2024 2:27 pm

Trouble with User Host Profile for IBMi Nagios plugin

Post by ptsmit »

Hi all,

I'm trying to get de IBMi plugin for Nagios running.

Envrionment:
Linux server with Nagios core installed.
Latest IBMi for Nagios plugin installed.
A number of IBMi servers

If I write <hosts>, this text is replaced with the hostname of the IBMi server.

As a test I try to setup an IBMi server within the Nagios Core environment.
1. Created a user host profile with
/bin/bash /usr/local/nagios/libexec/host_config.sh -i <host>.
This is setup correctly and user can log in. Otherwise these command will give an error back that it is not possible to
connect/logon to the IBMI system.
2. I created a host config file for this server (in etc/objects/<host>.cfg) where I put the server definition. And for the test 1 service definition.
3. Put the name of the <host>.cfg file in the etc/nagios.cfg file to load during startup of the nagios server.
4. Run the "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" command and no errors show up.
5. Restart the nagios server.

In de simple Nagios Core GUI the server shows up and also the ping command to the server is working as check-alive-server.
Also the service check I defined in de <host>.cfg file is showing up but with the message : "host User Profile not set".
I allready start allover again. I also changed password to simple passwords with no special charaters. I removed and inserted the service again in de <host>.cfg file.

When I start the commands manually from the commandline to the configured IBMi server is seems working perfectly.
With the user root, nagiosadmin (no difference, it works)
E.g.

"/bin/bash ../../libexec/check_ibmi_status.sh -M BasicInfo -H <host>" (calling from objects directory)

It will give me the versionnumber of the IBMi software, in my case V7R4M0
Also all the other options built in in the IBMi plugin will work from the commandline without problem

But not from within the nagios core server/module/plugin.

Anybody some idea, any idea would be welcome.



Thanks in advance.

Kind regards,
Tom.
Last edited by ptsmit on Tue Mar 12, 2024 2:45 am, edited 1 time in total.
ptsmit
Posts: 7
Joined: Wed Mar 06, 2024 2:27 pm

Re: Trouble with User Host Profile for IBMi Nagios plugin

Post by ptsmit »

Suppl.

Using the command
/bin/bash /usr/local/nagios/libexec/host_config.sh -a
I can see that the user host profiles are in place.

I used
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
to verify cfg (-files) no errors.
The checks are running regurlaly and the GUI-screen is every time updated.

After every change I also restart the nagios service.
/bin/bash /usr/local/nagios/libexec/server_restart.sh

I have not a clue at the moment.
Last edited by ptsmit on Tue Mar 12, 2024 2:43 am, edited 1 time in total.
ptsmit
Posts: 7
Joined: Wed Mar 06, 2024 2:27 pm

Re: Trouble with User Host Profile for IBMi Nagios plugin

Post by ptsmit »

Suppl.

I found a problem with using CAPITALS and NON-capitals using for the hostnames in de host userprofiles. After some testing and trying I quit en cleared the complet host user profile file by deleting al entries. I had no idea what combination should work using host-names. I started again in stead of using node names I used IP addresses. That seems to work.
At least one check (check-ibmi-disk-status) is running now on my test servers (on two out of three server at least).

Adding a second check (check-ibmi-basic-info) give me an error message:
"Exception - java.lang.NullPointerException
com.ibm.nagios.ConnectToSystem.run(ConnectToSystem.java:42)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base/java.lang.Thread.run(Thread.java:834)
"

So that is the next challenge. Only one check is working all other checks are not working. And giving me the mentioned java error.
ptsmit
Posts: 7
Joined: Wed Mar 06, 2024 2:27 pm

Re: Trouble with User Host Profile for IBMi Nagios plugin

Post by ptsmit »

Is there anybody who knows how host user profiles are working and what the connection is with the hostname or IP addresses working with the IBMi plugin for Nagios.
And YES I have the standard explanations found on the WWW. It's also not clear how to add parameters to these commands.

I'm using the Nagios core module with the IBMi plugin correctly installed on a Linux server runniing on powersystem.

Host definition:
This check is working fine.
#####################################################
# HOST DEFINITION #
#####################################################


define host {
host_name hostname
alias hostname
address ip-address
max_check_attempts 3
check_period 24x7
check_command check-host-alive
check_interval 5
contact_groups IBMi-Contacts
notification_interval 60
notification_period 24x7
}



Service definitions:
This service is also running okay on two of three hosts (one host gives an error "Error - CPFB003: Certificate store password is not valid. "
#####################################################
# Diskconfig Check #
#####################################################
define service {
hostgroup_name IBMi_servers
service_description Check Diskconfig
check_command check-ibmi-disk-config
max_check_attempts 3
check_interval 5
retry_interval 3
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
notifications_enabled 1
contact_groups IBMi-Contacts
}


All other services aren't working at all, giving a java error.
Exception - java.lang.NullPointerException.
Al definitions are the same as the firts definition which is working okay.

#####################################################
# Basic Info Check #
#####################################################
define service {
hostgroup_name IBMi_servers
service_description Check Basic info
check_command check-ibmi-basic-info
max_check_attempts 3
check_interval 5
retry_interval 3
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
notifications_enabled 1
contact_groups IBMi-Contacts
}


When running the command directly from the commandline it al works perfectly
eg.

/bin/bash /usr/local/nagios/libexec/check_ibmi_status.sh -M BasicInfo -H <hostname>
Gives me the versionnumber of the systemsoftware running on that machine.

See attachment.
Nagios testservers.JPG
Post Reply