Skip to content

Conversation

odenbach
Copy link
Contributor

Hi,

we have a few boxes with LSI controllers with two ids. mpt-status -p only shows the first ID:

root@osiris[]# mpt-status -p
Checking for SCSI ID:0
Found SCSI id=0, use ''mpt-status -i 0`` to get more information.
root@osiris[
]# mpt-status -i 0
ioc0 vol_id 0 type IM, 2 phy, 33 GB, state OPTIMAL, flags ENABLED
ioc0 phy 2 scsi_id 5 FUJITSU MAY2036RCSUN36G 0401, 33 GB, state ONLINE, flags NONE
ioc0 phy 3 scsi_id 1 FUJITSU MAY2036RCSUN36G 0401, 33 GB, state ONLINE, flags NONE

But there is also ID 2:

root@osiris[~]# mpt-status -i 2
ioc0 vol_id 2 type IM, 2 phy, 58 GB, state OPTIMAL, flags ENABLED
ioc0 phy 1 scsi_id 4 ATA SSDSA2SH064G1GC 8860, 59 GB, state ONLINE, flags NONE
ioc0 phy 0 scsi_id 3 ATA SSDSA2SH064G1GC 8860, 59 GB, state ONLINE, flags NONE

I therefore added the possibility to give check_raid the controller id as an option, just as

root@osiris[nagios-plugin-check_raid]# ./check_raid.sh
OK: mpt:[Volume 0 (RAID-1, 2 disks, 33 GiB): OPTIMAL]
root@osiris[nagios-plugin-check_raid]# ./check_raid.sh --plugin-option=mpt-id=2
OK: mpt:[Volume 2 (RAID-1, 2 disks, 58 GiB): OPTIMAL]

Thanks for the good work!

@glensc glensc added the mpt label Nov 23, 2017
@glensc
Copy link
Owner

glensc commented Nov 23, 2017

you sure you didn't omit some changes? as if i try to make test case with your -i 2 provided data, i get unparsed notices as this does not match regex:

Regex Value
(.{8})\s+(.{16})\s+(.{4}) ATA SSDSA2SH064G1GC 8860

Plugins/mpt.pm:111

[~/scm/nagios/check_raid (pr/177)★] ➔ ./t/check_mpt.t
1..31
ok 1 - plugin created
ok 2 - plugin created: pr177/mpt-status-i-2
mpt unparsed: [ioc0 phy 1 scsi_id 4 ATA SSDSA2SH064G1GC 8860, 59 GB, state ONLINE, flags NONE] at t//../lib/App/Monitoring/Plugin/CheckRaid/Plugins/mpt.pm line 142, <$fh> line 2.
mpt unparsed: [ioc0 phy 0 scsi_id 3 ATA SSDSA2SH064G1GC 8860, 59 GB, state ONLINE, flags NONE] at t//../lib/App/Monitoring/Plugin/CheckRaid/Plugins/mpt.pm line 142, <$fh> line 3.

@glensc
Copy link
Owner

glensc commented Nov 23, 2017

ok, managed to capture raw output of your commands, now new tests pass...

that's why you should pay attention what CONTRIBUTING.md has to say....

@glensc glensc merged commit 9fd0697 into glensc:master Nov 23, 2017
@odenbach odenbach deleted the mpt-options branch November 24, 2017 07:20
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