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

Compare commits

..

44 Commits

Author SHA1 Message Date
Tomas Edwardsson
b481aadbd5 Automatic commit of package [nagios-okplugin-check_uptime] release [1.0.3-1]. 2014-04-13 18:26:25 +00:00
Tomas Edwardsson
2049fbd692 Automatic commit of package [nagios-okplugin-ipa] release [0.0.4-1]. 2014-04-04 15:19:32 +00:00
Tomas Edwardsson
5f604b852f Automatic commit of package [nagios-okplugin-check_time] release [1.0.3-1]. 2014-04-04 13:10:38 +00:00
Tomas Edwardsson
e5772ab336 check_time - Added requirement for bc 2014-04-04 13:07:33 +00:00
Tomas Edwardsson
e5498e1554 okc-get_network_stat, Bad nrpe command name 2014-04-02 15:57:58 +00:00
Tomas Edwardsson
7d9ba339bc Automatic commit of package [nagios-okplugin-get_network_stat] release [1.0.1-1]. 2014-04-02 15:34:19 +00:00
Tomas Edwardsson
37d504a039 Added okc-get_network_stat 2014-04-02 15:34:07 +00:00
Tomas Edwardsson
e7af0e4098 Automatic commit of package [nagios-okplugin-check_disks] release [1.0.6-1]. 2014-03-25 17:57:03 +00:00
Tomas Edwardsson
6c126130cc Automatic commit of package [nagios-okplugin-check_disks] release [1.0.5-1]. 2014-03-25 14:23:28 +00:00
Tomas Edwardsson
f0968997e4 Automatic commit of package [nagios-okplugin-check_time] release [1.0.2-1]. 2014-03-25 12:08:35 +00:00
Tomas Edwardsson
95693e3c73 Automatic commit of package [nagios-okplugin-apc] release [2.1.1-1]. 2014-03-20 08:10:31 +00:00
Tomas Edwardsson
55daf8f4c9 Rework hostname detection to use local
Removed socket.gethostname to discover own hostname instead using the
local flag which is output from /usr/sbin/clustat -fx node definitions.
The gethostname does not always match the cluster node name which would
make the check fail.
2014-03-07 11:25:24 +00:00
Tomas Edwardsson
d11d29185a Remove debug print 2014-03-07 11:23:28 +00:00
Pall Sigurdsson
06194c84cc Automatic commit of package [nagios-okplugin-check_ibm_bladecenter] release [4-1]. 2014-02-21 11:10:55 +00:00
Pall Sigurdsson
184d7d3b4a Merge branch 'master' of github.com:opinkerfi/nagios-plugins 2014-02-21 11:07:39 +00:00
Pall Sigurdsson
1574cd13d3 ibm_bladecenter - another firmware bug workaround 2014-02-21 11:06:00 +00:00
Pall Sigurdsson
b0b55dcd3e pep8 fixes 2014-02-21 10:52:39 +00:00
Pall Sigurdsson
b96e973e60 Fix workaround for firmware bug
Blade chassis will sometimes report critical error that
there are no critical or warning events.

Fix plugin so it properly works around the issue.
2014-02-21 10:50:32 +00:00
Pall Sigurdsson
51b75943cf Automatic commit of package [nagios-okplugin-cifs] release [1.1-1]. 2014-02-20 18:11:40 +00:00
Pall Sigurdsson
8ff1cf84d0 Automatic commit of package [nagios-okplugin-check_yum] release [1-1]. 2014-02-20 18:09:38 +00:00
Pall Sigurdsson
5cb19c072e Automatic commit of package [nagios-plugins-check_cpu] release [2-1]. 2014-02-20 18:08:20 +00:00
Pall Sigurdsson
6db73d28d6 Automatic commit of package [nagios-okplugin-check_ironport] release [2-1]. 2014-02-20 18:07:50 +00:00
Pall Sigurdsson
5ba61f91b2 Automatic commit of package [nagios-okplugin-check_eva] release [2-1]. 2014-02-20 18:07:02 +00:00
Pall Sigurdsson
8f6faa8b59 Automatic commit of package [nagios-okplugin-check_snmp] release [2-1]. 2014-02-20 18:06:46 +00:00
Pall Sigurdsson
574538883c Automatic commit of package [nagios-okplugin-check_rhcs] release [1-1]. 2014-02-20 18:06:12 +00:00
Pall Sigurdsson
245ad9ba21 Automatic commit of package [nagios-okplugin-check_ibm_bladecenter] release [2-1]. 2014-02-20 18:05:51 +00:00
Pall Sigurdsson
854b08c601 Automatic commit of package [nagios-okplugin-check_hpacucli] release [2-1]. 2014-02-20 18:05:17 +00:00
Pall Sigurdsson
55ea04bd73 Automatic commit of package [nagios-okplugin-check_dataprotector] release [2-1]. 2014-02-20 18:04:49 +00:00
Pall Sigurdsson
09dcc39f94 Automatic commit of package [nagios-okplugin-brocade] release [0.0.5-1]. 2014-02-20 18:03:50 +00:00
Pall Sigurdsson
48d0a92707 Automatic commit of package [nagios-okplugin-bond] release [0.0.4-1]. 2014-02-20 18:03:15 +00:00
Pall Sigurdsson
e9222eb215 Automatic commit of package [nagios-okplugin-mailblacklist] release [1.1-1]. 2014-02-20 18:01:51 +00:00
Pall Sigurdsson
e64d51ebc3 remove check_cpu and okplugin-common 2014-02-20 17:58:10 +00:00
Pall Sigurdsson
5d94c9d3a2 Automatic commit of package [nagios-plugins-check_selinux] release [1.3-1]. 2014-02-20 17:56:25 +00:00
Pall Sigurdsson
22e4293db7 Merge branch 'master' of github.com:opinkerfi/nagios-plugins 2014-02-18 15:57:42 +00:00
Pall Sigurdsson
9b89a3d998 update rel-eng for fedora20 repos 2014-02-18 15:57:09 +00:00
Pall Sigurdsson
553a182dd1 Merge pull request #10 from gitmopp/patch-2
bug in for loop. Looped only once
2014-02-04 05:14:39 -08:00
Pall Sigurdsson
9501bef37b Merge pull request #9 from gitmopp/patch-1
Fixed output to be more compatible
2014-02-04 05:14:24 -08:00
gitmopp
b672f6f508 bug in for loop. Looped only once 2014-01-31 15:06:04 +01:00
gitmopp
04d25281e3 Fixed output to be more compatible
My SSSU 10.1.0 reports "SSSU for HP P6000 Command View" instead of "SSSU for HP StorageWorks Command View EVA". I fixed the output to just check for SSSU for HP
2014-01-30 17:36:33 +01:00
Pall Sigurdsson
9b2474fb49 Automatic commit of package [nagios-okplugin-check_msa_hardware] release [1.0.5-1]. 2014-01-30 16:07:10 +00:00
Pall Sigurdsson
156459046c Automatic commit of package [nagios-okplugin-check_msa_hardware] release [1.0.4-1]. 2014-01-30 16:04:50 +00:00
Your Name
a93d887721 README.md added 2014-01-30 15:53:12 +00:00
Your Name
2dbec06282 nrpe.d added to check_msa 2014-01-30 15:47:04 +00:00
Your Name
734e7d5596 rename check_msa_hardware-pl 2014-01-30 15:33:30 +00:00
53 changed files with 796 additions and 573 deletions

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check APC devices
Name: nagios-okplugin-apc
Version: 2.1.0
Version: 2.1.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -38,6 +38,12 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Thu Mar 20 2014 Tomas Edwardsson <tommi@tommi.org> 2.1.1-1
- Merge github.com:opinkerfi/misc (palli@opensource.is)
- Use the right value for the job nbmstemp (tommi@tommi.org)
- Fixed metric conversion for all mibs (tommi@opensource.is)
- Added fahrenheit to celsius conversion (tommi@tommi.org)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 2.1.0-1
- Version number bumped to 2.1.0 (palli@opensource.is)
- Added noarch buildarch (tommi@tommi.org)

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check SMTP blacklists
Name: nagios-okplugin-mailblacklist
Version: 1.0
Version: 1.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -38,6 +38,9 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1.1-1
-
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.0-1
- Updated buildarch to noarch (tommi@tommi.org)

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check network bond devices
Name: nagios-okplugin-bond
Version: 0.0.3
Version: 0.0.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -40,6 +40,10 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- Merge pull request #5 from pallvalmundsson/check_yum_security_patch (palli-
github@minor.is)
* Wed Mar 13 2013 Pall Sigurdsson <palli@opensource.is> 0.0.3-1
-

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check Brocade devices
Name: nagios-okplugin-brocade
Version: 0.0.4
Version: 0.0.5
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -36,6 +36,9 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 0.0.5-1
-
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- new package built with tito

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check CIFS shares
Name: nagios-okplugin-cifs
Version: 1.0
Version: 1.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -39,6 +39,9 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1.1-1
- Merge github.com:opinkerfi/misc (palli@opensource.is)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.0-1
- version number of scripts bumped (palli@opensource.is)
- Updates buildarch to noarch (tommi@tommi.org)

View File

@@ -89,7 +89,6 @@ def remove_stale_state():
state_mtime = os.stat("/var/lib/nagios-okplugin/check_cpu").st_mtime
boot_time = os.stat("/proc/1").st_mtime
if state_mtime < boot_time:
print "unlinking"
os.unlink("/var/lib/nagios-okplugin/check_cpu")
except OSError:
return None

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check CPU on Linux servers
Name: nagios-plugins-check_cpu
Version: 1.0
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,6 +45,11 @@ rm -rf %{buildroot}
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- Added nrpe reload to post section (tommi@tommi.org)
- Merge github.com:opinkerfi/misc (palli@opensource.is)
- Added dependency on bc (palli@opensource.is)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.0-1
- Version number bumped
- Updates buildarch to noarch (tommi@tommi.org)

View File

@@ -2,7 +2,7 @@
Summary: Nagios Plugins to monitor HP Dataprotector
Name: nagios-okplugin-check_dataprotector
Version: 1.0.1
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,6 +45,10 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_dataprotector.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- removed warning threshold of 60 (palli@opensource.is)
- contrib removed from plugin path (palli@opensource.is)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check disks via NRPE
Name: nagios-okplugin-check_disks
Version: 1.0.4
Version: 1.0.6
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -40,6 +40,12 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/check_disks.pl
%changelog
* Tue Mar 25 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.6-1
- Bumped version
* Tue Mar 25 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.5-1
- Added support for inodes (tryggvi@linux.is)
* Sat Mar 02 2013 Tryggvi Farestveit <tryggvi@linux.is> 1.0.4-1
- Added support for inodes

View File

@@ -49,7 +49,7 @@ timeout = 0 # 0 means no timeout
server_side_troubleshooting = False
# No real need to change anything below here
version = "1.0"
version = "1.0.1"
ok = 0
warning = 1
critical = 2
@@ -239,15 +239,15 @@ def run_sssu(system=None, command="ls system full"):
if output.pop(0).strip() != '':
error = 1
if output.pop(0).strip() != '':
error = 1
if output.pop(0).strip() != 'SSSU for HP StorageWorks Command View EVA':
error = 1
error = 2
if output.pop(0).strip().find('SSSU for HP') != 0:
error = 3
if output.pop(0).strip().find('Version:') != 0:
error = 1
error = 4
if output.pop(0).strip().find('Build:') != 0:
error = 1
error = 5
if output.pop(0).strip().find('NoSystemSelected> ') != 0:
error = 1
error = 6
#if output.pop(0).strip() != '': error = 1
#if output.pop(0).strip().find('NoSystemSelected> ') != 0: error=1
#if output.pop(0).strip() != '': error = 1
@@ -260,7 +260,7 @@ def run_sssu(system=None, command="ls system full"):
if i.find('information:') > 0:
break
if error > 0:
print "Error running the sssu command"
print "Error running the sssu command: " + str(error)
print commandstring
print str_buffer
exit(unknown)

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check HP EVA Disk Systems
Name: nagios-okplugin-check_eva
Version: 1.0.2
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -40,6 +40,22 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_eva.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- Merge pull request #10 from gitmopp/patch-2 (palli-github@minor.is)
- bug in for loop. Looped only once (mopp@gmx.net)
- Fixed output to be more compatible (mopp@gmx.net)
- check_eva new Make sure --timeout is an integer (palli@opensource.is)
- check_eva new command line option --timeout (palli@opensource.is)
- check_eva Fix undefined fix typos (palli@opensource.is)
- PEP8 cleanup (palli@opensource.is)
- merged (palli@opensource.is)
- check_eva - minor bugfixes (palli@opensource.is)
- check_eva.py more code cleanup with pycharm inspections (palli@opensource.is)
- check_eva.py - Make code more readable (palli@opensource.is)
- convert from tabs to spaces (palli@opensource.is)
- check_eva - fix mixed tab/spaces (palli@opensource.is)
- Update check_eva.py (sander.grendelman@gmail.com)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.0.2-1
- changed sssu subcommands from being singlequoted to doublequoted for windows
compatibility (palli@opensource.is)

View File

@@ -2,8 +2,8 @@
Summary: A Nagios plugin to check HP Array with hpacucli
Name: nagios-okplugin-check_hpacucli
Version: 1.2
Release: 2%{?dist}
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_hpacucli
@@ -41,6 +41,17 @@ rm -rf %{buildroot}
/etc/sudoers.d/check_hpacucli
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- check_hpacucli.py - fix typo in hpacucli command (palli@opensource.is)
- check_hpacucli.py: pep8 cleanup (palli@opensource.is)
- check_hpacucli - fix tab indentation (palli@opensource.is)
- check_hpacucli: ignore hpacucli output that starts with "Note:"
(palli@opensource.is)
- sudoers.d added to install (you@example.com)
- dummy commit (you@example.com)
- dummy commit (you@example.com)
- Add sudoers support to check_hpacucli (palli@opensource.is)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.2-2
- version number of scripts bumped (palli@opensource.is)

View File

@@ -20,18 +20,16 @@
# This script will check the status of a remote IBM Bladecenter via SNMP.
# No real need to change anything below here
version="1.1.2"
ok=0
warning=1
critical=2
unknown=3
version = "1.1.2"
ok = 0
warning = 1
critical = 2
unknown = 3
not_present = -1
exit_status = -1
state = {}
state[not_present] = "Not Present"
state[ok] = "OK"
@@ -40,59 +38,57 @@ state[critical] = "Critical"
state[unknown] = "Unknown"
longserviceoutput="\n"
perfdata=""
summary=""
sudo=False
longserviceoutput = "\n"
perfdata = ""
summary = ""
sudo = False
from sys import exit
from sys import argv
from os import getenv,putenv,environ
from os import getenv, putenv, environ
import subprocess
# Parse some Arguments
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-m","--mode", dest="mode",
parser.add_option("-m", "--mode", dest="mode",
help="Which check mode is in use (powermodules,system-health,temperature,chassis-status,bladehealth,blowers,switchmodules)")
parser.add_option("-H","--host", dest="host",
parser.add_option("-H", "--host", dest="host",
help="Hostname or IP address of the host to check")
parser.add_option("-w","--warning", dest="warning_threshold",
parser.add_option("-w", "--warning", dest="warning_threshold",
help="Warning threshold", type="int", default=None)
parser.add_option("-c","--critical", type="int", dest="critical_threshold",
parser.add_option("-c", "--critical", type="int", dest="critical_threshold",
help="Critical threshold", default=None)
parser.add_option("-e","--exclude", dest="exclude",
parser.add_option("-e", "--exclude", dest="exclude",
help="Exclude specific object", default=None)
parser.add_option("-v","--snmp_version", dest="snmp_version",
parser.add_option("-v", "--snmp_version", dest="snmp_version",
help="SNMP Version to use (1, 2c or 3)", default="1")
parser.add_option("-u","--snmp_username", dest="snmp_username",
parser.add_option("-u", "--snmp_username", dest="snmp_username",
help="SNMP username (only with SNMP v3)", default=None)
parser.add_option("-C","--snmp_community", dest="snmp_community",
parser.add_option("-C", "--snmp_community", dest="snmp_community",
help="SNMP Community (only with SNMP v1|v2c)", default=None)
parser.add_option("-p","--snmp_password", dest="snmp_password",
parser.add_option("-p", "--snmp_password", dest="snmp_password",
help="SNMP password (only with SNMP v3)", default=None)
parser.add_option("-l","--snmp_security_level", dest="snmp_seclevel",
parser.add_option("-l", "--snmp_security_level", dest="snmp_seclevel",
help="SNMP security level (only with SNMP v3) (noAuthNoPriv|authNoPriv|authPriv)", default=None)
parser.add_option("-t","--snmp_timeout", dest="snmp_timeout",
parser.add_option("-t", "--snmp_timeout", dest="snmp_timeout",
help="Timeout in seconds for SNMP", default=10)
parser.add_option("-d","--debug", dest="debug",
parser.add_option("-d", "--debug", dest="debug",
help="Enable debugging (for troubleshooting", action="store_true", default=False)
(opts,args) = parser.parse_args()
(opts, args) = parser.parse_args()
if opts.host == None:
if opts.host is None:
parser.error("Hostname (-H) is required.")
if opts.mode == None:
if opts.mode is None:
parser.error("Mode (--mode) is required.")
snmp_options = ""
def set_snmp_options():
global snmp_options
if opts.snmp_version is not None:
@@ -101,39 +97,47 @@ def set_snmp_options():
if opts.snmp_username is None:
parser.error("--snmp_username required with --snmp_version=3")
if opts.snmp_seclevel is None:
parser.error("--snmp_security_level required with --snmp_version=3")
parser.error(
"--snmp_security_level required with --snmp_version=3")
if opts.snmp_password is None:
parser.error("--snmp_password required with --snmp_version=3")
snmp_options = snmp_options + " -u %s -l %s -A %s " % (opts.snmp_username, opts.snmp_seclevel,opts.snmp_password)
snmp_options = snmp_options + " -u %s -l %s -A %s " % (
opts.snmp_username, opts.snmp_seclevel, opts.snmp_password)
else:
if opts.snmp_community is None:
parser.error("--snmp_community is required with --snmp_version=1|2c")
parser.error(
"--snmp_community is required with --snmp_version=1|2c")
snmp_options = snmp_options + " -c %s " % opts.snmp_community
snmp_options += " -t %s " % (opts.snmp_timeout)
def error(errortext):
print "* Error: %s" % errortext
exit(unknown)
def debug( debugtext ):
def debug(debugtext):
if opts.debug:
print debugtext
def nagios_status( newStatus ):
def nagios_status(newStatus):
global exit_status
exit_status = max(exit_status, newStatus)
return exit_status
'''runCommand: Runs command from the shell prompt. Exit Nagios style if unsuccessful'''
def runCommand(command):
debug( "Executing: %s" % command )
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,stderr=subprocess.PIPE,)
'''runCommand: Runs command from the shell prompt. Exit Nagios style if unsuccessful'''
debug("Executing: %s" % command)
proc = subprocess.Popen(
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,)
stdout, stderr = proc.communicate('through stdin to stdout')
if proc.returncode > 0:
print "Error %s: %s\n command was: '%s'" % (proc.returncode,stderr.strip(),command)
debug("results: %s" % (stdout.strip() ) )
print "Error %s: %s\n command was: '%s'" % (proc.returncode, stderr.strip(), command)
debug("results: %s" % (stdout.strip()))
if proc.returncode == 127: # File not found, lets print path
path=getenv("PATH")
path = getenv("PATH")
print "Check if your path is correct %s" % (path)
if stderr.find('Password:') == 0 and command.find('sudo') == 0:
print "Check if user is in the sudoers file"
@@ -143,70 +147,82 @@ def runCommand(command):
else:
return stdout
def end():
global summary
global longserviceoutput
global perfdata
global exit_status
print "%s - %s | %s" % (state[exit_status], summary,perfdata)
print "%s - %s | %s" % (state[exit_status], summary, perfdata)
print longserviceoutput
if exit_status < 0: exit_status = unknown
if exit_status < 0:
exit_status = unknown
exit(exit_status)
def add_perfdata(text):
global perfdata
text = text.strip()
perfdata = perfdata + " %s " % (text)
def add_long(text):
global longserviceoutput
longserviceoutput = longserviceoutput + text + '\n'
def add_summary(text):
global summary
summary = summary + text
def set_path(path):
current_path = getenv('PATH')
if current_path.find('C:\\') > -1: # We are on this platform
if path == '':
pass
else: path = ';' + path
else:
path = ';' + path
else: # Unix/Linux, etc
if path == '': path = ":/usr/sbin"
else: path = ':' + path
current_path = "%s%s" % (current_path,path)
if path == '':
path = ":/usr/sbin"
else:
path = ':' + path
current_path = "%s%s" % (current_path, path)
environ['PATH'] = current_path
def snmpget(oid):
snmpgetcommand = "snmpget %s %s %s" % (snmp_options,opts.host,oid)
snmpgetcommand = "snmpget %s %s %s" % (snmp_options, opts.host, oid)
output = runCommand(snmpgetcommand)
oid,result = output.strip().split(' = ', 1)
resultType,resultValue = result.split(': ',1)
oid, result = output.strip().split(' = ', 1)
resultType, resultValue = result.split(': ', 1)
if resultType == 'STRING': # strip quotes of the string
resultValue = resultValue[1:-1]
return resultValue
# snmpwalk -v3 -u v3get mgmt-rek-proxy-p02 -A proxy2011 -l authNoPriv 1.3.6.1.4.1.15497
# snmpwalk -v3 -u v3get mgmt-rek-proxy-p02 -A proxy2011 -l authNoPriv
# 1.3.6.1.4.1.15497
def snmpwalk(base_oid):
snmpwalkcommand = "snmpwalk %s %s %s" % (snmp_options, opts.host, base_oid)
output = runCommand(snmpwalkcommand + " " + base_oid)
return output
def getTable(base_oid):
myTable = {}
output = snmpwalk(base_oid)
for line in output.split('\n'):
tmp = line.strip().split(' = ', 1)
if len(tmp) == 2:
oid,result = tmp
oid, result = tmp
else:
continue
tmp = result.split(': ',1)
tmp = result.split(': ', 1)
if len(tmp) > 1:
resultType,resultValue = tmp[0],tmp[1]
resultType, resultValue = tmp[0], tmp[1]
else:
resultType = None
resultValue = tmp[0]
@@ -215,10 +231,12 @@ def getTable(base_oid):
index = oid.strip().split('.')
column = int(index.pop())
row = int(index.pop())
if not myTable.has_key(column): myTable[column] = {}
if not myTable.has_key(column):
myTable[column] = {}
myTable[column][row] = resultValue
return myTable
def check_powermodules():
powermodules = getTable('1.3.6.1.4.1.2.3.51.2.2.4')
index = 1
@@ -232,22 +250,27 @@ def check_powermodules():
myStatus = i[status]
myDetails = i[details]
myExists = i[exists]
if myIndex == opts.exclude: continue
if myIndex == opts.exclude:
continue
if myExists == "0":
num_no = num_no + 1
else:
if myStatus != "1":
nagios_status(warning)
add_summary( 'Powermodule "%s" status "%s". %s. ' % (myIndex,myStatus,myDetails) )
add_summary('Powermodule "%s" status "%s". %s. ' %
(myIndex, myStatus, myDetails))
else:
num_ok = num_ok + 1
add_long('Powersupply "%s" status "%s". %s. ' % (myIndex,myStatus,myDetails) )
add_summary( "%s out of %s powermodules are healthy" % (num_ok, len(powermodules) ) )
add_perfdata( "'Number of powermodules'=%s" % (len(powermodules) - num_no ) )
add_long('Powersupply "%s" status "%s". %s. ' %
(myIndex, myStatus, myDetails))
add_summary("%s out of %s powermodules are healthy" %
(num_ok, len(powermodules)))
add_perfdata("'Number of powermodules'=%s" %
(len(powermodules) - num_no))
nagios_status(ok)
def check_switchmodules():
switchmodules = getTable("1.3.6.1.4.1.2.3.51.2.22.3.1.1")
# The following oid is undocumented, but contains some useful extra info
@@ -265,18 +288,21 @@ def check_switchmodules():
'this module is installed'
if healthstate == "1":
nagios_status(ok)
add_long("Module%s health good.\n post=%s" % (myIndex,resultvalue))
add_long("Module%s health good.\n post=%s" %
(myIndex, resultvalue))
else:
nagios_status(warning)
add_long("Module%s health bad(%s).\n post=%s" % (myIndex, healthstate,resultvalue) )
add_long("Module%s health bad(%s).\n post=%s" %
(myIndex, healthstate, resultvalue))
add_summary("Problem with Module %s. " % (myIndex))
if len(extrainfo) > int(myIndex):
try:
myExtraInfo = extrainfo[int(myIndex)-1]
myExtraInfo = extrainfo[int(myIndex) - 1]
module_type = myExtraInfo[22]
module_ip = myExtraInfo[6]
add_long( " type=%s ip=%s" % (module_type,module_ip) )
except: pass
add_long(" type=%s ip=%s" % (module_type, module_ip))
except:
pass
if exit_status == ok:
add_summary("All switchmodules healthy")
@@ -291,14 +317,14 @@ def check_blowers():
blower2speed = snmpget("1.3.6.1.4.1.2.3.51.2.2.3.2.0")
blower2state = snmpget("1.3.6.1.4.1.2.3.51.2.2.3.11.0")
add_long( "Blower 1 state=%s speed=%s" % (blower1state,blower1speed) )
add_long( "Blower 2 state=%s speed=%s" % (blower2state,blower2speed) )
add_perfdata("blower1=%s" %(blower1speed.split(None,1)[0] ))
add_perfdata("blower2=%s" %(blower2speed.split(None,1)[0] ))
add_long("Blower 1 state=%s speed=%s" % (blower1state, blower1speed))
add_long("Blower 2 state=%s speed=%s" % (blower2state, blower2speed))
add_perfdata("blower1=%s" % (blower1speed.split(None, 1)[0]))
add_perfdata("blower2=%s" % (blower2speed.split(None, 1)[0]))
# Check blower 1
if blower1state == "1":
nagios_status(ok)
add_summary("Blower1 OK. " )
add_summary("Blower1 OK. ")
else:
add_summary("Blower1 NOT OK. ")
nagios_status(warning)
@@ -306,7 +332,7 @@ def check_blowers():
# Check blower 2
if blower2state == "1":
nagios_status(ok)
add_summary("Blower2 OK. " )
add_summary("Blower2 OK. ")
else:
add_summary("Blower2 NOT OK. ")
nagios_status(warning)
@@ -319,33 +345,33 @@ def check_chassis_status():
chassis = getTable('1.3.6.1.4.1.2.3.51.2.2.5.2')
oids = chassis.values()[0]
chassis_oid = {
1 :"bistSdram",
10 :"bistBootRomFlashImage",
11 :"bistEthernetPort1",
113 :"bistSwitchModulesCommunicating",
12 :"bistEthernetPort2",
13 :"bistInternalPCIBus",
14 :"bistExternalI2CDevices",
15 :"bistUSBController",
16 :"bistVideoCompressorBoard",
17 :"bistPrimaryBus",
18 :"bistInternalEthernetSwitch",
2 :"bistRs485Port1",
3 :"bistRs485Port2",
33 :"bistBladesInstalled",
4 :"bistNvram",
49 :"bistBladesCommunicating",
6 :"bistRtc",
65 :"bistBlowersInstalled",
7 :"bistLocalI2CBus",
73 :"bistBlowersFunctional",
74 :"bistMediaTrayInstalled",
75 :"bistMediaTrayCommunicating",
8 :"bistPrimaryMainAppFlashImage",
81 :"bistPowerModulesInstalled",
89 :"bistPowerModulesFunctional",
9 :"bistSecondaryMainAppFlashImage",
97 :"bistSwitchModulesInstalled",
1: "bistSdram",
10: "bistBootRomFlashImage",
11: "bistEthernetPort1",
113: "bistSwitchModulesCommunicating",
12: "bistEthernetPort2",
13: "bistInternalPCIBus",
14: "bistExternalI2CDevices",
15: "bistUSBController",
16: "bistVideoCompressorBoard",
17: "bistPrimaryBus",
18: "bistInternalEthernetSwitch",
2: "bistRs485Port1",
3: "bistRs485Port2",
33: "bistBladesInstalled",
4: "bistNvram",
49: "bistBladesCommunicating",
6: "bistRtc",
65: "bistBlowersInstalled",
7: "bistLocalI2CBus",
73: "bistBlowersFunctional",
74: "bistMediaTrayInstalled",
75: "bistMediaTrayCommunicating",
8: "bistPrimaryMainAppFlashImage",
81: "bistPowerModulesInstalled",
89: "bistPowerModulesFunctional",
9: "bistSecondaryMainAppFlashImage",
97: "bistSwitchModulesInstalled",
}
# Check if all blades are working
@@ -363,59 +389,60 @@ def check_chassis_status():
# Check Blade Communications
if not oids.has_key(bistBladesInstalled) or not oids.has_key(bistBladesCommunicating):
add_summary( "Blades N/A. ")
add_summary("Blades N/A. ")
elif oids[bistBladesInstalled] == oids[bistBladesCommunicating]:
nagios_status(ok)
add_summary( "Blades OK. " )
add_summary("Blades OK. ")
else:
nagios_status(warning)
add_summary( "Blades NOT OK. " )
add_summary("Blades NOT OK. ")
# Check PowerModule Status
if not oids.has_key(bistPowerModulesFunctional) or not oids.has_key(bistPowerModulesInstalled):
add_summary( "Powermodules N/A. ")
add_summary("Powermodules N/A. ")
elif oids[bistPowerModulesFunctional] == oids[bistPowerModulesInstalled]:
nagios_status(ok)
add_summary( "PowerModules OK. " )
add_summary("PowerModules OK. ")
else:
nagios_status(warning)
add_summary( "PowerModules NOT OK. " )
add_summary("PowerModules NOT OK. ")
# Check SwitcModule Communications
if not oids.has_key(bistSwitchModulesCommunicating) or not oids.has_key(bistSwitchModulesInstalled):
add_summary( "SwitchModules N/A. ")
add_summary("SwitchModules N/A. ")
if oids[bistSwitchModulesCommunicating] == oids[bistSwitchModulesInstalled]:
nagios_status(ok)
add_summary("Switchmodules OK. ")
else:
nagios_status(warning)
add_summary( "Switchmodules NOT OK. ")
add_summary("Switchmodules NOT OK. ")
# Check blower status
if not oids.has_key(bistBlowersInstalled) or not oids.has_key(bistBlowersFunctional):
add_summary( "Blowers N/A. ")
add_summary("Blowers N/A. ")
elif oids[bistBlowersInstalled] == oids[bistBlowersFunctional]:
nagios_status(ok)
add_summary( "Blowers OK. " )
add_summary("Blowers OK. ")
else:
nagios_status(warning)
add_summary( "Blowers NOT OK. " )
add_summary("Blowers NOT OK. ")
# Check Media Tray Status
if not oids.has_key(bistMediaTrayCommunicating) or not oids.has_key(bistMediaTrayInstalled):
nagios_status(ok)
add_summary( "Media Trays N/A. ")
add_summary("Media Trays N/A. ")
elif oids[bistMediaTrayCommunicating] == oids[bistMediaTrayInstalled]:
add_summary( "Media Trays OK. " )
add_summary("Media Trays OK. ")
else:
nagios_status(warning)
add_summary( "Media Trays NOT OK. " )
add_summary("Media Trays NOT OK. ")
# status_oids, oids that where 0 == ok
status_oids = ( 2,3,5,7,8,9,10,11,14,18,19,20,21,22,23,24,25,26,27,28,29,30, )
status_oids = (2, 3, 5, 7, 8, 9, 10, 11, 14, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, )
add_long("Other Sensors: ")
sensor_status = ok
for oid in status_oids:
if not chassis_oid.has_key(oid): continue
if not chassis_oid.has_key(oid):
continue
oidValue = oids[oid]
oidName = chassis_oid[oid]
if oidValue == "0":
@@ -424,28 +451,32 @@ def check_chassis_status():
friendly_status = "%s (not ok)" % oidValue
nagios_status(warning)
sensor_status = warning
add_summary( "%s is %s" % oidName, friendly_status)
add_long( " %s status: %s" % (oidName,friendly_status) )
add_summary("%s is %s" % oidName, friendly_status)
add_long(" %s status: %s" % (oidName, friendly_status))
if sensor_status == ok:
add_summary( "Other Sensors: OK. ")
add_summary("Other Sensors: OK. ")
def check_bladehealth():
blades = getTable('1.3.6.1.4.1.2.3.51.2.22.1.5.2.1')
bladestate = getTable('1.3.6.1.4.1.2.3.51.2.22.1.5.1.1').values()
index,bladeid,severity,description = (1,2,3,4)
index, bladeid, severity, description = (1, 2, 3, 4)
good_blades = 0
total_blades = 0
for i,row in enumerate(blades.values()):
for i, row in enumerate(blades.values()):
myIndex = row[index]
myBladeid = row[bladeid]
mySeverity = row[severity]
myDescription = row[description]
try: myName = bladestate[i][6]
except: myName = ""
if mySeverity == "(No severity)": continue
add_long( "blade%s (%s): %s %s" % (myBladeid,myName,mySeverity, myDescription) )
try:
myName = bladestate[i][6]
except:
myName = ""
if mySeverity == "(No severity)":
continue
add_long("blade%s (%s): %s %s" %
(myBladeid, myName, mySeverity, myDescription))
if opts.exclude:
if myDescription.find(opts.exclude) > -1:
continue
@@ -455,27 +486,33 @@ def check_bladehealth():
good_blades += 1
else:
nagios_status(warning)
add_summary( "blade%s (%s): %s %s. " % (myBladeid,myName,mySeverity, myDescription) )
add_summary("blade%s (%s): %s %s. " %
(myBladeid, myName, mySeverity, myDescription))
if good_blades == total_blades:
add_summary( "%s out of %s blades in Good health. " % (good_blades, total_blades))
add_summary("%s out of %s blades in Good health. " %
(good_blades, total_blades))
nagios_status(ok)
else:
nagios_status(warning)
def check_systemhealth():
systemhealthstat = snmpget('1.3.6.1.4.1.2.3.51.2.2.7.1.0')
summary = getTable('1.3.6.1.4.1.2.3.51.2.2.7.2.1')
index,severity,description,date = (1,2,3,4)
# Sometimes chassis delivers warning when absolutely nothing is going on. Lets work around that
index, severity, description, date = (1, 2, 3, 4)
# Sometimes chassis delivers warning when absolutely nothing is going on.
# Lets work around that
workaround = [{1: '1', 2: 'Good', 3: 'No critical or warning events', 4: 'No timestamp'}]
# Check overall health
if systemhealthstat == '255':
nagios_status(ok)
add_summary("Bladecenter health: OK. ")
elif systemhealthstat == "2":
if summary.values() == workaround:
add_summary("Non-Critical Error: %s " % workaround[0][description] )
elif summary.values() == workaround:
add_summary("Non-Critical Error (bug in firmware): '%s' " %
workaround[0][description])
nagios_status(ok)
return
elif systemhealthstat == "2":
nagios_status(warning)
add_summary("Non-Critical Error. ")
elif systemhealthstat == "4":
@@ -486,7 +523,9 @@ def check_systemhealth():
add_summary("Critical. ")
else:
nagios_status(unknown)
add_summary("Bladecenter health unkown (oid 1.3.6.1.4.1.2.3.51.2.2.7.1.0 returns %s). " % systemhealthstat)
add_summary(
"Bladecenter health unkown (oid 1.3.6.1.4.1.2.3.51.2.2.7.1.0 returns %s). " %
systemhealthstat)
for row in summary.values():
if row[severity] == 'Good':
nagios_status(ok)
@@ -496,30 +535,37 @@ def check_systemhealth():
nagios_status(warning)
else:
nagios_status(critical)
add_summary( "%s. " % (row[description]) )
add_long( "* %s. " % (row[description]) )
add_summary("%s. " % (row[description]))
add_long("* %s. " % (row[description]))
def check_temperature():
# set some sensible defaults
if opts.warning_threshold is None: opts.warning_threshold = 28
if opts.critical_threshold is None: opts.critical_threshold = 35
if opts.warning_threshold is None:
opts.warning_threshold = 28
if opts.critical_threshold is None:
opts.critical_threshold = 35
str_temp = snmpget('1.3.6.1.4.1.2.3.51.2.2.1.5.1.0')
float_temp,measurement = str_temp.split(None, 1)
float_temp = float( float_temp )
float_temp, measurement = str_temp.split(None, 1)
float_temp = float(float_temp)
if opts.critical_threshold is not None and float_temp > opts.critical_threshold:
nagios_status(critical)
add_summary( "ambient temperature (%s) is over critical thresholds (%s). " % (str_temp, opts.critical_threshold) )
add_summary(
"ambient temperature (%s) is over critical thresholds (%s). " %
(str_temp, opts.critical_threshold))
elif opts.warning_threshold is not None and float_temp > opts.warning_threshold:
nagios_status(warning)
add_summary( "ambient temperature (%s) is over warning thresholds (%s). " % (str_temp, opts.warning_threshold) )
add_summary(
"ambient temperature (%s) is over warning thresholds (%s). " %
(str_temp, opts.warning_threshold))
else:
add_summary( "Ambient temperature = %s. " % (str_temp) )
add_perfdata( "'ambient_temp'=%s;%s;%s " % (float_temp,opts.warning_threshold,opts.critical_threshold) )
add_summary("Ambient temperature = %s. " % (str_temp))
add_perfdata("'ambient_temp'=%s;%s;%s " %
(float_temp, opts.warning_threshold, opts.critical_threshold))
#add_long( "Ambient Temperature = %s" % (str_temp) )
nagios_status(ok)
if __name__ == '__main__':
try:
set_snmp_options()

View File

@@ -2,8 +2,8 @@
Summary: A Nagios plugin to check IBM Bladecenters
Name: nagios-okplugin-check_ibm_bladecenter
Version: 1.1.2
Release: 3%{?dist}
Version: 4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-check_ibm_bladecenter
@@ -40,6 +40,21 @@ rm -rf %{buildroot}
#%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Fri Feb 21 2014 Pall Sigurdsson <palli@opensource.is> 4-1
-
* Fri Feb 21 2014 Unknown name 3-1
- Merge branch 'master' of github.com:opinkerfi/nagios-plugins
(palli@opensource.is)
- ibm_bladecenter - another firmware bug workaround (palli@opensource.is)
- pep8 fixes (palli@opensource.is)
- Fix workaround for firmware bug (palli@opensource.is)
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- Merge branch 'master' of github.com:opinkerfi/misc (palli@opensource.is)
- --exclude option added. Added workaround around false positives
(palli@opensource.is)
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.1.2-3
- version number of scripts bumped (palli@opensource.is)

View File

@@ -3,7 +3,7 @@
Summary: A Nagios plugin to check IPA server status
Name: nagios-okplugin-%{plugin}
Version: 0.0.3
Version: 0.0.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -42,6 +42,12 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/nrpe.d/check_ipa.cfg
%changelog
* Fri Apr 04 2014 Tomas Edwardsson <tommi@tommi.org> 0.0.4-1
- Renamed to markdown (tommi@tommi.org)
- Added examples and documentation (tommi@tommi.org)
- Missing colon (tommi@tommi.org)
- Added missing OK when things worked out (tommi@tommi.org)
* Thu Apr 25 2013 Tomas Edwardsson <tommi@tommi.org> 0.0.3-1
- Preliminary testing done, released
- Various errors in syntax fixed (tommi@tommi.org)

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check Cisco Ironport
Name: nagios-okplugin-check_ironport
Version: 1.1.4
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -37,6 +37,10 @@ rm -rf %{buildroot}
#%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- Merge branch 'master' of https://opensource.ok.is/git/misc
(palli@opensource.is)
* Tue Jul 31 2012 Pall Sigurdsson <palli@opensource.is> 1.1.4-1
- initial packaging for nagios-okplugin-check_ironport (palli@opensource.is)

View File

@@ -0,0 +1 @@
Checks hardware status of MSA disk arrays also known as HP P2000

View File

@@ -4,7 +4,7 @@
Summary: A Nagios plugin to check status of an MSA (HP P2000) disk array
Name: nagios-okplugin-%{plugin}
Version: 1.0.3
Version: 1.0.5
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
@@ -46,6 +46,14 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/nrpe.d/%{plugin}.cfg
%changelog
* Thu Jan 30 2014 Pall Sigurdsson <palli@opensource.is> 1.0.5-1
-
* Thu Jan 30 2014 Pall Sigurdsson <palli@opensource.is> 1.0.4-1
- README.md added (you@example.com)
- nrpe.d added to check_msa (you@example.com)
- rename check_msa_hardware-pl (you@example.com)
* Thu Jan 30 2014 Pall Sigurdsson <palli@opensource.is> 1.0.3-1
- new package built with tito

View File

@@ -0,0 +1 @@
command[check_msa_hardware]=/usr/lib64/nagios/plugins/check_msa_hardware

View File

@@ -72,12 +72,11 @@ def getLocalNodeState(dom):
"""
Get the state of the local node
"""
hostname = socket.gethostname()
nodesList = dom.getElementsByTagName('node')
nodeState = {}
for node in nodesList:
if node.attributes['name'].value == hostname:
if node.attributes['local'].value == "1":
nodeState['name'] = node.attributes['name'].value
nodeState['state'] = node.attributes['state'].value
nodeState['rgmanager'] = node.attributes['rgmanager'].value
@@ -95,7 +94,6 @@ def getServiceState(dom, service):
Get the state of the named service
"""
groupList = dom.getElementsByTagName('group')
hostname = socket.gethostname()
serviceState = {}
for group in groupList:
if group.attributes['name'].value in (service,"service:"+service,"vm:"+service):

View File

@@ -6,7 +6,7 @@
Summary: A Nagios plugin to check Red Hat Cluster suite (rhel5 and rhel6)
Name: nagios-okplugin-%{plugin_name}
Version: %{version}
Version: 1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,6 +45,11 @@ rm -rf %{buildroot}
/etc/nrpe.d/%{plugin_name}.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1-1
- Updated rhcs nrpe config as well (tommi@tommi.org)
- Added check for suspended services -Z (tommi@tommi.org)
- Fix broken libdir on 64-bit platforms (palli@opensource.is)
* Thu May 24 2012 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- version bump of check_rhcs (palli@opensource.is)
- check_rhcs_fence added for rhel6 compatibility (palli@opensource.is)

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check SELinux status on Linux servers
Name: nagios-plugins-check_selinux
Version: 1.1
Version: 1.3
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
@@ -35,6 +35,12 @@ rm -rf %{buildroot}
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1.3-1
-
* Thu Feb 20 2014 Pall Sigurdsson
-
* Wed May 22 2013 Tomas Edwardsson <tommi@tommi.org> 1.1-1
- new package built with tito

View File

@@ -2,7 +2,7 @@
Summary: Various nagios plugins to check cpu,memory,interfaces via SNMP
Name: nagios-okplugin-check_snmp
Version: 1.0.1
Version: 2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,6 +45,9 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 2-1
- make sure nagios does not run us in embedded perl (palli@opensource.is)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito

View File

@@ -2,13 +2,14 @@
Summary: A Nagios plugin to compare time on remote host with localhost
Name: nagios-okplugin-check_time
Version: 1.0.1
Version: 1.0.3
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_time
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_time/releases/nagios-okplugin-check_time-%{version}.tar.gz
Requires: nagios-nrpe
Requires: bc
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
@@ -40,6 +41,12 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_time.cfg
%changelog
* Fri Apr 04 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.3-1
- check_time - Added requirement for bc (tommi@tommi.org)
* Tue Mar 25 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.2-1
- Bump version
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check uptime of a remote host via NRPE
Name: nagios-okplugin-check_uptime
Version: 1.0.2
Version: 1.0.3
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -41,6 +41,9 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_uptime.cfg
%changelog
* Sun Apr 13 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.3-1
- Update tag
* Mon Dec 30 2013 Tomas Edwardsson <tommi@tommi.org> 1.0.2-1
- Updated tag for build with newer tito

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check yum updates via NRPE
Name: nagios-okplugin-check_yum
Version: 0.8.2
Version: 1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,6 +45,10 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_yum.cfg
%changelog
* Thu Feb 20 2014 Pall Sigurdsson <palli@opensource.is> 1-1
- Merge branch 'master' of github.com:opinkerfi/nagios-plugins
(palli@opensource.is)
* Mon May 27 2013 Tomas Edwardsson <tommi@tommi.org> 0.8.2-1
- Fixed nrpe with invalid libdir (tommi@tommi.org)

View File

@@ -0,0 +1,46 @@
%define debug_package %{nil}
Summary: A Nagios plugin to get network statistics over NRPE
Name: nagios-okplugin-get_network_stat
Version: 1.0.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: https://github.com/opinkerfi/nagios-plugins/okc-get_network_stat
Source0: https://github.com/opinkerfi/nagios-plugins/okc-get_network_stat/%{name}-%{version}.tar.gz
Requires: nagios-plugins-nrpe
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@tommi.org>
BuildArch: noarch
%description
A Nagios plugin to get network statistics over NRPE
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 okc-get_network_stat %{buildroot}%{_libdir}/nagios/plugins/okc-get_network_stat
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
#%doc README LICENSE
#%{_libdir}/nagios/plugins/*
%{_libdir}/nagios/plugins/okc-get_network_stat
%changelog
* Wed Apr 02 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.1-1
- new package built with tito
* Wed Apr 2 2014 Tomas Edwardsson <tommi@tommi.org> 1.0.0-1
- Initial release

View File

@@ -0,0 +1,65 @@
#!/usr/bin/python
from pynag.Plugins import PluginHelper, ok, warning, critical, unknown
from pynag.Utils import runCommand
import re
helper = PluginHelper()
helper.parser.add_option("-H", help="Host to connect to", dest="host", default='localhost')
helper.parse_arguments()
if helper.options.host == "localhost":
command="cat /proc/net/dev|sed 's/ */ /g'"
else:
command="/usr/lib64/nagios/plugins/check_nrpe -H '%s' -c get_network_interfaces_stat" % helper.options.host
return_code, stdout, stderr = runCommand(command)
try:
receive, transmit = stdout.split("\n")[1].split("|")[1:]
receive = receive.split()
transmit = transmit.split()
interfaces = []
for int_line in stdout.split("\n")[2:]:
int_line = int_line.strip()
if not int_line:
continue
int_arr = re.split("[: ]+", int_line.strip())
interface = int_arr.pop(0)
if interface == "lo" or interface.startswith('sit'):
continue
interfaces.append(interface)
for i in range(0, len(receive)):
helper.add_metric(
label="%s_rx_%s" % (interface, receive[i]),
value=int_arr.pop(0),
uom="c")
for i in range(0, len(transmit)):
helper.add_metric(
label="%s_tx_%s" % (interface, transmit[i]),
value=int_arr.pop(0),
uom="c")
helper.add_summary("Network interfaces %s" % ", ".join(interfaces))
# Here all metrics will be checked against thresholds that are either
# built-in or added via --threshold from the command-line
helper.check_all_metrics()
# Print out plugin information and exit nagios-style
helper.exit(ok)
except Exception, error:
helper.status(unknown)
helper.add_summary(stdout + stderr)
helper.exit(unknown)
# vim: sts=4 expandtab autoindent

View File

@@ -1 +1 @@
2.1.0-1 check_apcext.pl/
2.1.1-1 check_apcext.pl/

View File

@@ -1 +1 @@
0.0.3-1 check_bond/
0.0.4-1 check_bond/

View File

@@ -1 +1 @@
0.0.4-1 check_brocade/
0.0.5-1 check_brocade/

View File

@@ -1 +0,0 @@
1.1-1 check_cpu.py/

View File

@@ -1 +1 @@
1.0.1-1 check_dataprotector/
2-1 check_dataprotector/

View File

@@ -1 +1 @@
1.0.3-1 check_disks.pl/
1.0.6-1 check_disks.pl/

View File

@@ -1 +1 @@
1.0.2-1 check_eva/
2-1 check_eva/

View File

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

View File

@@ -1 +1 @@
1.1.2-3 check_ibm_bladecenter/
4-1 check_ibm_bladecenter/

View File

@@ -1 +1 @@
1.1.4-1 check_ironport/
2-1 check_ironport/

View File

@@ -1 +1 @@
1.0.3-1 check_msa_hardware-pl/
1.0.5-1 check_msa_hardware-pl/

View File

@@ -1 +1 @@
0.0.4-1 check_rhcs/
1-1 check_rhcs/

View File

@@ -1 +1 @@
1.0.1-1 check_snmp/
2-1 check_snmp/

View File

@@ -1 +1 @@
1.0.1-1 check_time/
1.0.3-1 check_time/

View File

@@ -1 +1 @@
1.0.2-1 check_uptime/
1.0.3-1 check_uptime/

View File

@@ -1 +1 @@
0.8.2-1 check_yum/
1-1 check_yum/

View File

@@ -1 +1 @@
1.0-1 check_cifs/
1.1-1 check_cifs/

View File

@@ -1 +0,0 @@
1.2-1 nagios-okplugin-common/

View File

@@ -0,0 +1 @@
1.0.1-1 okc-get_network_stat/

View File

@@ -1 +1 @@
0.0.3-1 check_ipa/
0.0.4-1 check_ipa/

View File

@@ -1 +1 @@
1.0-1 check_bl/
1.1-1 check_bl/

View File

@@ -1 +1 @@
1.0-1 check_cpu.sh/
2-1 check_cpu.sh/

View File

@@ -1 +1 @@
1.1-1 check_selinux/
1.3-1 check_selinux/

View File

@@ -6,61 +6,7 @@ builder.mock = fedora-20-x86_64
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/fedora20/x86_64/
[production-fc20-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-20-x86_64
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/fedora20/x86_64/
# Fedora FC19
[test-fc19-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-19-x86_64
builder.test = 1
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/testing/fedora19/x86_64/
[production-fc19-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-19-x86_64
rsync = tito@opensource.is:/var/www/sites/opensource.ok.is/repo/fedora19/x86_64/
# 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
# RHEL 6 Production
[production-el6-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder