Discussion:
[PATCH 0/3] Fixes for MegaRAID disks.
Gris Ge
2015-10-27 06:18:30 UTC
Permalink
Three fixes for MegaRAID plugin on disk querying:

* Remove check on 'Other Error Count' which is not documented and incorrect on
disk status.
* Fix incorrect disk status on JBOD disk.
* Fix incorrect disk status query.

Gris Ge (3):
MegaRAID Plugin: Fix incorrect disk status.
MegaRAID Plugin: Fix the JBOD disk status
MegaRAID Plugin: Remove 'Other Error Count' check on disk status.

plugin/megaraid/megaraid.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
1.8.3.1
Gris Ge
2015-10-27 06:18:31 UTC
Permalink
* Check the existing of Disk.STATUS_OK before unset it.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 9ff5edf..adb830b 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -101,11 +101,13 @@ def _disk_status_of(disk_show_basic_dict, disk_show_stat_dict):
if disk_show_stat_dict['Media Error Count'] or \
disk_show_stat_dict['Other Error Count'] or \
disk_show_stat_dict['S.M.A.R.T alert flagged by drive'] != 'No':
- disk_status -= Disk.STATUS_OK
+ if disk_status & Disk.STATUS_OK:
+ disk_status -= Disk.STATUS_OK
disk_status |= Disk.STATUS_ERROR

elif disk_show_stat_dict['Predictive Failure Count']:
- disk_status -= Disk.STATUS_OK
+ if disk_status & Disk.STATUS_OK:
+ disk_status -= Disk.STATUS_OK
disk_status |= Disk.STATUS_PREDICTIVE_FAILURE

if disk_show_basic_dict['Sp'] == 'D':
--
1.8.3.1
Gris Ge
2015-10-27 06:18:32 UTC
Permalink
* Correct the status of JBOD disk.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index adb830b..317cbec 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -91,6 +91,7 @@ def _disk_type_of(disk_show_basic_dict):
'UGood': Disk.STATUS_FREE | Disk.STATUS_OK,
'UBad': Disk.STATUS_FREE | Disk.STATUS_ERROR,
'Rbld': Disk.STATUS_RECONSTRUCT,
+ 'JBOD': Disk.STATUS_OK,
}
--
1.8.3.1
Gris Ge
2015-10-27 06:18:33 UTC
Permalink
* 'Other Error Count' will increase when converted from/to JBOD disk,
hence remove it from disk status check.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 1 -
1 file changed, 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 317cbec..ea986a0 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -100,7 +100,6 @@ def _disk_status_of(disk_show_basic_dict, disk_show_stat_dict):
disk_show_basic_dict['State'], 0)

if disk_show_stat_dict['Media Error Count'] or \
- disk_show_stat_dict['Other Error Count'] or \
disk_show_stat_dict['S.M.A.R.T alert flagged by drive'] != 'No':
if disk_status & Disk.STATUS_OK:
disk_status -= Disk.STATUS_OK
--
1.8.3.1
Continue reading on narkive:
Search results for '[PATCH 0/3] Fixes for MegaRAID disks.' (Questions and Answers)
16
replies
what is the average cost of a dedicated server?
started 2009-04-17 02:38:27 UTC
computer networking
Loading...