Page 1 of 2

execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 9:22 am
by brt24574
Nagios is trying to execute $USER2$ commands from the root directory.

private/resource.cfg

Code: Select all

# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/lib64/nagios/plugins
#$USER1$=/usr/local/nagios/libexec #From RHEL5/Nagios 3

# Sets $USER2$ to be the path to the custom plugins
$USER2$=/usr/lib64/nagios/plugins/custom
#$USER2$=/usr/local/lib/nagios/plugins #From RHEL5/Nagios 3
Version 4.3.4
Linux 4.14.35-1818.4.7.el7uek.x86_64

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 1:53 pm
by scottwilkerson
brt24574 wrote:Nagios is trying to execute $USER2$ commands from the root directory.
I'm not sure I understand what the question is here, can you add an example of what the issue is?

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 2:48 pm
by brt24574
using the web UI, looking at
Current Status > Services > Service Status Totals > Critical
http://hostname/nagios/cgi-bin/status.c ... ustypes=15

The status information shows this
(No output on stdout) stderr: execvp(/check_fileserver_share, ...) failed. errno is 2: No such file or directory

The check_fileserver_share plugin is in the path of
/usr/lib64/nagios/plugins/custom
as defined in my resource.cfg file

I created a symbolic link to force the command to work

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 2:58 pm
by scottwilkerson
Can you share the nagios command definition for check_fileserver_share

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 3:16 pm
by brt24574
this command is located in file
/etc/nagios/conf.d/systems/commands.cfg

Code: Select all

# 'check_fileserver_share'
define command{
	command_name	check_fileserver_share
	command_line	$USER2$/check_fileserver_share $HOSTADDRESS$ $ARG1$
	}

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 3:42 pm
by scottwilkerson
That looks correct, can you verify that in your nagios.cfg you are pointing to the correct path to your resources.cfg you posted and not a different file?

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 3:45 pm
by brt24574
it is correctly declared

Code: Select all

resource_file=/etc/nagios/private/resource.cfg
permissions

Code: Select all

-rw-r--r-- 1 root nagios 1312 Nov 20  2017 /etc/nagios/private/resource.cfg

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 4:15 pm
by brt24574
:oops:
I forgot an important piece of the puzzle.

In my puppet configuration I did not copy my file resource.cfg up to the nagios server, so it was using the default file resource.cfg

Re: execvp(/command_name, ....)

Posted: Wed Jan 09, 2019 4:37 pm
by scottwilkerson
brt24574 wrote::oops:
I forgot an important piece of the puzzle.

In my puppet configuration I did not copy my file resource.cfg up to the nagios server, so it was using the default file resource.cfg
Ahhh, that would do it. So is the issue resolved? May we lock the thread?

Re: execvp(/command_name, ....)

Posted: Thu Jan 10, 2019 9:17 am
by brt24574
I think so :lol: