1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-05 01:53:44 +01:00

Changed buildarch and allowed for both 32 and 64bit execution

This commit is contained in:
Tomas Edwardsson 2011-10-16 17:35:58 +00:00
parent 4ba1a8dd01
commit aaa9b2d55a
2 changed files with 19 additions and 5 deletions

View File

@ -131,6 +131,8 @@ use strict;
my ($opt_c, $opt_w, $opt_h, $opt_i,$opt_f,$opt_s,$opt_u,$opt_H,$opt_C,$opt_v,
$opt_html, $opt_srvperf, $opt_r, $opt_R);
$ENV{'PATH'} = "/usr/lib/nagios/plugins:/usr/lib64/nagios/plugins:/usr/local/libexec:/usr/libexec:/usr/local/nagios/libexec";
$opt_u = "nagios"; # Utilisateur pour connexion nrpe
$opt_i = "";
$opt_w = "10"; # Valeur par defaut de warning
@ -198,16 +200,24 @@ my $args;
#Si on est en local inutile de faire du nrpe
if($opt_H ne "localhost" and $opt_H ne "127.0.0.1") {
#$cmd = "ssh $opt_u\@$opt_H '$cmd'";
$cmd = "/usr/lib/nagios/plugins/check_nrpe -H $opt_H -c get_disks";
$cmd = "check_nrpe -H $opt_H -c get_disks";
#$cmd = "cat /tmp/df";
#print "$cmd";
}
# Envoi commande et renseignement Hashage %disks
my @output = `$cmd`;
my $ret = $?;
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 ($? > 0) {
print "Failed to execute $cmd : @output\n";
if ($ret > 0) {
print "Failed to execute $cmd: " . join("\n", @output) . "\n";
exit $EXIT_CODES{'UNKNOWN'} ;
}
#

View File

@ -3,14 +3,15 @@
Summary: A Nagios plugin to check disks via NRPE
Name: nagios-okplugin-check_disks
Version: AUTOVERSION
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://opensource.is/trac/wiki/check_disks
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_eva/releases/nagios-okplugin-check_disks-%{version}.tar.gz
Requires: nagios-plugins
Requires: nagios-plugins-nrpe
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Pall Sigurdsson <palli@opensource.is>
BuildArch: noarch
@ -39,5 +40,8 @@ rm -rf %{buildroot}
%{_libdir}/nagios/plugins/check_disks.pl
%changelog
* Sun Oct 16 2011 Tomas Edwardsson <tommi@opensource.is> 0.1-2
- Fixed dependencies and build arch
* Mon Mar 1 2010 Pall Sigurdsson <palli@opensource.is> 0.1-1
- Initial packaging