Page 1 of 1

Regarding enforcing selinux on nagios

Posted: Mon Oct 17, 2016 1:21 am
by sami21
Hello,
I have a system Centos Release 6.8, installed NRPE on it. and monitoring through nagios server.
to monitor one of the service status on my client machine, I have used check_service.sh plugin which you can find on this link.
https://github.com/jonschipp/nagios-plu ... service.sh

but its giving error on nagios dashboard. attached it the snapshot.

I have added sudo permissions to the user and with selinux disabled or permissive it works fine on other environments.
I just don't understand what selinux context this plugin should have.
currently it has
-rwxr-xr-x root root unconfined_u:object_r:lib_t:s0 check_service.sh

Thanks for your help in advance.

Re: Regarding enforcing selinux on nagios

Posted: Mon Oct 17, 2016 10:08 am
by avandemore
Are you saying selinux isn't in permissive mode on your client system?

What is the output of rpm -qa |grep selinux-policy-targeted?

Re: Regarding enforcing selinux on nagios

Posted: Tue Oct 18, 2016 12:30 am
by sami21
Thanks for your reply.
Currently it is in permissive mode.To resolve this issue I have to keep it in permissive mode.
But what if I want to keep it in Enforcing mode?
what selinux context this plugin should have?
I have tried contexts which are on plugins provided bydefault by nagios, but it doesn't work.

Re: Regarding enforcing selinux on nagios

Posted: Tue Oct 18, 2016 9:53 am
by dwhitfield
SELinux enforcing is not supported, but some people have gotten it to work: https://fportase.wordpress.com/selinux- ... x-enabled/

That blog posted didn't test for 6.8, but they did for an earlier 6.x, so I would assume it works.