execvp(/command_name, ....)

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.
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

execvp(/command_name, ....)

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Can you share the nagios command definition for check_fileserver_share
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

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

Post 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$
	}
Last edited by brt24574 on Wed Jan 09, 2019 3:43 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

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

Post 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
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
brt24574
Posts: 16
Joined: Thu Jan 03, 2019 1:29 pm

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

Post by brt24574 »

I think so :lol:
Locked