mpt-statusd reports RAID changes even when there is no RAID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mpt-status (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
when using the mpt-statusd on a server, which has the RAID hardware installed but currently no disks attached, it will continuously send out emails stating that:
"This is a RAID status update from mpt-statusd. The mpt-status
program reports that one of the RAIDs changed state:
Report from /etc/init.
This message comes up every 5 minutes, even though the status of the RAID can't have changed.
Line 51 in the /etc/init/
48 # Check ever $PERIOD seconds, send email on every status
49 # change and repeat ever $REMIND seconds if the raid is still
50 # bad.
51 if (mpt-status -i $ID) |grep -q 'state OPTIMAL' ; then
52 BADRAID=false
53 else
54 BADRAID=true
55 logger -t mpt-statusd "detected non-optimal RAID status"
56 fi
The "grep" in line 51 return 1, even if there is no output of mpt-status at all. This is normal behaviour of grep though. But i think the script should also check, if there is ANY output at all. Because it it doesn't, it will continue to send out emails.
I know, i could uninstall it or do some other things to avoid this situation, but there are some reasons why it make sense to have it running on those machines.
- if someone temporarily removes the drives or put some drive in the server at a later point of time, it is easy to forget about the statusd
- in times of ansible, puppet, and other, more scripts are just checking for hardware and installing packages like statusd automatically
- the email is just wrong. there is no changed state. it is a bug
- other people might have more reasons
-----
I would expect that the statusd is not reporting on any changes or alike, if there is no RAID configured or disks attached.
-----
# lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04
-----
# apt-cache policy mpt-status
mpt-status:
Installed: 1.2.0-8
Candidate: 1.2.0-8
Version table:
*** 1.2.0-8 500
500 http://
100 /var/lib/
1.
500 http://