Page 1 of 1

Nagios XI Mod_gearman don't interpret $USER1$ and or $ARG1$

Posted: Thu Nov 18, 2021 12:07 pm
by bennyboy
On the Nagios XI side I define a new commande like this.

Code: Select all

/usr/bin/env ORACLE_HOME=/oracle/product/instantclient_21_4 PATH=$PATH:/oracle/instantclient_21_4 TNS_ADMIN=/oracle/product/instantclient_21_4 LD_LIBRARY_PATH=/oracle/product/instantclient_21_4:/usr/local/lib:/lib:/usr/lib $USER1$/check_oracle_health $ARG1$
and test also

Code: Select all

/usr/bin/env ORACLE_HOME=/oracle/product/instantclient_21_4 PATH=$PATH:/oracle/instantclient_21_4 TNS_ADMIN=/oracle/product/instantclient_21_4 LD_LIBRARY_PATH=/oracle/product/instantclient_21_4:/usr/local/lib:/lib:/usr/lib /usr/local/nagios/libexec/check_oracle_health $ARG1$
I activate the tracing on mod_gearman worker side and I saw this for the new service check definition.

Code: Select all

command_line=/usr/bin/env ORACLE_HOME=/oracle/product/instantclient_21_4 PATH=$PATH:/oracle/instantclient_21_4 TNS_ADMIN=/oracle/product/instantclient_21_4 LD_LIBRARY_PATH=/oracle/product/instantclient_21_4:/usr/local/lib:/lib:/usr/lib /usr/local/nagios/libexec/check_oracle_health $ARG1$



<---
[2021-11-18 11:46:46][15878][TRACE] do_exec_job()
[2021-11-18 11:46:46][15878][DEBUG] got service job: sldgbd0326 - Oracle Connected Users - xcenterd
[2021-11-18 11:46:46][15878][TRACE] timeout: 60, core latency: 0
[2021-11-18 11:46:46][15878][TRACE] command: /usr/bin/env ORACLE_HOME=/oracle/product/instantclient_21_4 PATH=$PATH:/oracle/instantclient_21_4 TNS_ADMIN=/oracle/product/instantclient_21_4 LD_LIBRARY_PATH=/oracle/product/instantclient_21_4:/usr/local/lib:/lib:/usr/lib /usr/local/nagios/libexec/check_oracle_healt
h $ARG1$
[2021-11-18 11:46:46][15878][TRACE] execute_safe_command(60, /usr/bin/env ORACLE_HOME=/oracle/product/instantclient_21_4 PATH=$PATH:/oracle/instantclient_21_4 TNS_ADMIN=/oracle/product/instantclient_21_4 LD_LIBRARY_PATH=/oracle/product/instantclient_21_4:/usr/local/lib:/lib:/usr/lib /usr/local/nagios/libexec/ch
eck_oracle_health $ARG1$)
I compare it with a service check that running for long time and the working one interpret $USER1$ and $ARG1$ with the right information.

I also validated the /usr/local/nagios/etc/resource.cfg

Code: Select all

# Path to the plugins
$USER1$=/usr/local/nagios/libexec

# Path to event handlers
#$USER2$=/usr/local/nagios/libexec/eventhandlers

# Port for NSClient++
$USER7$=12489
# Password for NSClient++
$USER8$=secret
Any idea ? Thx in advance!!

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Fri Nov 19, 2021 10:49 am
by ssax
The nagios process should be expanding the macros before being sent into the gearman job server.

Please PM me a copy of your profile.zip, you can download it from Admin > System Profile by clicking the Download Profile button.

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Fri Dec 17, 2021 3:21 pm
by ssax
What version of gearman is running on the XI server and the worker? Send the output of this command from both:

Code: Select all

rpm -qa | grep -i gear
Please attach this from your XI server:

Code: Select all

/etc/mod_gearman/module.conf
And this from the worker:

Code: Select all

/etc/mod_gearman/worker.conf

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Wed Dec 22, 2021 6:07 pm
by bennyboy
Result of :

Code: Select all

rpm -qa | grep -i gear

Code: Select all

gearmand-server-0.33-7.x86_64
libgearman-1.1.12-18.el7.x86_64
gearmand-0.33-7.x86_64
mod_gearman-debuginfo-3.3.0-1.el7.x86_64
gearmand-devel-0.33-7.x86_64
mod_gearman-3.3.0-1.el7.x86_64

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Mon Dec 27, 2021 2:17 pm
by ssax
Is that output and those files from the XI server or the worker?

Please send the output of this one for BOTH the XI server and the worker and let me know which is which:

Code: Select all

rpm -qa | grep -i gear
I'm labbing this up with the latest to see what the proper versions are.

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Mon Dec 27, 2021 6:11 pm
by ssax
Here's what I have on the worker:

Code: Select all

mod_gearman-3.3.0-1.el7.x86_64
gearmand-1.1.19-1.el7.x86_64
And on the XI server:

Code: Select all

gearmand-1.1.19-1.el7.x86_64
mod_gearman-3.3.0-1.el7.x86_64
gearmand-server-1.1.19-1.el7.x86_64
I would run the upgrade process for gearman on the XI server and the workers again to get the latest versions:

https://assets.nagios.com/downloads/nag ... ios_XI.pdf

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Wed Jan 12, 2022 8:15 am
by bennyboy
Hello ssax,

I plan to update Nagios XI next week. I am reviewing the procedure and I notice that in the mod_gearman update script the version seems locked at 0.33

Code from ModGearmanInstall.sh

Code: Select all

# default values
log="mod_gearman_install.log"
nagios_cfg="/usr/local/nagios/etc/nagios.cfg"
nagios_bin="/usr/local/nagios/bin/nagios"
lib_dir="/usr/lib"
tmp_dir="/tmp"
install_type=""
upgrade=false
gearmand_version="0.33-7"
user="nagios"
echobin="/bin/echo -e"
I also noticed this comment in the scripts in question.
* Only run this script on a machine with no previous gearman installations

Nagios XI server

Code: Select all

gearmand-server-0.33-7.x86_64
libgearman-1.1.12-18.el7.x86_64
gearmand-0.33-7.x86_64
mod_gearman-debuginfo-3.3.0-1.el7.x86_64
gearmand-devel-0.33-7.x86_64
mod_gearman-3.3.0-1.el7.x86_64
Gearman Worker

Code: Select all

libgearman-1.1.12-18.el7.x86_64
gearmand-0.33-7.x86_64
mod_gearman-debuginfo-3.3.0-1.el7.x86_64
gearmand-devel-0.33-7.x86_64
mod_gearman-3.3.0-1.el7.x86_64
Do I understand that my versions are not up to date? Do I really need to use the update script

Nagios XI Server

Code: Select all

./ModGearmanInstall.sh --type=server --upgrade
Nagios XI Gearman Worker

Code: Select all

./ModGearmanInstall.sh --type=worker --upgrade
If you want to setup a remote session / live chat. I'm open.

Thx in advance!

Re: Nagios XI Mod_gearman don't interpret $USER1$ and or $AR

Posted: Mon Jan 17, 2022 10:19 am
by ssax
Please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/