diff --git a/misc/check_selinux.sh b/check_selinux/check_selinux similarity index 90% rename from misc/check_selinux.sh rename to check_selinux/check_selinux index 5279248..196ec78 100644 --- a/misc/check_selinux.sh +++ b/check_selinux/check_selinux @@ -17,7 +17,7 @@ # About this script # -# Checks uptime of a specified host, using NRPE is host is remote +# Checks selinux status of a specified host, using NRPE if the host is remote HOSTN="localhost" # By default check localhost CHECK_COMMAND="getenforce" # Default command to check selinux status @@ -62,14 +62,14 @@ done -# We we are not checking localhost, lets get remote uptime via NRPE +# We we are not checking localhost, lets get remote selinux status via NRPE if [ "$HOSTN" != "localhost" ]; then export PATH=$PATH:/usr/lib/nagios/plugins:/usr/lib64/nagios/plugins:/nagios/usr/lib/nagios/plugins CHECK_COMMAND="check_nrpe -H $HOSTN -c get_selinux" fi -# Get the uptime, raise error if we are unsuccessful +# Get the selinux status, raise error if we are unsuccessful OUTPUT=`$CHECK_COMMAND` RESULT=$? diff --git a/check_selinux/nagios-plugins-check_selinux.spec b/check_selinux/nagios-plugins-check_selinux.spec new file mode 100644 index 0000000..f1db421 --- /dev/null +++ b/check_selinux/nagios-plugins-check_selinux.spec @@ -0,0 +1,39 @@ +%define debug_package %{nil} + +Summary: A Nagios plugin to check SELinux status on Linux servers +Name: nagios-plugins-check_selinux +Version: 1.0 +Release: 1%{?dist} +License: GPLv3+ +Group: Applications/System +URL: https://github.com/opinkerfi/nagios-plugins/tree/master/check_selinux +Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_selinux/releases/nagios-plugins-check_selinux-%{version}.tar.gz +Requires: nagios-plugins-nrpe libselinux-utils +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Packager: Tomas Edwardsson +BuildArch: noarch + +%description +This plugin check the enforcing selinux status of a specified host, using NRPE +if the host is remote. + +%prep +%setup -q + +%build + +%install +rm -rf %{buildroot} +install -D -p -m 0755 check_selinux %{buildroot}%{_libdir}/nagios/plugins/check_selinux + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{_libdir}/nagios/plugins/* + + +%changelog +* Wed May 22 2013 Tomas Edwardsson 1.0-1 +- Initial packaging