mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2026-02-13 02:20:57 +01:00
Compare commits
20 Commits
nagios-okp
...
nagios-okp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee29f68bcc | ||
|
|
077e862e6f | ||
|
|
b96bb5e207 | ||
|
|
51c659990b | ||
|
|
343c42339f | ||
|
|
8f89f773e3 | ||
|
|
24518a74e7 | ||
|
|
cdc1daad6d | ||
|
|
c40bee725a | ||
|
|
892f9c267e | ||
|
|
3501677f20 | ||
|
|
6726f614ad | ||
|
|
ee5adc2363 | ||
|
|
7dc3b57582 | ||
|
|
688e8b8412 | ||
|
|
1ccc433779 | ||
|
|
ee05a4f24a | ||
|
|
871c8348fa | ||
|
|
944d47e18e | ||
|
|
40ba14c4cb |
@@ -3,7 +3,7 @@
|
||||
Summary: A Nagios plugin to check SMTP blacklists
|
||||
Name: nagios-okplugin-mailblacklist
|
||||
Version: 1.1
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-MailBlacklist
|
||||
@@ -11,7 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_bl/releases/%
|
||||
Requires: nagios-plugins
|
||||
Requires: nagios-plugins-perl
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Packager: Tomas Edwardsson <tommi@ok.is>
|
||||
Packager: Gardar Thorsteinsson <gardar@ok.is>
|
||||
BuildArch: noarch
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ Checks DNS Blacklists for existance of hosts
|
||||
%setup -q
|
||||
perl -pi -e "s|/usr/lib|%{_libdir}|g" check_bl
|
||||
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude}|}^perl\\(utils\\)
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -38,6 +40,9 @@ rm -rf %{buildroot}
|
||||
%{_libdir}/nagios/plugins/*
|
||||
|
||||
%changelog
|
||||
* Fri May 04 2018 Richard Allen <ra@ok.is> 1.1-2
|
||||
- Filter out perl-utils dependancy
|
||||
|
||||
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1.1-1
|
||||
-
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
Summary: A Nagios plugin to check Brocade devices
|
||||
Name: nagios-okplugin-brocade
|
||||
Version: 0.0.5
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-Brocade
|
||||
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_brocade/releases/nagios-okplugin-brocade-%{version}.tar.gz
|
||||
Requires: perl-Nagios-Plugin
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Packager: Tomas Edwardsson <tommi@ok.is>
|
||||
Packager: Gardar Thorsteinsson <gardar@ok.is>
|
||||
|
||||
|
||||
%description
|
||||
@@ -20,6 +20,8 @@ Checks Brocade devices
|
||||
%setup -q
|
||||
perl -pi -e "s|/usr/lib|%{_libdir}|g" check_brocade_env
|
||||
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude}|}^perl\\(utils\\)
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -36,6 +38,9 @@ rm -rf %{buildroot}
|
||||
%{_libdir}/nagios/plugins/*
|
||||
|
||||
%changelog
|
||||
* Fri May 09 2018 Gardar Thorsteinsson <gardar@ok.is> 0.0.5-2
|
||||
- filter out perl-utils dep
|
||||
|
||||
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 0.0.5-1
|
||||
-
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Summary: A Nagios plugin to check CIFS shares
|
||||
Name: nagios-okplugin-cifs
|
||||
Version: 1.1
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-Brocade
|
||||
@@ -11,7 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_cifs/releases
|
||||
Requires: perl-Nagios-Plugin
|
||||
Requires: samba-client, krb5-workstation
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Packager: Tomas Edwardsson <tommi@ok.is>
|
||||
Packager: Gardar Thorsteinsson <gardar@ok.is>
|
||||
BuildArch: noarch
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ NTML authentication
|
||||
%setup -q
|
||||
perl -pi -e "s|/usr/lib|%{_libdir}|g" check_cifs
|
||||
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude}|}^perl\\(utils\\)
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -39,6 +41,9 @@ rm -rf %{buildroot}
|
||||
%{_libdir}/nagios/plugins/*
|
||||
|
||||
%changelog
|
||||
* Fri May 09 2018 Gardar Thorsteinsson <gardar@ok.is> 1.1-2
|
||||
- Filter out perl-utils dep
|
||||
|
||||
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1.1-1
|
||||
- Merge github.com:opinkerfi/misc (palli@opensource.is)
|
||||
|
||||
|
||||
23
check_firewall_active/check_firewall_active.sh
Executable file
23
check_firewall_active/check_firewall_active.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXIT_OK=0
|
||||
EXIT_WARN=1
|
||||
EXIT_CRIT=2
|
||||
|
||||
PATH=/sbin:/usr/sbin:$PATH
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must be run as root" 1>&2
|
||||
exit $EXIT_CRIT
|
||||
fi
|
||||
|
||||
blocks=$(iptables -L -v -n | egrep 'REJECT|DROP' | wc -l)
|
||||
|
||||
if [ $blocks -eq 0 ]; then
|
||||
echo "CRITICAL: No firewall detected"
|
||||
exit $EXIT_CRIT
|
||||
fi
|
||||
|
||||
echo "OK: Firewall is active"
|
||||
exit $EXIT_OK
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: A Nagios plugin to check if iptables are actually enforcing rules
|
||||
Name: nagios-okplugin-check_firewall_active
|
||||
Version: 1.0.2
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: https://github.com/opinkerfi/nagios-plugins/issues
|
||||
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_firewall_active/releases/nagios-okplugin-check_firewall_active-%{version}.tar.gz
|
||||
Requires: nagios-nrpe
|
||||
Requires: iptables
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Packager: Richard Allen <ra@ok.is>
|
||||
|
||||
|
||||
|
||||
%description
|
||||
A Nagios plugin to check if iptables are actually enforcing rules
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
#perl -pi -e "s|/usr/lib64|%{_libdir}|g" nrpe.d/check_firewall_active.cfg
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
install -D -p -m 0755 check_firewall_active.sh %{buildroot}%{_libdir}/nagios/plugins/check_firewall_active.sh
|
||||
install -D -p -m 0755 nrpe.d/check_firewall_active.cfg %{buildroot}/etc/nrpe.d/check_firewall_active.cfg
|
||||
install -D -p -m 0644 sudoers.d/check_firewall_active %{buildroot}/etc/sudoers.d/check_firewall_active
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
#%doc README LICENSE
|
||||
%{_libdir}/nagios/plugins/*
|
||||
/etc/nrpe.d/check_firewall_active.cfg
|
||||
/etc/sudoers.d/check_firewall_active
|
||||
|
||||
%post
|
||||
restorecon -v %{_libdir}/nagios/plugins/check_firewall_active.sh /etc/nrpe.d/check_firewall_active.cfg /etc/sudoers.d/check_firewall_active
|
||||
|
||||
%changelog
|
||||
* Thu Dec 21 2016 Gardar Thorsteinsson <gardart@gmail.com> 1.0.1-1
|
||||
* Thu Dec 21 2016 Gardar Thorsteinsson <gardart@gmail.com> 1.0.0-3
|
||||
* Thu Dec 20 2016 Richard Allen <ra@ok.is> 0.1-1
|
||||
- Initial packaging
|
||||
3
check_firewall_active/nrpe.d/check_firewall_active.cfg
Normal file
3
check_firewall_active/nrpe.d/check_firewall_active.cfg
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
command[check_firewall_active]=sudo /usr/lib64/nagios/plugins/check_firewall_active.sh
|
||||
2
check_firewall_active/sudoers.d/check_firewall_active
Normal file
2
check_firewall_active/sudoers.d/check_firewall_active
Normal file
@@ -0,0 +1,2 @@
|
||||
Defaults:nrpe !requiretty
|
||||
nrpe ALL = (root) NOPASSWD: /usr/lib64/nagios/plugins/check_firewall_active.sh
|
||||
@@ -274,6 +274,9 @@ def check_logicaldisks():
|
||||
ld_status = check(i, 'Status')
|
||||
status = max(status, ld_status)
|
||||
|
||||
if i.get('Status') == 'Failed':
|
||||
status = max(status, critical)
|
||||
|
||||
mount_point = i['Mount Points']
|
||||
add_long("- %s (%s) = %s" % (i['name'], mount_point, state[ld_status]))
|
||||
add_summary(". ")
|
||||
|
||||
@@ -81,7 +81,7 @@ check_raid()
|
||||
{
|
||||
raid_ok=`cat $TEMPFILE |grep -i ok|wc -l`
|
||||
raid_warning=`cat $TEMPFILE|grep -i -E 'rebuild|predictive' |wc -l`
|
||||
raid_critical_1=`cat $TEMPFILE|grep -i 'failed|recovery' | wc -l`
|
||||
raid_critical_1=`cat $TEMPFILE|grep -i -E 'failed|recovery' | wc -l`
|
||||
|
||||
err_check=`expr $raid_ok + $raid_warning + $raid_critical_1 `
|
||||
|
||||
@@ -133,7 +133,7 @@ case "$1" in
|
||||
exit 0
|
||||
;;
|
||||
--all)
|
||||
controllers=`sudo -u root hpacucli controller all show | sed 's/.*Slot \([0-9]*\).*/\1/'`
|
||||
controllers=`sudo -u root $HPACUCLI controller all show | sed 's/.*Slot \([0-9]*\).*/\1/'`
|
||||
for i in $controllers ; do sudo -u root $HPACUCLI controller slot=$i pd all show status;done > $TEMPFILE
|
||||
check_raid
|
||||
;;
|
||||
|
||||
@@ -46,10 +46,13 @@ except Exception, e:
|
||||
# Loop through replication agreements
|
||||
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:
|
||||
if rhost[1]['nsds5replicaLastUpdateStatus'][0][:2] == "0 ":
|
||||
plugin.status(ok)
|
||||
elif rhost[1]['nsds5replicaLastUpdateStatus'][0][:2] == "1 ":
|
||||
# Busy Replica is not an error, its "unknown" (but its "ok" for now)
|
||||
plugin.status(ok)
|
||||
else:
|
||||
plugin.status(critical)
|
||||
|
||||
if not len(replication):
|
||||
plugin.add_summary("Warning: No replicas found")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
%define debug_package %{nil}
|
||||
%define plugin check_msa_hardware
|
||||
%define packager Pall Sigurdsson <palli@opensource.is>
|
||||
%define packager Gardar Thorsteinsson <gardar@ok.is>
|
||||
|
||||
Summary: A Nagios plugin to check status of an MSA (HP P2000) disk array
|
||||
Name: nagios-okplugin-%{plugin}
|
||||
Version: 1.0.5
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv3+
|
||||
Group: Applications/System
|
||||
URL: https://github.com/opinkerfi/nagios-plugins/tree/master/%{plugin}
|
||||
@@ -21,6 +21,8 @@ Checks status of a remote MSA disk array, also known as HP P2000
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude}|}^perl\\(utils\\)
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -46,6 +48,9 @@ rm -rf %{buildroot}
|
||||
%config(noreplace) %{_sysconfdir}/nrpe.d/%{plugin}.cfg
|
||||
|
||||
%changelog
|
||||
* Fri May 09 2018 Gardar Thorsteinsson <gardar@ok.is> 1.0.5-2
|
||||
- Filter out perl-utils dep
|
||||
|
||||
* Thu Jan 30 2014 Pall Sigurdsson <palli@opensource.is> 1.0.5-1
|
||||
-
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ print_help() {
|
||||
|
||||
echo "Add this to your sudoers file by running visudo to add access:"
|
||||
if [ -r /proc/modules ]; then
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -l"
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -ll"
|
||||
else
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -l, $SUDO"
|
||||
echo "Cmnd_Alias MULTIPATH=$MULTIPATH -ll, $SUDO"
|
||||
fi
|
||||
echo "nagios ALL= NOPASSWD: MULTIPATH"
|
||||
echo "The user nagios may very well be nobody or someone else depending on your configuration"
|
||||
@@ -98,7 +98,7 @@ if [ $(id -un) != "root" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
OUTPUT=$($MULTIPATH -l 2>/dev/null)
|
||||
OUTPUT=$($MULTIPATH -ll 2>/dev/null)
|
||||
if [ $? != 0 ]; then
|
||||
# Failed. grab more info why
|
||||
if [ $(id -un) != "root" ] && [ `$SUDO -l | grep -c multipath` -eq 0 ]; then
|
||||
@@ -112,7 +112,7 @@ if [ $? != 0 ]; then
|
||||
exit $STATE_UNKNOWN
|
||||
fi
|
||||
|
||||
echo "MULTIPATH: $(MULTIPATH -l 2>&1)"
|
||||
echo "MULTIPATH: $($MULTIPATH -ll 2>&1)"
|
||||
exit $STATE_UNKNOWN
|
||||
fi
|
||||
|
||||
@@ -137,6 +137,7 @@ if [ "$NUMPATHS" ]; then
|
||||
/^ \\/ {targets++; next} # count targets (lenny)
|
||||
/[0-9]+:[0-9]+:[0-9]+:[0-9]+/ {
|
||||
if (/active undef running/) { targets++ } # count targets (squeeze)
|
||||
if (/active ready running/) { targets++ } # count targets (RHEL6)
|
||||
next
|
||||
}
|
||||
{
|
||||
|
||||
@@ -74,17 +74,17 @@ OUTPUT=`$CHECK_COMMAND`
|
||||
RESULT=$?
|
||||
|
||||
if [ $RESULT -gt 0 ]; then
|
||||
echo "Error - Could not run command $CHECK_COMMAND"
|
||||
echo "UNKNOWN - Could not run command $CHECK_COMMAND"
|
||||
echo "Error was: $OUTPUT"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Parse the output from the command
|
||||
if [ "$OUTPUT" == "$STATUS" ]; then
|
||||
echo "ok, selinux status is $OUTPUT"
|
||||
echo "OK - SELinux status is $OUTPUT"
|
||||
exit 0
|
||||
else
|
||||
echo "warning, selinux status is $OUTPUT (supposed to be $STATUS)"
|
||||
echo "WARNING - SELinux status is $OUTPUT (supposed to be $STATUS)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
Summary: Various nagios plugins to check cpu,memory,interfaces via SNMP
|
||||
Name: nagios-okplugin-check_snmp
|
||||
Version: 2
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: http://opensource.is/trac/wiki/check_snmp
|
||||
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_snmp/releases/nagios-okplugin-check_snmp-%{version}.tar.gz
|
||||
Requires: perl-Net-SNMP
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Packager: Pall Sigurdsson <palli@opensource.is>
|
||||
Packager: Gardar Thorsteinsson <gardar@ok.is>
|
||||
|
||||
|
||||
%description
|
||||
@@ -20,6 +20,8 @@ Various nagios plugins to check cpu,memory,interfaces via SNMP
|
||||
%setup -q
|
||||
#perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/check_hpacucli.cfg
|
||||
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude}|}^perl\\(utils\\)
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -45,6 +47,9 @@ rm -rf %{buildroot}
|
||||
%{_libdir}/nagios/plugins/*
|
||||
|
||||
%changelog
|
||||
* Fri May 09 2018 Gardar Thorsteinsson <gardar@ok.is> 2-2
|
||||
- Filter out perl-utils dep
|
||||
|
||||
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
|
||||
- make sure nagios does not run us in embedded perl (palli@opensource.is)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user