Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Nov 2005 17:32:48 +0300
From:      Deomid Ryabkov <myself@rojer.pp.ru>
To:        freebsd-scsi@freebsd.org
Subject:   PATCH: simple monitoring solution for LSI 1030-base RAID arrays
Message-ID:  <436A1F90.3000909@rojer.pp.ru>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000000010702090402000707
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

(I have previously sent this to Justin Gibbs directly, but got no 
response. Maybe someone else can take a look at this).

This small patch adds an OID that makes RAID monitoring much easier:
current number of volumes with State != MPI_RAIDVOL0_STATUS_STATE_OPTIMAL.
0 under normal conditions, > 0 if "something is wrong".
Having such a flag, it is essentially enough to just poll this OID 
regularly and send out a notification.

--
Deomid Ryabkov aka Rojer
myself@rojer.pp.ru
rojer@sysadmins.ru
ICQ: 8025844


--------------000000010702090402000707
Content-Type: text/x-patch;
 name="mpt_nonoptimal_volumes.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mpt_nonoptimal_volumes.patch"

diff -ur /sys/dev/mpt.orig/mpt.h /sys/dev/mpt/mpt.h
--- /sys/dev/mpt.orig/mpt.h	Sun Jul 10 19:05:38 2005
+++ /sys/dev/mpt/mpt.h	Tue Oct 18 14:40:24 2005
@@ -450,6 +450,7 @@
 	u_int			raid_resync_rate;
 	u_int			raid_mwce_setting;
 	u_int			raid_queue_depth;
+	u_int			raid_nonopt_volumes;
 	struct proc	       *raid_thread;
 	struct callout		raid_timer;
 
diff -ur /sys/dev/mpt.orig/mpt_raid.c /sys/dev/mpt/mpt_raid.c
--- /sys/dev/mpt.orig/mpt_raid.c	Sun Jul 10 19:05:38 2005
+++ /sys/dev/mpt/mpt_raid.c	Tue Oct 18 14:40:19 2005
@@ -1226,6 +1226,7 @@
 	size_t len;
 	int rv;
 	int i;
+	u_int nonopt_volumes = 0;
 
 	if (mpt->ioc_page2 == NULL || mpt->ioc_page3 == NULL)
 		return;
@@ -1329,6 +1330,9 @@
 			mpt_vol->flags |= MPT_RVF_ANNOUNCED;
 		}
 
+		if (vol_pg->VolumeStatus.State != MPI_RAIDVOL0_STATUS_STATE_OPTIMAL)
+			nonopt_volumes++;
+
 		if ((mpt_vol->flags & MPT_RVF_UP2DATE) != 0)
 			continue;
 
@@ -1436,6 +1440,8 @@
 		}
 		mpt_prtc(mpt, " )\n");
 	}
+
+	mpt->raid_nonopt_volumes = nonopt_volumes;
 }
 
 static void
@@ -1671,4 +1677,8 @@
 			"vol_resync_rate", CTLTYPE_INT | CTLFLAG_RW, mpt, 0,
 			mpt_raid_sysctl_vol_resync_rate, "I",
 			"volume resync priority (0 == NC, 1 - 255)");
+	SYSCTL_ADD_INT( ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+			"nonoptimal_volumes", CTLFLAG_RD, &mpt->raid_nonopt_volumes, 0,
+			"number of nonoptimal volumes");
+
 }

--------------000000010702090402000707--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?436A1F90.3000909>