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

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

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

Post 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!!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
bennyboy
Posts: 157
Joined: Thu Oct 29, 2015 9:42 am

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

Post 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!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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/