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

Compare commits

..

80 Commits

Author SHA1 Message Date
Pall Sigurdsson
36db6b9661 Automatic commit of package [nagios-okplugin-check_yum] release [0.7.4-1]. 2012-08-23 10:54:14 +00:00
Pall Sigurdsson
4a98095f7c Automatic commit of package [nagios-okplugin-check_nagios] release [1.1-1]. 2012-08-23 10:51:54 +00:00
Pall Sigurdsson
2ccd5989e3 Automatic commit of package [nagios-plugins-check_cpu] release [1.0-1]. 2012-08-23 10:50:56 +00:00
Pall Sigurdsson
626ec4f2b9 Automatic commit of package [nagios-okplugin-check_eva] release [1.0.2-1]. 2012-08-23 10:49:43 +00:00
Pall Sigurdsson
1637f8f93b Automatic commit of package [nagios-okplugin-apc] release [2.1.0-1]. 2012-08-23 10:49:04 +00:00
Pall Sigurdsson
1209c00087 Merge branch 'master' of https://opensource.ok.is/git/misc 2012-08-07 13:23:14 +00:00
Pall Sigurdsson
65004322a9 bugfix, check_nagios_needs_reload check for reload instead of reparse 2012-08-07 13:23:08 +00:00
Pall Sigurdsson
5342a3cf16 Automatic commit of package [nagios-okplugin-check_ironport] release [1.1.4-1]. 2012-07-31 16:07:22 +00:00
Pall Sigurdsson
d6a23a3ca4 initial packaging for nagios-okplugin-check_ironport 2012-07-31 16:07:01 +00:00
Pall Sigurdsson
960cb63b40 Automatic commit of package [nagios-okplugin-check_ironport] release [1.1.3-1]. 2012-07-31 16:06:33 +00:00
Pall Sigurdsson
59b745678a initial packaging for nagios-okplugin-check_ironport 2012-07-31 16:06:16 +00:00
Pall Sigurdsson
ff9e3d96e7 fixed typo in error messages 2012-07-17 20:33:29 +00:00
Pall Sigurdsson
74cda834ab changed sssu subcommands from being singlequoted to doublequoted for windows compatibility 2012-07-17 20:30:55 +00:00
Pall Sigurdsson
bd4aa7f57d rpm spec file added. version number bumped 2012-07-17 20:20:15 +00:00
Pall Sigurdsson
ba7b80fc1c Automatic commit of package [nagios-okplugin-check_ibm_bladecenter] release [1.1.2-1]. 2012-07-17 20:19:02 +00:00
Pall Sigurdsson
3c87920fd1 rpm spec file added. version number bumped 2012-07-17 20:18:36 +00:00
Pall Sigurdsson
0badbf8619 rpm spec file added. version number bumped 2012-07-17 20:16:50 +00:00
Pall Sigurdsson
59dc82fd44 Fix crash where bladecenter has undocumented extra info, but only partial (closes #62 and #54) 2012-07-17 19:59:51 +00:00
Pall Sigurdsson
afb015b67d Merging with check_yum from code.google.com 2012-07-06 17:14:45 +00:00
Pall Sigurdsson
38c56fe3d8 Bugfix, no longer returns problem when not all powermodules are installed (thanks Davide Gandolfi) 2012-06-25 09:33:12 +00:00
Pall Sigurdsson
bf9ecb7777 Automatic commit of package [nagios-okplugin-check_rhcs] release [0.0.4-1]. 2012-05-24 07:07:15 +00:00
Pall Sigurdsson
756c0ef1de version bump of check_rhcs 2012-05-24 07:07:04 +00:00
Pall Sigurdsson
9346c1a60d check_command is now sudo'ed 2012-05-16 10:37:03 +00:00
Tomas Edwardsson
77b527f44d Automatic commit of package [nagios-okplugin-check_disks] release [1.0.3-1]. 2012-05-16 10:20:19 +00:00
Tomas Edwardsson
5a4d14734e Updated version of nagios-okplugin-check_disks 2012-05-16 10:08:37 +00:00
Pall Sigurdsson
27f4da23bf Merge branch 'master' of http://opensource.ok.is/git/misc 2012-05-11 13:33:07 +00:00
Tomas Edwardsson
468f7ef32a Merge branch 'master' of https://opensource.ok.is/git/misc 2012-05-10 11:20:10 +00:00
Tomas Edwardsson
682ad04b9e Issue #56, temporary fix for selinux and disk checks 2012-05-10 11:19:01 +00:00
Tomas Edwardsson
6f5041d8cd Issue 56, temporary fix for selinux and disk checks 2012-05-10 11:17:49 +00:00
Pall Sigurdsson
2c23f04ffa Merge branch 'master' of https://opensource.ok.is/git/misc 2012-04-23 12:44:12 +00:00
Pall Sigurdsson
ceda55b389 make sure plugin exits cleanly if unable to run clustat -fx command 2012-04-23 12:43:14 +00:00
Tomas Edwardsson
af98917b05 Merge branch 'master' of https://opensource.ok.is/git/misc 2012-04-20 14:41:24 +00:00
Tomas Edwardsson
ddaad8f39d Updates buildarch to noarch 2012-04-20 14:41:11 +00:00
Tomas Edwardsson
d6f9b6093f Updates buildarch to noarch 2012-04-20 14:40:54 +00:00
Tomas Edwardsson
381aef1156 Updated buildarch to noarch 2012-04-20 14:40:13 +00:00
Tomas Edwardsson
ed9d2eb2b9 Added noarch buildarch 2012-04-20 14:39:47 +00:00
Tomas Edwardsson
9248569b6d Issue 49, fixed typo for blower 2012-04-20 14:37:54 +00:00
Pall Sigurdsson
26e5c218b9 Automatic commit of package [nagios-okplugin-mssql] release [0.0.7-1]. 2012-03-19 11:18:42 +00:00
Pall Sigurdsson
aa41f16b6e check_rhcs_fence added for rhel6 compatibility 2012-03-16 11:17:48 +00:00
Pall Sigurdsson
6230193b05 Automatic commit of package [nagios-okplugin-check_drbd] release [0.0.4-1]. 2012-03-14 14:25:32 +00:00
Pall Sigurdsson
bbc5893cfe copy/paste error removed from spec file 2012-03-14 14:17:18 +00:00
Pall Sigurdsson
599134bc5e Automatic commit of package [nagios-okplugin-check_rhcs] release [0.0.3-1]. 2012-03-14 14:16:31 +00:00
Pall Sigurdsson
f60a518bd3 licence and readme removed from specfile 2012-03-14 14:13:12 +00:00
Pall Sigurdsson
f4615ffed5 Automatic commit of package [nagios-okplugin-check_drbd] release [0.0.3-1]. 2012-03-14 14:11:39 +00:00
Pall Sigurdsson
05251498c1 Automatic commit of package [nagios-okplugin-check_linux_modules] release [0.0.13-1]. 2012-03-12 18:00:00 +00:00
Pall Sigurdsson
8d0494c4ff typo in plugin name fixed 2012-03-12 17:59:49 +00:00
Pall Sigurdsson
1bc3ed0782 Automatic commit of package [nagios-okplugin-check_linux_modules] release [0.0.12-1]. 2012-03-12 17:59:07 +00:00
Pall Sigurdsson
da2ae8dd2d spec file and license added for check_linux_modules 2012-03-12 17:58:18 +00:00
Pall Sigurdsson
28e8660037 Automatic commit of package [nagios-okplugin-check_smssend] release [0.0.11-1]. 2012-03-12 17:52:08 +00:00
Pall Sigurdsson
9a42e9c21e license added 2012-03-12 17:49:50 +00:00
Pall Sigurdsson
44fc2600fd Automatic commit of package [nagios-okplugin-check_smssend] release [0.0.10-1]. 2012-03-12 17:49:17 +00:00
Pall Sigurdsson
b72f03415a Automatic commit of package [nagios-okplugin-check_smssend] release [0.0.9-1]. 2012-03-12 17:48:07 +00:00
Pall Sigurdsson
bbfaac455c Automatic commit of package [nagios-okplugin-check_nagios] release [0.0.8-1]. 2012-03-12 17:37:17 +00:00
Pall Sigurdsson
9065fa7ec8 LICENSE file added 2012-03-12 17:37:04 +00:00
Pall Sigurdsson
b5e5207c62 Automatic commit of package [nagios-okplugin-check_nagios] release [0.0.7-1]. 2012-03-12 17:34:35 +00:00
Pall Sigurdsson
82a6090e64 Automatic commit of package [nagios-okplugin-check_nagios] release [0.0.6-1]. 2012-03-12 17:31:14 +00:00
Pall Sigurdsson
e6dce9e9b5 Automatic commit of package [nagios-okplugin-mssql] release [0.0.6-1]. 2012-03-12 16:09:40 +00:00
Pall Sigurdsson
f14db81ca5 Automatic commit of package [nagios-okplugin-crit2warn] release [0.0.2-1]. 2012-03-12 16:09:00 +00:00
Pall Sigurdsson
aebaefa4bf Automatic commit of package [nagios-okplugin-check_yum] release [0.7.3-1]. 2012-03-12 16:09:00 +00:00
Pall Sigurdsson
2de33b2f02 Automatic commit of package [nagios-okplugin-check_vmware_wbem] release [1.0.1-1]. 2012-03-12 16:09:00 +00:00
Pall Sigurdsson
07cb5f0470 Automatic commit of package [nagios-okplugin-check_uptime] release [1.0.1-1]. 2012-03-12 16:09:00 +00:00
Pall Sigurdsson
38bbcd056f Automatic commit of package [nagios-okplugin-check_time] release [1.0.1-1]. 2012-03-12 16:08:59 +00:00
Pall Sigurdsson
edc84c54a4 Automatic commit of package [nagios-okplugin-check_snmp] release [1.0.1-1]. 2012-03-12 16:08:59 +00:00
Pall Sigurdsson
64119882e9 Automatic commit of package [nagios-okplugin-check_multipath] release [0.0.3-1]. 2012-03-12 16:08:59 +00:00
Pall Sigurdsson
e910d327c5 Automatic commit of package [nagios-okplugin-mssql] release [0.0.5-1]. 2012-03-12 16:08:58 +00:00
Pall Sigurdsson
95d0b84219 Automatic commit of package [nagios-okplugin-check_hpacucli] release [0.0.3-1]. 2012-03-12 16:08:58 +00:00
Pall Sigurdsson
f24a7c050e Automatic commit of package [nagios-okplugin-check_eva] release [1.0.1-1]. 2012-03-12 16:08:57 +00:00
Pall Sigurdsson
74407957c3 Automatic commit of package [nagios-okplugin-check_disks] release [1.0.1-1]. 2012-03-12 16:08:57 +00:00
Pall Sigurdsson
14d5afd698 Automatic commit of package [nagios-okplugin-check_dataprotector] release [1.0.1-1]. 2012-03-12 16:08:57 +00:00
Pall Sigurdsson
2ecfed0b40 Automatic commit of package [nagios-plugins-check_cpu] release [0.3-1]. 2012-03-12 16:08:57 +00:00
Pall Sigurdsson
7779f09241 Automatic commit of package [nagios-okplugin-cifs] release [0.0.4-1]. 2012-03-12 16:08:56 +00:00
Pall Sigurdsson
3ef06cb89f Automatic commit of package [nagios-okplugin-brocade] release [0.0.4-1]. 2012-03-12 16:08:56 +00:00
Pall Sigurdsson
4f13da5ce6 Automatic commit of package [nagios-okplugin-bond] release [0.0.2-1]. 2012-03-12 16:08:56 +00:00
Pall Sigurdsson
851579e88c Automatic commit of package [nagios-okplugin-mailblacklist] release [0.0.2-1]. 2012-03-12 16:08:55 +00:00
Pall Sigurdsson
294f2d78dd Automatic commit of package [nagios-okplugin-apc] release [0.0.3-1]. 2012-03-12 16:08:55 +00:00
Pall Sigurdsson
4ac4af674f Version number added to every spec file 2012-03-12 16:05:44 +00:00
Pall Sigurdsson
b23491b453 moved plugins from subversion-style trunk/ directories 2012-03-12 16:03:21 +00:00
Pall Sigurdsson
d31a51e84c deleted subversion-style /releases/ directories 2012-03-12 15:59:26 +00:00
Pall Sigurdsson
5cdbba7b66 Merge manage.tr.is:/opt/misc 2012-03-04 16:23:00 +00:00
root
15b9e64a88 fixed missing tempfile cleanup 2012-03-04 16:22:37 +00:00
146 changed files with 1341 additions and 2200 deletions

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check APC devices
Name: nagios-okplugin-apc
Version: 0.0.2
Version: 2.1.0
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -11,6 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_apcext.pl/rel
Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description
@@ -37,5 +38,12 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* 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)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.3-1
- new package built with tito
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1
- Initial packaging

View File

@@ -1,41 +0,0 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check APC devices
Name: nagios-okplugin-apc
Version: 0.0.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-APC
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_apcext.pl/releases/nagios-okplugin-apc-%{version}.tar.gz
Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
%description
Checks APC devices, both netbotz and UPS
%prep
%setup -q
#perl -pi -e "s|/usr/lib|%{_libdir}|g" check_sip
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_apcext.pl %{buildroot}%{_libdir}/nagios/plugins/check_apcext.pl
install -D -p -m 0755 check_snmp_apc_ups %{buildroot}%{_libdir}/nagios/plugins/snmp_apc_ups
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1
- Initial packaging

View File

@@ -1 +0,0 @@
check_apcext.pl - APC Extra gear checks (netbotz/pdus)

View File

@@ -1,447 +0,0 @@
#!/usr/bin/perl
#
# check_apcext.pl - APC Extra gear monitoring plugin for Nagios
# 05.02.07 Paul Venezia
#
# v0.0.1
#
#
use Net::SNMP;
use Getopt::Std;
use Data::Dumper;
use vars qw/ %opt /;
use strict;
sub getmasked_values ($$);
if ($ARGV[0] =~ /(--help|-h|help)/ || !defined$ARGV[0]) {
&usage;
exit 0;
}
my $opts = 's:lmC:H:p:w:c:';
getopts ( "$opts", \%opt ) or &usage;
my $host = $opt{H};
my $comm = $opt{C};
my $param = $opt{p};
my $warn = $opt{w};
my $crit = $opt{c};
my $metric = $opt{m};
my $list = $opt{l};
my $sensor_int_name = $opt{s};
my ($oid, $oidbase, $fval, $unit, $outmsg);
my $retval = 0;
my %rpduamps;
my %oids = (
'nbmstemp' => {
'label' => 'Temp',
'unit' => ($metric ? 'degC' : 'degF'),
'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.1.1',
'sensor_key' => 5,
'sensor_val' => 2,
'cdef' => ($metric ? '$val * 0.1' : '($val * .18) + 32')
},
'nbmshum' => {
'label' => 'Humidity',
'unit' => '%',
'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.2.1',
'sensor_key' => 5,
'sensor_val' => 8,
},
'nbmsairflow' => {
'label' => 'Air Flow',
'unit' => 'CFM',
'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.5.1',
'sensor_val' => 8,
'sensor_key' => 5,
'mod' => 'lt'
},
'nbmsaudio' => {
'label' => 'Audio Level',
'unit' => '',
'oidbase' => '.1.3.6.1.4.1.5528.100.4.1.4.1',
'sensor_val' => 7,
'sensor_key' => 5,
'mod' => ''
},
'rpduamps' => {
'label' => 'Power Output',
'unit' => 'Amps',
'oid' => '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.',
'cdef' => '$val * .10'
},
'acscstatus' => {
'label' => 'Status',
'unit' => '',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.1.0'
},
'acscload' => {
'label' => 'Cooling Load',
'unit' => 'kW',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.3.0',
'cdef' => '$val * .10'
},
'acscoutput' => {
'label' => 'Cooling output',
'unit' => 'kW',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.2.0',
'cdef' => '$val * .10'
},
'acscsupair' => {
'label' => 'Supply Air',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.8.0',
'cdef' => '$val * .10'
},
'acscretair' => {
'label' => 'Return Air',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.10.0',
'cdef' => '$val * .10'
},
'acscairflow' => {
'label' => 'Airflow',
'unit' => 'CFM',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.4.0',
},
'acscracktemp' => {
'label' => 'Rack Inlet Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.6.0',
'cdef' => '$val * .10'
},
'acsccondin' => {
'label' => 'Cond Inlet Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.30.0',
'cdef' => '$val * .10'
},
'acsccondout' => {
'label' => 'Cond Outlet Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.4.1.2.28.0',
'cdef' => '$val * .10'
},
'acrcstatus' => {
'label' => 'Status',
'unit' => '',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.1.0'
},
'acrcload' => {
'label' => 'Cooling Load',
'unit' => 'kW',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.2.0',
'cdef' => '$val * .10'
},
'acrcoutput' => {
'label' => 'Cooling Output',
'unit' => 'kW',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.3.0',
'cdef' => '$val * .10'
},
'acrcairflow' => {
'label' => 'Airflow',
'unit' => 'CFM',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.4.0'
},
'acrcracktemp' => {
'label' => 'Rack Inlet Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.6.0',
'cdef' => '$val * .10'
},
'acrcsupair' => {
'label' => 'Supply Air',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.8.0',
'cdef' => '$val * .10'
},
'acrcretair' => {
'label' => 'Return Air',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.10.0',
'cdef' => '$val * .10'
},
'acrcfanspeed' => {
'label' => 'Fan Speed',
'unit' => '%',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.16.0',
'cdef' => '$val * .10',
},
'acrcfluidflow' => {
'label' => 'Fluid Flow',
'unit' => 'GPM',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.21.0',
'cdef' => '$val * .10',
'mod' => 'lt'
},
'acrcflenttemp' => {
'label' => 'Entering Fluid Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.23.0',
'cdef' => '$val * .10'
},
'acrcflrettemp' => {
'label' => 'Returning Fluid Temp',
'unit' => 'F',
'oid' => '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.25.0',
'cdef' => '$val * .10'
},
);
if ($list) {
my ($baseoid, $int_name_id, $value_id) = @_;
my ($session, $error) = Net::SNMP->session(
-hostname => $host,
-community => $comm,
-version => 1,
# -translate => [-octetstring => 0x0],
-port => "161"
);
my $response = $session->get_table(-baseoid => ".1.3.6.1.4.1.5528.100.2.1.1");
my $err = $session->error;
if ($err){
$retval = 3;
$outmsg = "UNKNOWN";
$session->close();
print "$outmsg $err - SNMP Error connecting to $host\n";
exit $retval;
}
my %sensor;
foreach my $k (keys %{$response}) {
my ($type, $id) = (split(/\./, $k))[-2,-1];
next if ($type != 1 and $type != 4);
next if ($id < 2000000000);
if ($type == 1) {
$sensor{$id}->{"int_name"} = $response->{$k};
} else {
$sensor{$id}->{"friendly_name"} = $response->{$k};
}
}
print <<" EO";
Specify a sensor by using the -s and the INTERNAL name of the sensor
Detected sensors:
EO
printf("\t%-32s %s\n", "Friendly Name", "Internal Name");
foreach my $id (sort { $sensor{$a}->{"friendly_name"} cmp $sensor{$b}->{"friendly_name"} } keys %sensor) {
printf ("\t%-32s %s\n", "\"$sensor{$id}->{friendly_name}\"", "\"$sensor{$id}->{int_name}\"");
}
exit 0;
} elsif (!$oids{$param}) {
print "No test parameter specified";
exit 3;
} else {
$oid = $oids{$param}->{oid};
$oidbase = $oids{$param}->{oidbase};
}
my ($session, $error) = Net::SNMP->session(
-hostname => $host,
-community => $comm,
-version => 1,
# -translate => [-octetstring => 0x0],
-port => "161"
);
if ($param eq "rpduamps") {
# $param = "RackPDU";
my $i;
for ($i=1;$i<4;$i++) {
my $phoid = $oid . $i;
my $response = $session->get_request($phoid);
my $err = $session->error;
if ($err){
$retval = 3;
$outmsg = "UNKNOWN";
$session->close();
print "$outmsg $err - SNMP Error connecting to $host\n";
exit $retval;
}
$rpduamps{$i} = $response->{$phoid};
}
$session->close;
#$crit = ($crit * 10);
#$warn = ($warn * 10);
$unit = "Amps";
foreach my $ph ( sort keys %rpduamps ) {
my $tphase = ($rpduamps{$ph} * .1);
if (($tphase >= $crit) && ($retval < 2)) {
$retval = 2;
$outmsg = "CRITICAL";
} elsif (($tphase >= $warn) && ($retval < 1)) {
$retval = 1;
$outmsg = "WARNING";
} elsif ($retval < 1) {
$retval = 0;
$outmsg = "OK";
}
$fval .= "Phase $ph: " . $tphase;
#$fval .= "Phase $ph: " . ($tphase * .1);
if ($ph lt 3) {
$fval .= " Amps, ";
#} else {
# $fval .= " ";
}
}
} else {
my $val;
if ($oid) {
my $response = $session->get_request($oid);
my $err = $session->error;
if ($err){
$retval = 3;
$outmsg = "UNKNOWN";
$session->close();
print "$outmsg $err - SNMP Error connecting to $host\n";
exit $retval;
}
$val = $response->{$oid};
$session->close();
} else {
my $snmpd = getmasked_values($oidbase, { $oids{$param}->{sensor_key} => 'sensor_key',
$oids{$param}->{sensor_val} => 'sensor_val' });
if ((keys %{$snmpd}) > 1 && !$sensor_int_name) {
print "UNKNOWN - Many sensors found but none specified, see -s and -l\n";
exit 3;
} elsif ((keys %{$snmpd}) == 0) {
print "UNKNOWN - no sensors found on this device\n";
exit 3;
} else {
my $id = (keys %{$snmpd})[0];
$val = $snmpd->{$id}->{sensor_val};
}
if ($sensor_int_name) {
foreach my $k (keys %{$snmpd}) {
if (lc($snmpd->{$k}->{sensor_key}) eq lc($sensor_int_name)) {
$val = $snmpd->{$k}->{sensor_val};
}
}
}
if ($val eq "") {
print Dumper $snmpd;
print "UNKNOWN Unable to get sensor status\n";
exit 3;
}
}
if ($param eq "acscstatus" || $param eq "acrcstatus") {
if ($val == 1) {
$fval = "Standby";
$retval = 1;
$outmsg = "WARNING";
} elsif ($val == 2) {
$fval = "On";
$retval = 0;
$outmsg = "OK";
}
} else {
if ($oids{$param}->{cdef}) {
$fval = eval "$oids{$param}->{cdef}";
} else {
$fval = $val;
}
if ($fval > $crit) {
$retval = 2;
$outmsg = "CRITICAL";
} elsif ($fval > $warn) {
$retval = 1;
$outmsg = "WARNING";
} else {
$retval = 0;
$outmsg = "OK";
}
}
}
print "$outmsg - " . $oids{$param}->{label} . " " .$fval . " " . $oids{$param}->{unit} . " | $param=$fval$oids{$param}->{unit}\n";
exit $retval;
sub usage {
print "Usage: $0 -H <hostip> -C <community> -p <parameter> -w <warnval> -c <critval> [-l] [-s sensor]\n";
print "\nParameters:\n";
print <<" EO";
APC NetBotz
nbmstemp NetBotz main sensor temp | nbmshum NetBotz main sensor humidity
nbmsairflow NetBotz main sensor airflow | nbmsaudio NetBotz main sensor audio
-l List connected sensors | -s sensor Sensor we want info from
APC Metered Rack PDU
rpduamps Amps on each phase
APC ACSC In-Row
acscstatus System status (on/standby) | acscload Cooling load
acscoutput Cooling output | acscsupair Supply air
acscairflow Air flow | acscracktemp Rack inlet temp
acsccondin Condenser input temp | acsccondout Condenser outlet temp
APC ACRC In-Row
acrcstatus System status (on/standby) | acrcload Cooling load
acrcoutput Cooling output | acrcairflow Air flow
acrcracktemp Rack inlet temp | acrcsupair Supply air
acrcretair Return air | acrcfanspeed Fan speed
acrcfluidflow Fluid flow | acrcflenttemp Fluid entering temp
acrcflrettemp Fluid return temp
EO
exit 3;
}
sub getmasked_values ($$) {
my ($baseoid, $values) = @_;
my ($session, $error) = Net::SNMP->session(
-hostname => $host,
-community => $comm,
-version => 1,
-port => "161"
);
my $response = $session->get_table(-baseoid => $baseoid);
my $err = $session->error;
if ($err){
$retval = 3;
$outmsg = "UNKNOWN";
$session->close();
print "$err - SNMP Error connecting to $host\n";
exit $retval;
}
my %snmpdata;
foreach my $k (keys %{$response}) {
my ($type, $id) = (split(/\./, $k))[-2,-1];
if ($values->{$type}) {
$snmpdata{$id}->{$values->{$type}} = $response->{$k};
}
}
return \%snmpdata;
}

View File

@@ -1,562 +0,0 @@
#!/usr/bin/perl
# Copyright (C) 2004 Altinity Limited
# E: info@altinity.com W: http://www.altinity.com/
#
# Edited by Roderick Derks (roderick@r71.nl)
# I changed the output of this plugin so it can bu used with Nagiosgrapher
# to create nice graphs (output is in hours is changed to minutes).
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Adjusted by Roderick Derks (roderick@r71.nl)
# Output of snmp query for remaing battery runtime is in minutes or in hours. This
# is a problem when you want to create some nice graphs because of the different
# output. Now hours are converted to minutes.
#
use Net::SNMP;
use Getopt::Std;
$script = "check_snmp_apcups";
$script_version = "2.1.0";
$metric = 1;
$ipaddress = "192.168.1.1"; # default IP address, if none supplied
$version = "1"; # SNMP version
$timeout = 2; # SNMP query timeout
# $warning = 100;
# $critical = 150;
$status = 0;
$returnstring = "";
$community = "public"; # Default community string
# .1.3.6.1.4.1.
# enterprises.318.1.1.1.1.1.1.0 = STRING: "SMART-UPS 1000" upsIdent
# enterprises.318.1.1.1.2.2.1.0 Battery capacity (%)
# enterprises.318.1.1.1.2.2.2.0 Temperature (Celcius)
# enterprises.318.1.1.1.2.2.3.0 Battery runtime remaining
# enterprises.318.1.1.1.2.2.4.0 Battery replace indicator (1=ok, 2=replace)
# enterprises.318.1.1.1.2.2.5.0 Number of battery packs
# enterprises.318.1.1.1.2.2.6.0 Number of bad battery packs
# enterprises.318.1.1.1.3.2.1.0 Input voltage
# enterprises.318.1.1.1.3.2.4.0 Input frequency
# enterprises.318.1.1.1.3.2.5.0 Reason for last transfer to UPS battery power:
# enterprises.318.1.1.1.4.2.1.0 Output voltage
# enterprises.318.1.1.1.4.2.2.0 Output frequency
# enterprises.318.1.1.1.4.2.3.0 Output load as % of capacity
# enterprises.318.1.1.1.4.2.4.0 Output current in ampheres
# enterprises.318.1.1.1.4.2.1.0 Configured voltage
# enterprises.318.1.1.1.8.1.0 Whether agent is communicating with UPS (1)
$oid_upstype = ".1.3.6.1.4.1.318.1.1.1.1.1.1.0";
$oid_battery_capacity = ".1.3.6.1.4.1.318.1.1.1.2.2.1.0";
$oid_battery_temperature = ".1.3.6.1.4.1.318.1.1.1.2.2.2.0";
$oid_battery_runtimeremain = ".1.3.6.1.4.1.318.1.1.1.2.2.3.0";
$oid_battery_replace = ".1.3.6.1.4.1.318.1.1.1.2.2.4.0";
$oid_input_voltage = ".1.3.6.1.4.1.318.1.1.1.3.2.1.0";
$oid_input_frequency = ".1.3.6.1.4.1.318.1.1.1.3.2.4.0";
$oid_input_reasonforlasttransfer = ".1.3.6.1.4.1.318.1.1.1.3.2.5.0";
$oid_output_voltage = ".1.3.6.1.4.1.318.1.1.1.4.2.1.0";
$oid_output_frequency = ".1.3.6.1.4.1.318.1.1.1.4.2.2.0";
$oid_output_load = ".1.3.6.1.4.1.318.1.1.1.4.2.3.0";
$oid_output_current = ".1.3.6.1.4.1.318.1.1.1.4.2.4.0";
$oid_output_configuredvoltage = ".1.3.6.1.4.1.318.1.1.1.4.2.1.0";
$oid_comms = ".1.3.6.1.4.1.318.1.1.1.8.1.0";
$oid_test_result = ".1.3.6.1.4.1.318.1.1.1.7.2.3.0";
$oid_test_date = ".1.3.6.1.4.1.318.1.1.1.7.2.4.0";
$oid_sysDescr = ".1.3.6.1.2.1.1.1.0";
$upstype = "";
$battery_capacity = 0;
$battery_temperature = 0;
$battery_runtimeremain = 0;
$battery_replace = "";
$input_voltage = 0;
$input_frequency = 0;
$input_reasonforlasttransfer = "";
$output_voltage = 0;
$output_frequency = 0;
$output_load = 0;
$output_current = 0;
$output_configuredvoltage = 0;
$outagecause = "";
$test_result = "";
$test_date = "";
# Do we have enough information?
if (@ARGV < 1) {
print "Too few arguments\n";
usage();
}
getopts("h:H:C:w:c:");
if ($opt_h){
usage();
exit(0);
}
if ($opt_H){
$hostname = $opt_H;
}
else {
print "No hostname specified\n";
usage();
}
if ($opt_C){
$community = $opt_C;
}
else {
}
# Create the SNMP session
my ($s, $e) = Net::SNMP->session(
-community => $community,
-hostname => $hostname,
-version => $version,
-timeout => $timeout,
);
main();
# Close the session
$s->close();
if ($returnstring eq ""){
$status = 3;
}
if ($status == 0){
print "Status is OK - $returnstring\n";
# print "$returnstring\n";
}
elsif ($status == 1){
print "Status is a WARNING level - $returnstring\n";
}
elsif ($status == 2){
print "Status is CRITICAL - $returnstring\n";
}
else{
print "Problem with plugin. No response from SNMP agent.\n";
}
exit $status;
####################################################################
# This is where we gather data via SNMP and return results #
####################################################################
sub main {
#######################################################
if (!defined($s->get_request($oid_comms))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$temp = $s->var_bind_list()->{$_};
}
if ($temp eq "1"){
}
else {
append("SNMP agent not communicating with UPS");
$status = 2;
return 1;
}
#######################################################
if (!defined($s->get_request($oid_upstype))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$upstype = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_battery_capacity))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$battery_capacity = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_battery_temperature))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$battery_temperature = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_battery_runtimeremain))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$battery_runtimeremain = $s->var_bind_list()->{$_};
}
# RRD if output is in hours, change it to minutes so we can make a nice graph
if ( $battery_runtimeremain =~ "hour" ) {
$battery_runtimeremain2 = "$battery_runtimeremain";
$battery_runtimeremain =~s/hour.*//g;
$battery_runtimeremain = $battery_runtimeremain*60;
$battery_runtimeremain = "$battery_runtimeremain minutes";
}
#######################################################
if (!defined($s->get_request($oid_battery_replace))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$battery_replace = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_input_voltage))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$input_voltage = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_input_frequency))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$input_frequency = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_input_reasonforlasttransfer))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$input_reasonforlasttransfer = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_output_voltage))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$output_voltage = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_output_frequency))) {
if (!defined($s->get_request($oid_sysDescr))) { $returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$output_frequency = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_output_load))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$output_load = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_test_result))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$test_result = $s->var_bind_list()->{$_};
}
#######################################################
if (!defined($s->get_request($oid_test_date))) {
if (!defined($s->get_request($oid_sysDescr))) {
$returnstring = "SNMP agent not responding";
$status = 1;
return 1;
}
else {
$returnstring = "SNMP OID does not exist";
$status = 1;
return 1;
}
}
foreach ($s->var_bind_names()) {
$test_date = $s->var_bind_list()->{$_};
}
#######################################################
$issue = "";
if ($input_reasonforlasttransfer eq "1"){
$outagecause = "No events"
}
elsif ($input_reasonforlasttransfer eq "2"){
$outagecause = "High line voltage"
}
elsif ($input_reasonforlasttransfer eq "3"){
$outagecause = "Brownout"
}
elsif ($input_reasonforlasttransfer eq "4"){
$outagecause = "Loss of mains power"
}
elsif ($input_reasonforlasttransfer eq "5"){
$outagecause = "Small temporary power drop"
}
elsif ($input_reasonforlasttransfer eq "6"){
$outagecause = "Large temporary power drop"
}
elsif ($input_reasonforlasttransfer eq "7"){
$outagecause = "Small spike"
}
elsif ($input_reasonforlasttransfer eq "8"){
$outagecause = "Large spike"
}
elsif ($input_reasonforlasttransfer eq "9"){
$outagecause = "UPS self test"
}
elsif ($input_reasonforlasttransfer eq "10"){
$outagecause = "Excessive input voltage fluctuation"
}
else {
$outagecause = "Cannot establish reason"
}
if ($test_result eq "1") {
$test_result_string = "Passed";
}
elsif ($test_result eq "2") {
$test_result_string = "Failed";
}
elsif ($test_result eq "4") {
$test_result_string = "In Progress";
}
else {
$test_result_string = "Unknown";
}
if ($battery_capacity < 50) {
$issue = $issue . "BATTERY CAPACITY WARNING! ";
$status = 1;
}
if ($output_load > 80) {
$status = 1;
$issue = $issue . "OUTPUT LOAD WARNING! ";
}
if ($test_result eq "2") {
$issue = $issue . "SELF TEST FAILED! ";
$status = 1;
}
if ($input_voltage < 1){
$status = 2;
$issue = $issue . "RUNNING ON BATTERY! ";
}
if ($battery_capacity < 25) {
$issue = $issue . "BATTERY RUNNING LOW! ";
$status = 2;
}
if ($output_load > 90) {
$issue = $issue . "HIGH OUTPUT LOAD! ";
$status = 2;
}
if ($battery_replace eq "2") {
$issue = $issue . "REPLACE BATTERY! ";
$status = 2;
}
# Modified by Pall Sigurdsson <palli@opensource.is> to add some perfdata
# Modified 2010-06-03
my $perfdata="| 'battery_capacity'=$battery_capacity% 'temperature'=$battery_temperature 'input_voltage'=$input_voltage input_frequency=$input_frequency output_voltage=$output_voltage output_frequency=$output_frequency output_load=$output_load%";
if ($status == 0){
$temp = sprintf "$upstype - BATTERY:(capacity $battery_capacity%%, temperature $battery_temperature C, runtime $battery_runtimeremain) INPUT:(voltage $input_voltage V, frequency $input_frequency Hz) OUTPUT:(voltage $output_voltage V, frequency $output_frequency Hz, load $output_load%%) SELF TEST:($test_result_string on $test_date) LAST EVENT:($outagecause) $perfdata";
}
else {
$temp = sprintf "$issue - $upstype - BATTERY:(capacity $battery_capacity%%, temperature $battery_temperature C, runtime $battery_runtimeremain) INPUT:(voltage $input_voltage V, frequency $input_frequency Hz) OUTPUT:(voltage $output_voltage V, frequency $output_frequency Hz, load $output_load%%) LAST EVENT:$outagecause $perfdata ";
}
append($temp);
}
####################################################################
# help and usage information #
####################################################################
sub usage {
print << "USAGE";
-----------------------------------------------------------------
$script v$script_version
Monitors APC SmartUPS via AP9617 SNMP management card.
Usage: $script -H <hostname> -c <community> [...]
Options: -H Hostname or IP address
-C Community (default is public)
-----------------------------------------------------------------
Copyright 2004 Altinity Limited
This program is free software; you can redistribute it or modify
it under the terms of the GNU General Public License
-----------------------------------------------------------------
USAGE
exit 1;
}
####################################################################
# Appends string to existing $returnstring #
####################################################################
sub append {
my $appendstring = @_[0];
$returnstring = "$returnstring$appendstring";
}

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check SMTP blacklists
Name: nagios-okplugin-mailblacklist
Version: 0.0.1
Version: 0.0.2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -12,6 +12,7 @@ Requires: nagios-plugins
Requires: nagios-plugins-perl
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description
@@ -37,5 +38,8 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.2-1
- new package built with tito
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1
- Initial packaging

View File

@@ -1,160 +0,0 @@
#!/usr/bin/perl -w
#
# check_bl plugin for nagios
# $Revision: 1.0 $
#
# Nagios plugin designed to warn you if you mail servers appear in one of the
# many anti-spam 'blacklists'
#
# By Sam Bashton, Bashton Ltd
# bashton.com/content/nagios-plugins
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
use strict;
use lib "/usr/lib/nagios/plugins";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use Net::DNS;
use vars qw($PROGNAME);
my ($verbose,$host),;
my ($opt_V,$opt_h,$opt_B,$opt_H,$opt_c);
$opt_V = $opt_h = $opt_B = $opt_H = $opt_c = '';
my $state = 'UNKNOWN';
sub print_help();
sub print_usage();
$PROGNAME = "check_bl";
$ENV{'BASH_ENV'}='';
$ENV{'ENV'}='';
$ENV{'PATH'}='';
$ENV{'LC_ALL'}='C';
use Getopt::Long;
Getopt::Long::Configure('bundling');
GetOptions(
"V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h,
"H=s" => \$opt_H, "hostname=s" => \$opt_H,
"B=s" => \$opt_B, "blacklists=s" => \$opt_B,
"c=s" => \$opt_c, "critical=s" => \$opt_c
);
# -h means display verbose help screen
if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }
# -V means display version number
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.0 $ ');
exit $ERRORS{'OK'};
}
# First check the hostname is OK..
unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; }
if (! utils::is_hostname($opt_H)){
print "$opt_H is not a valid host name\n";
print_usage();
exit $ERRORS{"UNKNOWN"};
}else{
if ($opt_H =~ /[a-zA-Z]/ )
# If the host contains letters we assume it's a hostname, not an IP
{
$host = lookup($opt_H);
}
else { $host = $opt_H }
}
# $opt_c is a count of the blacklists a mail server is in,
# after which state will be CRITICAL rather than WARNING
# By default any listing is CRITICAL
my $critcount = 0;
if ($opt_c) { $critcount = $opt_c };
# $opt_B is a comma seperated list of blacklists
$opt_B = shift unless ($opt_B);
unless ($opt_B) { print_usage(); exit -1 }
my @bls = split(/,/, $opt_B);
# Just in case of problems, let's not hang Nagios
$SIG{'ALRM'} = sub {
print ("ERROR: No response from BL server (alarm)\n");
exit $ERRORS{"UNKNOWN"};
};
alarm($TIMEOUT);
my %listed; # Hash of blacklists we're listed in.
foreach(@bls)
{
if (blcheck($host,$_)) { $listed{$_} = 1 }
}
if (scalar(keys(%listed)) == 0) { $state = 'OK' }
elsif (scalar(keys(%listed)) < $critcount) { $state = 'WARNING' }
else { $state = 'CRITICAL' }
if (%listed)
{
print "Listed at";
foreach (keys(%listed)) { print " $_" }
print "\n";
}
else { print "Not black-listed\n" }
exit $ERRORS{$state};
######## Subroutines ==========================
sub print_help() {
print_revision($PROGNAME,'$Revision: 1.0 $ ');
print "\n";
support();
}
sub print_usage () {
print "Usage: \n";
print " $PROGNAME -H host -B [blacklist1],[blacklist2] [-c critnum]\n";
print " $PROGNAME [-h | --help]\n";
print " $PROGNAME [-V | --version]\n";
}
sub blcheck
{
my ($ip, $bl) = @_;
my $lookupip = $ip;
$lookupip =~
s/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/$4.$3.$2.$1.$bl/;
if (lookup($lookupip)) { return 1 }
else { return 0 }
}
sub lookup
{
my $tolookup = shift;
my $res = Net::DNS::Resolver->new;
my $query = $res->search($tolookup);
if ($query)
{
foreach my $rr ($query->answer)
{
next unless $rr->type eq "A"; # We're not interested in TXT records
return $rr->address;
}
}
}

View File

@@ -1,44 +0,0 @@
Nagios check_bl plugin (C)Copyright 2005 Bashton Ltd
----------------------------------------------------
A Nagios plugin to check whether a server is in any known anti-spam
blocklists. Licensed under the GNU GPL v2.0 or later (at your option). For
full copyright and warranty details, please see the COPYING file included in
this package.
By Sam Bashton, Bashton Ltd - sam@bashton.com www.bashton.com
Comments, bug reports etc are welcome.
Pre-Requisites
--------------
- Working Nagios install
- Perl 5 (tested with Perl 5.6.1 and 5.8)
- Net::DNS Perl library and associated dependencies
Installation
------------
- Copy to your nagios plugins directory (possibly /usr/lib/nagios/plugins)
- Add the following to your checkcommands.cfg:
define command{
command_name check_bl
command_line $USER1$/check_bl -H $HOSTADDRESS$ -B sbl-xbl.spamhaus.or
g,bl.spamcop.net,t1.dnsbl.net.au
}
- Alter your services.cfg to include a check against the check_bl command
Variables
---------
check_bl requires the following variables:
-H host : Hostname to check
-B blacklist1,blacklist2 : Comma separated list of blacklists to check against
The following optional variable is also available:
-c critnum : Number of blacklists the server must be listed in before the status is 'critical'. By default, any listing is regarded as critical.

View File

@@ -1,41 +0,0 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check SMTP blacklists
Name: nagios-okplugin-mailblacklist
Version: 0.0.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-MailBlacklist
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_bl/releases/%{name}-%{version}.tar.gz
Requires: nagios-plugins
Requires: nagios-plugins-perl
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
%description
Checks DNS Blacklists for existance of hosts
%prep
%setup -q
perl -pi -e "s|/usr/lib|%{_libdir}|g" check_bl
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_bl %{buildroot}%{_libdir}/nagios/plugins/check_bl
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1
- Initial packaging

View File

@@ -2,8 +2,8 @@
Summary: A Nagios plugin to check network bond devices
Name: nagios-okplugin-bond
Version: 0.0.1
Release: 2%{?dist}
Version: 0.0.2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-Bond
@@ -40,6 +40,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.2-1
- new package built with tito
* Sun Oct 16 2011 Tomas Edwardsson <tommi@opensource.is> 0.1-2
- Added configuration into package

View File

@@ -1,125 +0,0 @@
#!/usr/bin/python
# Copyright 2010, Tomas Edwardsson
#
# check_bond.py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# check_bond.py is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pprint
import re
import sys
import getopt
def readbond( interface ):
intfile = "/proc/net/bonding/%s" % interface
# Read interface info
try:
bondfh = open (intfile, 'r')
except IOError, (errno, strerror):
print "Unable to open bond %s: %s" % (intfile, strerror)
sys.exit(3)
except:
print "Unexpected error:", sys.exc_info()[0]
sys.exit(3)
# Initialize bond data
bond = {}
bond['slaves'] = []
# Which interface are we working with
current_int = ''
# Loop throught the file contents
for line in bondfh.readlines():
# Remove newlines and split on colon, ignore other
try:
k, v = line.replace('\n', '').split(': ', 1)
except:
pass
# Remove leading whitespaces
k = re.sub('^\s*', '', k)
# Bonding mode for the channel
if k == "Bonding Mode":
bond['bonding_mode'] = v
# Record current slave interface
elif k == "Slave Interface":
current_int = v
# Slave interface mii status
elif current_int and k == "MII Status":
bond['slaves'].append( { 'int' : current_int, 'mii_status' : v })
# Bond mii status
elif k == "MII Status":
bond['mii_status'] = v
return bond
def usage():
print "Usage: %s -i bond0" % sys.argv[0]
sys.exit(3)
def main(argv):
# Set variables
interface = ''
outstring = ''
retval = 0
# Nagios return code states
states = { 0 : 'OK', 1 : 'Warning', 2 : 'Critical', 3 : 'Unknown' }
# Try to read the arguments
try:
opts, args = getopt.getopt(argv, "hi:", ["help", "interface="])
except getopt.GetoptError:
usage()
sys.exit(3)
for opt, arg in opts:
if opt in ("-h", "--help"):
usage()
sys.exit(3)
elif opt in ("-i", "--interface"):
interface = arg
if (interface == ""):
usage()
sys.exit(3)
bond = readbond(interface)
# The whole bond is down
if bond['mii_status'] != 'up':
print "Critical: bonding device %s %s" % (interface, bond['mii_status'])
sys.exit(2)
# Some interface in the bond is down
for slave in bond['slaves']:
if slave['mii_status'] != 'up':
outstring = "%s%s down " % (outstring, slave['int'])
if retval < 1:
retval = 1
if retval:
print "%s: %s%s %s" % (states[retval], outstring, "in bonding device", interface)
sys.exit(retval)
print "OK: bonding device %s up and running" % interface
sys.exit(0)
if __name__ == "__main__":
main(sys.argv[1:])

View File

@@ -1,39 +0,0 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check network bond devices
Name: nagios-okplugin-bond
Version: 0.0.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-Bond
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_bond/releases/%{name}-%{version}.tar.gz
Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
%description
Checks the network bond device on a Linux machine
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_bond %{buildroot}%{_libdir}/nagios/plugins/check_bond
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1
- Initial packaging

View File

@@ -1,3 +0,0 @@
check_bond
Simple Nagios plugin that checks the status of bond devices

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check Brocade devices
Name: nagios-okplugin-brocade
Version: 0.0.3
Version: 0.0.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -36,5 +36,8 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- new package built with tito
* Mon Nov 21 2010 Tomas Edwardsson <tommi@ok.is> 0.0.3-1
- Initial packaging

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check CIFS shares
Name: nagios-okplugin-cifs
Version: 0.0.3
Version: 0.0.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -12,6 +12,7 @@ Requires: perl-Nagios-Plugin
Requires: samba-client, krb5-workstation
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description
@@ -38,5 +39,8 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/*
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- new package built with tito
* Mon Nov 21 2010 Tomas Edwardsson <tommi@ok.is> 0.0.3-1
- Initial packaging

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check CPU on Linux servers
Name: nagios-plugins-check_cpu
Version: 0.2
Version: 1.0
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -11,6 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_cpu/releases/
Requires: nrpe
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description
This shell script checks cpu utilization (user,system,iowait,idle in %)
@@ -41,6 +42,13 @@ rm -rf %{buildroot}
%changelog
* Thu Aug 23 2012 Pall Sigurdsson <palli@opensource.is> 1.0-1
- Version number bumped
- Updates buildarch to noarch (tommi@tommi.org)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.3-1
- new package built with tito
* Thu Nov 25 2010 Pall Sigurdsson <palli@opensource.is> 0.1-2
- Nrpe config now ships with plugin by default
* Mon Mar 1 2010 Tomas Edwardsson <tommi@ok.is> 0.1-1

View File

@@ -2,7 +2,7 @@
Summary: Nagios Plugins to monitor HP Dataprotector
Name: nagios-okplugin-check_dataprotector
Version: AUTOVERSION
Version: 1.0.1
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -45,5 +45,8 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_dataprotector.cfg
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito
* Mon Sep 15 2010 Pall Sigurdsson <palli@opensource.is> 0.1-1
- Initial packaging

View File

@@ -207,16 +207,17 @@ if($opt_H ne "localhost" and $opt_H ne "127.0.0.1") {
# Envoi commande et renseignement Hashage %disks
my @output = `$cmd`;
my $ret = $?;
$ret >>= 8;
if ($ret == -1) {
print "Could not find " . (split(' ', $cmd))[0] . "\n";
exit $EXIT_CODES{'UNKNOWN'};
}
$ret >>= 8;
# 2010/02/25 palli@ok.is : Check if $cmd ran successfully
if ($ret > 0) {
if ($ret > 1) {
print "Failed to execute $cmd: " . join("\n", @output) . "\n";
exit $EXIT_CODES{'UNKNOWN'} ;
}

View File

@@ -2,8 +2,8 @@
Summary: A Nagios plugin to check disks via NRPE
Name: nagios-okplugin-check_disks
Version: AUTOVERSION
Release: 2%{?dist}
Version: 1.0.3
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_disks
@@ -40,6 +40,16 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/check_disks.pl
%changelog
* Wed May 16 2012 Tomas Edwardsson <tommi@tommi.org> 1.0.3-1
- Updated version of nagios-okplugin-check_disks (tommi@tommi.org)
- Issue #56, temporary fix for selinux and disk checks (tommi@tommi.org)
* Mon May 16 2012 Tomas Edwardsson <tommi@opensource.is> 1.0.2-1
- Ignore warning states from nrpe
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito
* Sun Oct 16 2011 Tomas Edwardsson <tommi@opensource.is> 0.1-2
- Fixed dependencies and build arch

View File

@@ -0,0 +1,59 @@
%define debug_package %{nil}
%define plugin_name check_drbd
Summary: A Nagios plugin to check Linux Devicemapper Multipathing
Name: nagios-okplugin-%{plugin_name}
Version: 0.0.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/%{plugin_name}
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/%{plugin_name}/releases/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
%description
%{summary}
%prep
%setup -q
perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/%{plugin_name}.cfg
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_drbd %{buildroot}%{_libdir}/nagios/plugins/check_drbd
install -D -p -m 0755 nrpe.d/%{plugin_name}.cfg %{buildroot}/etc/nrpe.d/%{plugin_name}.cfg
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
#%doc README LICENSE
%{_libdir}/nagios/plugins/*
/etc/nrpe.d/%{plugin_name}.cfg
%changelog
* Wed Mar 14 2012 Pall Sigurdsson <palli@opensource.is> 0.0.4-1
- licence and readme removed from specfile (palli@opensource.is)
* Wed Mar 14 2012 Pall Sigurdsson <palli@opensource.is>
- licence and readme removed from specfile (palli@opensource.is)
* Wed Mar 14 2012 Pall Sigurdsson <palli@opensource.is>
- licence and readme removed from specfile (palli@opensource.is)
* Wed Mar 14 2012 Pall Sigurdsson <palli@opensource.is>
- licence and readme removed from specfile (palli@opensource.is)
* Wed Mar 14 2012 Pall Sigurdsson <palli@opensource.is> 0.0.3-1
- new package built with tito
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.2-1
- new package built with tito

View File

@@ -288,7 +288,7 @@ sub check_disk {
}
close (NAVICLIOUT);
if ($disk_ok_count eq 0) {
print "No disk were founded !\n";
print "No disk were found !\n";
$state = 'UNKNOWN';
} elsif ($crit_count > 0) {
$state='CRITICAL';

View File

@@ -207,7 +207,7 @@ def run_sssu(system=None, command="ls system full"):
commands.append(command)
commandstring = "sssu "
for i in commands: commandstring = commandstring + "'%s' " % i
for i in commands: commandstring = commandstring + '"%s" ' % i
global server_side_troubleshooting
if server_side_troubleshooting == True:
commandstring = 'cat "debug/%s"' % command

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check HP EVA Disk Systems
Name: nagios-okplugin-check_eva
Version: AUTOVERSION
Version: 1.0.2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -40,5 +40,12 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_eva.cfg
%changelog
* 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)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 1.0.1-1
- new package built with tito
* Mon Mar 1 2010 Pall Sigurdsson <palli@opensource.is> 0.1-1
- Initial packaging

View File

@@ -2,7 +2,7 @@
Summary: A Nagios plugin to check HP Array with hpacucli
Name: nagios-okplugin-check_hpacucli
Version: 0.0.2
Version: 0.0.3
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@@ -38,5 +38,8 @@ rm -rf %{buildroot}
/etc/nrpe.d/check_hpacucli.cfg
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.3-1
- new package built with tito
* Mon Mar 1 2010 Pall Sigurdsson <palli@opensource.is> 0.1-1
- Initial packaging

View File

@@ -0,0 +1,2 @@
command[check_hpacucli]=sudo /usr/lib/nagios/plugins/check_hpacucli.py

View File

@@ -1,2 +0,0 @@
command[check_hpacucli]=/usr/lib/nagios/plugins/check_hpacucli.py

View File

@@ -22,7 +22,7 @@
# No real need to change anything below here
version="1.0"
version="1.1.0"
ok=0
warning=1
critical=2
@@ -226,20 +226,24 @@ def check_powermodules():
status = 3
details = 4
num_ok = 0
num_no = 0
for i in powermodules.values():
myIndex = i[index]
myStatus = i[status]
myDetails = i[details]
myExists = i[exists]
if myIndex == opts.exclude: continue
if myStatus != "1":
nagios_status(warning)
add_summary( 'Powermodule "%s" status "%s". %s. ' % (myIndex,myStatus,myDetails) )
if myExists == "0":
num_no = num_no + 1
else:
num_ok = num_ok + 1
if myStatus != "1":
nagios_status(warning)
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) ) )
add_perfdata( "'Number of powermodules'=%s" % (len(powermodules) - num_no ) )
nagios_status(ok)
@@ -267,10 +271,12 @@ def check_switchmodules():
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):
myExtraInfo = extrainfo[int(myIndex)-1]
module_type = myExtraInfo[22]
module_ip = myExtraInfo[6]
add_long( " type=%s ip=%s" % (module_type,module_ip) )
try:
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
if exit_status == ok:
add_summary("All switchmodules healthy")
@@ -300,7 +306,7 @@ def check_blowers():
# Check blower 2
if blower2state == "1":
nagios_status(ok)
add_summary("Blower1 OK. " )
add_summary("Blower2 OK. " )
else:
add_summary("Blower2 NOT OK. ")
nagios_status(warning)

View File

@@ -0,0 +1,45 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check IBM Bladecenters
Name: nagios-okplugin-check_ibm_bladecenter
Version: 1.1.2
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/Nagios-OKPlugin-check_ibm_bladecenter
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_ibm_bladecenter/releases/%{name}-%{version}.tar.gz
Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
BuildArch: noarch
Requires: nrpe
%description
Checks the health status of an IBM Bladecenter via SNMP
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_ibm_bladecenter.py %{buildroot}%{_libdir}/nagios/plugins/check_ibm_bladecenter.py
#mkdir -p %{buildroot}%{_sysconfdir}/nrpe.d
#sed "s^/usr/lib64^%{_libdir}^g" nrpe.d/check_bond.cfg > %{buildroot}%{_sysconfdir}/nrpe.d/check_bond.cfg
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README
%{_libdir}/nagios/plugins/*
#%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Tue Jul 17 2012 Pall Sigurdsson 1.0.0-1
- Initial packaging

View File

@@ -0,0 +1,48 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check Cisco Ironport
Name: nagios-okplugin-check_ironport
Version: 1.1.4
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.ok.is/trac/wiki/
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_ironport/releases/%{name}-%{version}.tar.gz
Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
BuildArch: noarch
Requires: nrpe
%description
Checks the health status of a Cisco Ironport
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_ironport.py %{buildroot}%{_libdir}/nagios/plugins/check_ironport.py
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/nagios/plugins/*
#%config(noreplace) %{_sysconfdir}/nrpe.d/check_bond.cfg
%changelog
* Tue Jul 31 2012 Pall Sigurdsson <palli@opensource.is> 1.1.4-1
- initial packaging for nagios-okplugin-check_ironport (palli@opensource.is)
* Tue Jul 31 2012 Pall Sigurdsson <palli@opensource.is> 1.1.3-1
- new package built with tito
* Tue Jul 31 2012 Pall Sigurdsson 1.0.0-1
- Initial packaging

View File

@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -278,3 +278,64 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,54 @@
%define debug_package %{nil}
Summary: A Nagios plugins to check if a specific linux module exists
Name: nagios-okplugin-check_linux_modules
Version: 0.0.13
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_smssend
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
%description
A Nagios plugins to check if a specific linux module exists
%prep
%setup -q
perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/check_module.cfg
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_linux_modules.pl %{buildroot}%{_libdir}/nagios/plugins/check_linux_modules.pl
install -D -p -m 0755 nrpe.d/check_module.cfg %{buildroot}/etc/nrpe.d/check_module.cfg
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc LICENSE
%{_libdir}/nagios/plugins/*
/etc/nrpe.d/check_module.cfg
%changelog
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.13-1
- typo in plugin name fixed (palli@opensource.is)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.12-1
- new package built with tito
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.11-1
- license added (palli@opensource.is)
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.10-1
-
* Mon Mar 12 2012 Pall Sigurdsson <palli@opensource.is> 0.0.9-1
- new package built with tito

Some files were not shown because too many files have changed in this diff Show More