execvp(/command_name, ....)

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

execvp(/command_name, ....)

Postby brt24574 » Wed Jan 09, 2019 9:22 am

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

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

Postby scottwilkerson » Wed Jan 09, 2019 1:53 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12916
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby brt24574 » Wed Jan 09, 2019 2:48 pm

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

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

Postby scottwilkerson » Wed Jan 09, 2019 2:58 pm

Can you share the nagios command definition for check_fileserver_share
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12916
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby brt24574 » Wed Jan 09, 2019 3:16 pm

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

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

Postby scottwilkerson » Wed Jan 09, 2019 3:42 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12916
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby brt24574 » Wed Jan 09, 2019 3:45 pm

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: 14
Joined: Thu Jan 03, 2019 1:29 pm

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

Postby brt24574 » Wed Jan 09, 2019 4:15 pm

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

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

Postby scottwilkerson » Wed Jan 09, 2019 4:37 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12916
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

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

Postby brt24574 » Thu Jan 10, 2019 9:17 am

I think so :lol:
brt24574
 
Posts: 14
Joined: Thu Jan 03, 2019 1:29 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 15 guests