1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2026-02-13 02:20:57 +01:00

Compare commits

..

19 Commits

Author SHA1 Message Date
Tomas Edwardsson
98d7723d9f Automatic commit of package [nagios-okplugin-check_yum] release [0.8.1-1]. 2013-05-27 16:32:45 +00:00
Tomas Edwardsson
e7a474c07a Added missing nrpe config 2013-05-27 16:19:58 +00:00
Tomas Edwardsson
5a49b22a10 Automatic commit of package [nagios-okplugin-check_nagios] release [1.2-1]. 2013-05-22 23:56:39 +00:00
Tomas Edwardsson
9840c23642 Modified to parse on epoch rather that syslog date
Issue #1
2013-05-22 22:41:03 +00:00
Tomas Edwardsson
3828a94a3e Emit unknown if unable to open the logfile and detect location
Issue #1
2013-05-22 21:23:50 +00:00
Tomas Edwardsson
e35455fdc8 Automatic commit of package [nagios-plugins-check_selinux] release [1.1-1]. 2013-05-22 20:49:40 +00:00
Tomas Edwardsson
c0ef6774ad Closes #2 - Initial packaging and fix typos 2013-05-22 20:48:27 +00:00
Your Name
190a9726b1 updated tito releasers.conf 2013-05-19 18:01:22 +00:00
Your Name
1dadb17858 sudoers.d added to install 2013-05-19 17:57:18 +00:00
Your Name
fe453cdd23 dummy commit 2013-05-19 17:52:19 +00:00
Your Name
aa7af97598 fix path in tito package files 2013-05-19 17:51:50 +00:00
Your Name
18fc77d63f dummy commit 2013-05-19 17:49:20 +00:00
Your Name
ca8a2ebb73 tito package files re-added 2013-05-19 17:48:04 +00:00
Your Name
b5308e5a7c Initialized to use tito. 2013-05-19 17:46:20 +00:00
Pall Sigurdsson
a570b1c40e Add sudoers support to check_hpacucli
Affects okconfig issue 3
2013-05-19 17:43:43 +00:00
Pall Sigurdsson
71673753ff Merge branch 'master' of github.com:opinkerfi/nagios-plugins 2013-04-29 16:21:05 +00:00
palli
950a169dbd Initial commit 2013-04-29 09:19:23 -07:00
Tomas Edwardsson
771ec5cf77 Missing colon 2013-04-26 10:52:23 +00:00
Tomas Edwardsson
ff21dd3ec4 Added missing OK when things worked out 2013-04-26 10:36:23 +00:00
39 changed files with 245 additions and 11 deletions

4
README.md Normal file
View File

@@ -0,0 +1,4 @@
nagios-plugins
==============
Small army of nagios-plugins either made or maintained by opinkerfi

View File

@@ -19,6 +19,7 @@ Checks HP Array with hpacucli
%prep
%setup -q
perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/check_hpacucli.cfg
perl -pi -e "s|/usr/lib64|%{_libdir}|g" sudoers.d/*
%build
@@ -27,6 +28,7 @@ perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/check_hpacucli.cfg
rm -rf %{buildroot}
install -D -p -m 0755 check_hpacucli.py %{buildroot}%{_libdir}/nagios/plugins/check_hpacucli.py
install -D -p -m 0755 nrpe.d/check_hpacucli.cfg %{buildroot}/etc/nrpe.d/check_hpacucli.cfg
install -D -p -m 0755 sudoers.d/check_hpacucli %{buildroot}/etc/sudoers.d/check_hpacucli
%clean
rm -rf %{buildroot}
@@ -36,6 +38,7 @@ rm -rf %{buildroot}
%doc README LICENSE
%{_libdir}/nagios/plugins/*
/etc/nrpe.d/check_hpacucli.cfg
/etc/sudoers.d/check_hpacucli
%changelog
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.2-2

View File

@@ -0,0 +1 @@
nrpe ALL=(ALL) NOPASSWD: /usr/lib64/nagios/plugins/check_hpacucli.py

View File

@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import ldap
from pynag.Plugins import PluginHelper,critical, warning
from pynag.Plugins import PluginHelper, critical, warning, ok
plugin = PluginHelper()
@@ -48,6 +48,8 @@ for rhost in replication:
plugin.add_summary("Replica %s Status: %s" % (rhost[1]['nsDS5ReplicaHost'][0], rhost[1]['nsds5replicaLastUpdateStatus'][0]))
if rhost[1]['nsds5replicaLastUpdateStatus'][0][:2] != "0 ":
plugin.status(critical)
else:
plugin.status(ok)
if not len(replication):
plugin.add_summary("Warning: No replicas found")

View File

@@ -1,10 +1,32 @@
#!/bin/sh
TMP=`mktemp`
LAST_HOUR=`date "+%b %e %H:" -d "1 hour ago"`
CURRENT_HOUR=`date "+%b %e %H:"`
EPOCH_HOUR_AGO=$(( $(date +%s) - 3600 ))
tail -n 2000 /var/log/messages | \
grep -E "$CURRENT_HOUR|$LAST_HOUR" | \
exit_unknown() {
msg="$1"
echo "${msg}"
exit 3
}
find_nagios_log() {
# Try to locate the nagios log, fallback to messages log
for log in /var/log/nagios/nagios.log /var/log/nagios3/nagios.log /var/spool/nagios/nagios.log \
/usr/local/nagios/var/nagios.log
do
if [ -e "${log}" ]; then
echo ${log}
return 0
fi
done
return 3
}
LOG=$(find_nagios_log) || exit_unknown "Unable to locate logfile for parsing"
tail -n 1 ${LOG} &> ${TMP} || exit_unknown "Unable to parse logfile: $(cat ${TMP})"
tail -n 2000 ${LOG} | \
awk "BEGIN { FS=\"[\\\\[\\\\]]\" } \$2 > ${EPOCH_HOUR_AGO} {print \$0}" | \
grep "Passive check result was received" | \
grep -i "could not be found" | \
sed 's/.*Passive check result was received for service //' | \

View File

@@ -2,7 +2,7 @@
Summary: A set of Nagios plugins to check the health of a nagios host
Name: nagios-okplugin-check_nagios
Version: 1.1
Version: 1.2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -40,6 +40,12 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_nagios.cfg
%changelog
* Wed May 22 2013 Tomas Edwardsson <tommi@tommi.org> 1.2-1
- Modified to parse on epoch rather that syslog date (tommi@tommi.org)
- Emit unknown if unable to open the logfile and detect location
(tommi@tommi.org)
- Fix tmp file cleanup (palli@opensource.is)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.1-1
- Version number bumped
- bugfix, check_nagios_needs_reload check for reload instead of reparse

View File

@@ -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=$?

View File

@@ -0,0 +1,42 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check SELinux status on Linux servers
Name: nagios-plugins-check_selinux
Version: 1.1
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 <tommi@ok.is>
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 <tommi@tommi.org> 1.1-1
- new package built with tito
* Wed May 22 2013 Tomas Edwardsson <tommi@opensource.is> 1.0-1
- Initial packaging

View File

@@ -2,8 +2,8 @@
Summary: A Nagios plugin to check yum updates via NRPE
Name: nagios-okplugin-check_yum
Version: 0.8.0
Release: 2%{?dist}
Version: 0.8.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_yum
@@ -29,6 +29,7 @@ perl -pi -e "s|/usr/lib|%{_libdir}|g" sudoers.d/check_yum
rm -rf %{buildroot}
install -D -p -m 0755 check_yum %{buildroot}%{_libdir}/nagios/plugins/check_yum
install -D -p -m 0440 sudoers.d/check_yum %{buildroot}/etc/sudoers.d/check_yum
install -D -p -m 0644 nrpe.d/check_yum.cfg %{buildroot}/etc/nrpe.d/check_yum.cfg
%clean
@@ -40,7 +41,17 @@ rm -rf %{buildroot}
#%{_libdir}/nagios/plugins/*
%{_libdir}/nagios/plugins/check_yum
/etc/sudoers.d/check_yum
/etc/nrpe.d/check_yum.cfg
%changelog
* Mon May 27 2013 Tomas Edwardsson <tommi@tommi.org> 0.8.1-1
- Added missing nrpe config (tommi@tommi.org)
- Initial rpm packaging (tommi@tommi.org)
- fix for changed output in list-security query (pall.valmundsson@gmail.com)
- Merge branch 'master' of github.com:opinkerfi/misc (palli@opensource.is)
- Added perfdata and longoutput with ERRATA IDs (tommi@tommi.org)
- Added perfdata and longoutput with ERRATA IDs (tommi@tommi.org)
- Updated to new upstream release (tommi@tommi.org)
* Tue Apr 16 2013 Tomas Edwardsson <tommi@opensource.is> 0.8.0-2
- Initial packaging

3
rel-eng/packages/.readme Normal file
View File

@@ -0,0 +1,3 @@
the rel-eng/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

View File

@@ -0,0 +1 @@
2.1.0-1 check_apcext.pl/

View File

@@ -0,0 +1 @@
0.0.3-1 check_bond/

View File

@@ -0,0 +1 @@
0.0.4-1 check_brocade/

View File

@@ -0,0 +1 @@
1.0.1-1 check_dataprotector/

View File

@@ -0,0 +1 @@
1.0.3-1 check_disks.pl/

View File

@@ -0,0 +1 @@
0.0.4-1 check_drbd/

View File

@@ -0,0 +1 @@
1.0.2-1 check_eva/

View File

@@ -0,0 +1 @@
1.2-2 check_hpacucli/

View File

@@ -0,0 +1 @@
1.1.2-3 check_ibm_bladecenter/

View File

@@ -0,0 +1 @@
1.1.4-1 check_ironport/

View File

@@ -0,0 +1 @@
0.0.13-1 check_linux_modules.pl/

View File

@@ -0,0 +1 @@
0.0.3-1 check_multipath/

View File

@@ -0,0 +1 @@
1.2-1 check_nagios/

View File

@@ -0,0 +1 @@
0.0.4-1 check_rhcs/

View File

@@ -0,0 +1 @@
0.0.11-1 check_smssend/

View File

@@ -0,0 +1 @@
1.0.1-1 check_snmp/

View File

@@ -0,0 +1 @@
1.0.1-1 check_time/

View File

@@ -0,0 +1 @@
1.0.1-1 check_uptime/

View File

@@ -0,0 +1 @@
1.0.1-1 check_vmware/

View File

@@ -0,0 +1 @@
0.8.1-1 check_yum/

View File

@@ -0,0 +1 @@
1.0-1 check_cifs/

View File

@@ -0,0 +1 @@
0.0.2-1 crit2warn.sh/

View File

@@ -0,0 +1 @@
0.0.3-1 check_ipa/

View File

@@ -0,0 +1 @@
1.0-1 check_bl/

View File

@@ -0,0 +1 @@
0.0.7-1 check_mssql_health/

View File

@@ -0,0 +1 @@
1.0-1 check_cpu.sh/

View File

@@ -0,0 +1 @@
1.1-1 check_selinux/

108
rel-eng/releasers.conf Normal file
View File

@@ -0,0 +1,108 @@
# Fedora FC18
[test-fc18-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-18-x86_64
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/fedora18/x86_64/
[production-fc18-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-18-x86_64
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/fedora18/x86_64/
# Fedora FC17
[test-fc17-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-17-x86_64
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/fedora17/x86_64/
[production-fc17-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-17-x86_64
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/fedora17/x86_64/
# RHEL 6
[production-el6-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-x86_64
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/rhel6/x86_64/
[production-el6-i386]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-i386
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/rhel6/i386/
# RHEL 5 Production
[production-el5-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-5-x86_64
createrepo_command = createrepo -s sha1 .
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/rhel5/x86_64/
[production-el5-i386]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-5-i386
createrepo_command = createrepo -s sha1 .
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/rhel5/i386/
# RHEL 5 Testing
[test-el5-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-5-x86_64
builder.test = 1
createrepo_command = createrepo -s sha1 .
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/rhel5/x86_64/
[test-el5-i386]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-5-i386
builder.test = 1
createrepo_command = createrepo -s sha1 .
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/rhel5/i386/
# RHEL 6 Test
[test-el6-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-x86_64
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/rhel6/x86_64/
[test-el6-i386]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-i386
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/rhel6/i386/
# sources
[production-tarballs]
releaser = tito.release.RsyncReleaser
builder = tito.builder.Builder
filetypes = tgz
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/sources/

5
rel-eng/tito.props Normal file
View File

@@ -0,0 +1,5 @@
[globalconfig]
default_builder = tito.builder.Builder
default_tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)