1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 02:13:44 +01:00
This commit is contained in:
Pall Sigurdsson 2012-05-11 13:33:07 +00:00
commit 27f4da23bf
8 changed files with 15 additions and 6 deletions

View File

@ -11,6 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_apcext.pl/rel
Requires: nagios-plugins Requires: nagios-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is> Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description %description

View File

@ -12,6 +12,7 @@ Requires: nagios-plugins
Requires: nagios-plugins-perl Requires: nagios-plugins-perl
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is> Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description %description

View File

@ -12,6 +12,7 @@ Requires: perl-Nagios-Plugin
Requires: samba-client, krb5-workstation Requires: samba-client, krb5-workstation
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is> Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description %description

View File

@ -11,6 +11,7 @@ Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_cpu/releases/
Requires: nrpe Requires: nrpe
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Tomas Edwardsson <tommi@ok.is> Packager: Tomas Edwardsson <tommi@ok.is>
BuildArch: noarch
%description %description
This shell script checks cpu utilization (user,system,iowait,idle in %) This shell script checks cpu utilization (user,system,iowait,idle in %)

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 # Envoi commande et renseignement Hashage %disks
my @output = `$cmd`; my @output = `$cmd`;
my $ret = $?; my $ret = $?;
$ret >>= 8;
if ($ret == -1) { if ($ret == -1) {
print "Could not find " . (split(' ', $cmd))[0] . "\n"; print "Could not find " . (split(' ', $cmd))[0] . "\n";
exit $EXIT_CODES{'UNKNOWN'}; exit $EXIT_CODES{'UNKNOWN'};
} }
$ret >>= 8;
# 2010/02/25 palli@ok.is : Check if $cmd ran successfully # 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"; print "Failed to execute $cmd: " . join("\n", @output) . "\n";
exit $EXIT_CODES{'UNKNOWN'} ; exit $EXIT_CODES{'UNKNOWN'} ;
} }

View File

@ -300,7 +300,7 @@ def check_blowers():
# Check blower 2 # Check blower 2
if blower2state == "1": if blower2state == "1":
nagios_status(ok) nagios_status(ok)
add_summary("Blower1 OK. " ) add_summary("Blower2 OK. " )
else: else:
add_summary("Blower2 NOT OK. ") add_summary("Blower2 NOT OK. ")
nagios_status(warning) nagios_status(warning)

View File

@ -6,6 +6,7 @@ MESSAGE="Nagios configuration is valid"
EXIT_CODE=3 EXIT_CODE=3
TMPFILE=`mktemp` TMPFILE=`mktemp`
trap "rm -f $TMPFILE" EXIT
nagios -v /etc/nagios/nagios.cfg > $TMPFILE nagios -v /etc/nagios/nagios.cfg > $TMPFILE
RESULT=$? RESULT=$?

View File

@ -120,9 +120,12 @@ def main():
usage() usage()
sys.exit() sys.exit()
clustatOutput = os.popen('/usr/sbin/clustat -fx') try:
dom = xml.dom.minidom.parse(clustatOutput) clustatOutput = os.popen('/usr/sbin/clustat -fx')
dom = xml.dom.minidom.parse(clustatOutput)
except Exception, e:
print "Error: could not parse output of : '/usr/sbin/clustat -fx': ", e
sys.exit(3)
if typeCheck == 'cluster': if typeCheck == 'cluster':
# First we query for the state of the cluster itself. # First we query for the state of the cluster itself.