Skip to content

Conversation

odenbach
Copy link
Contributor

Hi,

one of our Supermicro servers has 36 local disks attached to a MegaRaid controller. megacli sorts the disks by enclosure id and slot number, but check_raid displays the device id instead. This may lead to unsorted output:

root@tc-covp[nagios-plugin-check_raid]# /usr/lib/nagios/plugins/check_raid 
CRITICAL: megacli:[Volumes(1): DISK0.0:Partially; Devices(35): 10,19,12,23,13,22,14,25,15,39,18,28,27,33,11,32,36,43,40,38,44,41,45,42,20,31,26,17,16,37,29,21,34,24,35=Online]

The attached patch sorts the devices numerically:

root@tc-covp[nagios-plugin-check_raid]# ./check_raid.sh 
CRITICAL: megacli:[Volumes(1): DISK0.0:Partially; Devices(35): 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45=Online]

Which makes it much easier to spot the missing disk id 30.

I tried to put the sort function into join_status() first, but that did not work as not all controllers return disk names that are easily sortable (01 vs. 1:2 vs. Y2O483PAS).

Regards,

Christopher

@odenbach
Copy link
Contributor Author

The build error has nothing to do with my patch. Something else must be broken.

@glensc glensc added the megacli label Jan 30, 2019
@glensc glensc merged commit 2a05ecb into glensc:master Jan 30, 2019
@odenbach odenbach deleted the sort_megacli branch January 30, 2019 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants