Page 2 of 4
Re: showmount: Program not registered
Posted: Tue Oct 02, 2018 3:39 pm
by npolovenko
@shamrozkadiwal , Please run the following commands on the awhu013a server and show us the output:
showmount
service nfs status
Re: showmount: Program not registered
Posted: Thu Oct 04, 2018 11:04 am
by shamrozkadiwal
output
Code: Select all
[shkadi@awhu013a ~]$ sudo /sbin/service nfs status
[sudo] password for shkadi:
rpc.mountd (pid 6350) is running...
nfsd (pid 6347 6346 6345 6344 6343 6342 6341 6340) is running...
rpc.rquotad (pid 6334) is running...
[shkadi@awhu013a ~]$
[shkadi@awhu013a ~]$ sudo /usr/sbin/showmount
Hosts on awhu013a:
10.X.X.X
10.X.X.X
[shkadi@awhu013a ~]$
Re: showmount: Program not registered
Posted: Thu Oct 04, 2018 1:03 pm
by npolovenko
@shamrozkadiwal, Here's what I've found.
Depending on your NFS server, you might need to install these two plugins
suid root (chown root check_nfs*; chmod 4750 check_nfs*). This is because
NFS servers often disallow mount requests from non-privileged ports, and
the plugins need root rights to bind to a privileged port when mounting.
Please run these two chmod commands and let me know if it fixes the issue.
Re: showmount: Program not registered
Posted: Thu Oct 04, 2018 2:22 pm
by shamrozkadiwal
So, you want me to change the ownership of check_nfs.pl on the nagios server NOT on the client side, correct?
Right now on Nagios server
shkadi@camel /usr/lib/nagios/plugins $ pwd
/usr/lib/nagios/plugins
shkadi@camel /usr/lib/nagios/plugins $
shkadi@camel /usr/lib/nagios/plugins $ ls -al check_nfs.pl
-rwxr-xr-x 1 nagios nagios 2926 Mar 30 2010 check_nfs.pl
shkadi@camel /usr/lib/nagios/plugins $
Re: showmount: Program not registered
Posted: Thu Oct 04, 2018 3:52 pm
by npolovenko
@shamrozkadiwal, If I understood correctly this plugin is not installed on the client side, only on the server side. Please run the following commands on the nagios server:
chmod 777 /usr/lib/nagios/plugins/check_nfs.pl
chmod u+s /usr/lib/nagios/plugins/check_nfs.pl
chown apache.nagios /usr/lib/nagios/plugins/check_nfs.pl
Re: showmount: Program not registered
Posted: Fri Oct 05, 2018 8:47 am
by shamrozkadiwal
Old
shkadi@camel /usr/lib/nagios/plugins $ ls -la check_nfs.pl
-rwxr-xr-x 1 nagios nagios 2926 Mar 30 2010 check_nfs.pl
New
shkadi@camel /usr/lib/nagios/plugins $ ls -la check_nfs.pl
-rwsrwxrwx 1 apache nagios 2926 Mar 30 2010 check_nfs.pl
Still seeing the issue
Re: showmount: Program not registered
Posted: Fri Oct 05, 2018 10:11 am
by scottwilkerson
I noticed when you have run several of the commands throughout the post you use sudo
Code: Select all
sudo /usr/lib/nagios/plugins/check_rpc -H X.X.X.X -C nfs -c2,3
Have you added a sudoers entry for the plugin that you are actually using so the nagios user has sudo access?
Re: showmount: Program not registered
Posted: Fri Oct 05, 2018 10:30 am
by shamrozkadiwal
@Scottwilkerson, yes, I have added those two entries in the sudoers for nagios
nagios localhost=/usr/nagios/libexec/check_smb.sh
nagios ALL = NOPASSWD:/usr/local/nagios/libexec/*
Re: showmount: Program not registered
Posted: Fri Oct 05, 2018 10:46 am
by scottwilkerson
Earlier you also shared this
Code: Select all
define command{
command_name check_nfs
command_line $USER1$/check_nfs.pl -H $HOSTADDRESS$
}
But you are not putting sudo in front of the command
Change to this and restart nagios
Code: Select all
define command{
command_name check_nfs
command_line sudo $USER1$/check_nfs.pl -H $HOSTADDRESS$
}
Re: showmount: Program not registered
Posted: Fri Oct 05, 2018 2:20 pm
by shamrozkadiwal
I put sudo in front of $USER1$/check_nfs.pl -H $HOSTADDRESS$ and restart the nagios. nothing happened