Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37569063
en ru br
Репозитории ALT
S:2.2.1-alt1
5.1: 1.4.13-alt2.1
4.1: 1.4.12-alt1.M41.1
4.0: 1.4.5-alt1.1
3.0: 1.4-alt1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: nagios-plugins

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: nagios-plugins-0005-Patch-for-check_linux_raid-with-on-linear-raid0-arra.patch
Скачать


From e84e5e6caafb1ac02cb8a4a7b18a2d8eebf298b2 Mon Sep 17 00:00:00 2001
From: Thomas Guyot-Sionnest <dermoth@aei.ca>
Date: Tue, 5 Oct 2010 23:19:03 -0400
Subject: [PATCH 5/6] Patch for check_linux_raid with on linear/raid0 arrays
Fixes bug #3049988, Debian bug #579049
---
 contrib/check_linux_raid.pl |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/contrib/check_linux_raid.pl b/contrib/check_linux_raid.pl
index 1647b8b..3a15ac8 100644
--- a/contrib/check_linux_raid.pl
+++ b/contrib/check_linux_raid.pl
@@ -71,7 +71,8 @@ while(defined $nextdev){
 		} elsif (/^($nextdev)\s*:/) {
 			$device=$1;
 			$devices{$device}=$device;
-			if (/active/) {
+			if (/\sactive/) {
+				$status{$device} = ''; # Shall be filled later if available
 				$active{$device} = 1;
 			}
 		}
@@ -80,7 +81,11 @@ while(defined $nextdev){
 }
 
 foreach my $k (sort keys %devices){
-	if ($status{$k} =~ /_/) {
+	if (!exists($status{$k})) {
+		$msg .= sprintf " %s inactive with no status information.",
+			$devices{$k};
+		$code = max_state($code, "CRITICAL");
+	} elsif ($status{$k} =~ /_/) {
 		if (defined $recovery{$k}) {
 			$msg .= sprintf " %s status=%s, recovery=%s, finish=%s.",
 				$devices{$k}, $status{$k}, $recovery{$k}, $finish{$k};
@@ -94,10 +99,11 @@ foreach my $k (sort keys %devices){
 		$code = max_state($code, "OK");
 	} else {
 		if ($active{$k}) {
-			$msg .= sprintf " %s active with no status information.\n",
+			$msg .= sprintf " %s active with no status information.",
 				$devices{$k};
 			$code = max_state($code, "OK");
 		} else {
+			# This should't run anymore, but is left as a catch-all
 			$msg .= sprintf " %s does not exist.\n", $devices{$k};
 			$code = max_state($code, "CRITICAL");
 		}
-- 
1.7.2.3
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin