Nested FS Monitoring troubles

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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nested FS Monitoring troubles

Post 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?

Code: Select all

grep nagios /etc/passwd
Be sure to check out our Knowledgebase for helpful articles and solutions!
upsideofdown
Posts: 7
Joined: Mon Nov 25, 2013 4:56 pm

Re: Nested FS Monitoring troubles

Post 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?

Code: Select all

grep nagios /etc/passwd
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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nested FS Monitoring troubles

Post by abrist »

upsideofdown wrote:nagios:x:498:499::/var/spool/nagios:/sbin/nologin
Change /sbin/nologin to /bin/bash and try the check again.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
upsideofdown
Posts: 7
Joined: Mon Nov 25, 2013 4:56 pm

Re: Nested FS Monitoring troubles

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nested FS Monitoring troubles

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked