Page 2 of 2
Re: Nested FS Monitoring troubles
Posted: Mon Dec 02, 2013 1:41 pm
by lmiltchev
Interestingly enough, this is the output I receive when executing as user: nagios:
[root@nagios-server01 ~]# su -l nagios -c '/usr/lib64/nagios/plugins/check_disk -w 10% -c 5% -p /opt/mount-a/mount-a1'
This account is currently not available.
What's the output of the following command?
Re: Nested FS Monitoring troubles
Posted: Tue Dec 03, 2013 11:19 am
by upsideofdown
lmiltchev wrote:Interestingly enough, this is the output I receive when executing as user: nagios:
[root@nagios-server01 ~]# su -l nagios -c '/usr/lib64/nagios/plugins/check_disk -w 10% -c 5% -p /opt/mount-a/mount-a1'
This account is currently not available.
What's the output of the following command?
The account is present, and does have an entry in /etc/passwd just set to nologin.
Code: Select all
nagios:x:498:499::/var/spool/nagios:/sbin/nologin
Re: Nested FS Monitoring troubles
Posted: Tue Dec 03, 2013 12:11 pm
by abrist
upsideofdown wrote:nagios

498:499::/var/spool/nagios:/sbin/nologin
Change /sbin/nologin to /bin/bash and try the check again.
Re: Nested FS Monitoring troubles
Posted: Wed Dec 04, 2013 9:23 am
by upsideofdown
After having made the necessary modifications for nagios to access the bash shell, I'm now able to execute the command
Code: Select all
su -l nagios -c '/usr/lib64/nagios/plugins/check_disk -w 10% -c 5% -p /opt/mount-a/mount-a1'
DISK OK - free space: / 3036 MB (39% inode=86%);| /=4557MB;7200;7600;0;8000
As I'm still very new to Nagios, I'm not sure how this will effect the inability to execute the command on remote systems (as I understand Nagios does during the polling). Should I make the BASH shell accessible to the nagios UID across my entire environment?
Re: Nested FS Monitoring troubles
Posted: Wed Dec 04, 2013 12:01 pm
by sreinhardt
Well, let's give it a test run before mass changing things, but in general yes the nagios user would have access /bin/bash or /bin/sh set to the default shell.