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
Post
by 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
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by 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?
brt24574
Posts: 16 Joined: Thu Jan 03, 2019 1:29 pm
Post
by 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
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by scottwilkerson » Wed Jan 09, 2019 2:58 pm
Can you share the nagios command definition for check_fileserver_share
brt24574
Posts: 16 Joined: Thu Jan 03, 2019 1:29 pm
Post
by 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.
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by 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?
brt24574
Posts: 16 Joined: Thu Jan 03, 2019 1:29 pm
Post
by 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: 16 Joined: Thu Jan 03, 2019 1:29 pm
Post
by brt24574 » Wed Jan 09, 2019 4:15 pm
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:
Post
by scottwilkerson » Wed Jan 09, 2019 4:37 pm
brt24574 wrote:
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?