Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Monthly Parity Check Question

Featured Replies

When the monthly parity checks happened on unRAID version 4.7 I would get a hourly email with % completed and speed. Now that I have upgraded to 5.0 the monthly parity checks do not show % completed or speed on the hourly emails. Did something change or did I forget to select a certain setting?

unRAID doesn't have native email capability so you must have been using unMenu to get that functionality. Is unMenu still installed after your upgrade?

iirc Mail notifications are not a built in function of unraid.  I think the easiest way to add it is to install it through unmenu in the packages section...

  • Author

Sorry I should have been more clear. Yes, I have unMenu installed. I have the mail package selected and monthly parity check selected. I just cannot figure out why the emails do not contain the %complete and mb/s like they used to with 4.7?

Been a while since I was on 4.7 so I just checked the emails from my monthly parity check and they don't have that info either. Don't remember if I had it under 4.7 and I don't see anywhere to set it up.

It no longer reports percent completed. It pretty easy to fix to percentage but I'm not sure how to get speed and duration estimates anymore.

 

root@rack:~# mdcmd status | grep mdResync

mdResync=1953514552

mdResyncCorr=1

mdResyncPos=130206868

mdResyncDt=30

mdResyncDb=3169232

 

 

I don't know what the last 2 values mean.

You don't. The script needs to be updated to query "mdcmd status" and compute the percentage based on the first and third values.

  • Author

So there is a script that needs to be modified? Is that something I can do or does that have to be updated by others?

Thanks archedraft for starting this thread.  I've had the same thought in my head since migrating to the 5.x series (including betas).

 

I'm not sure exactly how to fix this but I think this unMenu package needs to be modified - "/boot/packages/mail_status-unmenu-package.conf" starting somewhere after the line "PACKAGE_INSTALLATION M# RESYNC MESSAGES"

 

Maybe Joe L. or someone else knows what needs to be updated in this cron script with the 5.x series...

 

#UNMENU_RELEASE $Revision: 129 $ $Date: 2010-07-21 12:07:03 -0400 (Wed, 21 Jul 2010) $
PACKAGE_NAME unRAID Status Alert sent hourly by e-mail
PACKAGE_DESCR This package will install a cron script to send hourly e-mail status alerts when an abnormal status is detected.<br>
PACKAGE_DESCR You may also elect to get hourly notifications when the status is OK.
PACKAGE_DESCR <br><br>The script is created in /etc/cron.hourly and is named smtp_status.sh<br>
PACKAGE_DESCR It will run hourly, at 47 minutes past the hour, and report on the status of the unRAID array as appropriate.<br>
PACKAGE_DESCR <b>To use this script you must have installed and configured a "mail" command on your unRAID server.
PACKAGE_URL  none
PACKAGE_FILE unraid-status-email
PACKAGE_INSTALLED /etc/cron.hourly/smtp_status.sh
PACKAGE_DEPENDENCIES mail
PACKAGE_VARIABLE Send status mail to||vEMAIL_ADDR=root||Send the status e-mail to this address. (typically "root" is already forwarded to an appropriate email)
PACKAGE_VARIABLE Include mdcmd status?(YES/NO)||vMDCMD_OUT=YES|| If set to YES, the output of the <b>mdcmd status</b> command will be included in the mail.
PACKAGE_VARIABLE Include disk space usage summary?(YES/NO)||vDF_OUT=YES|| If set to YES, the output of the <b>df</b> command will be included in the mail.
PACKAGE_VARIABLE Send mail even if status is normal?(YES/NO/NN)||vHOURLY_OK=01 03 05 07 09 11 13 15 17 19 21 23|| If set to YES, an e-mail will be sent hourly stating status is OK, if NO, no OK status will be sent, if set to a numeric string, OK status will be sent only on those hours.  <b>06</b> will send an OK status at 6:47 AM, <b>08 16 00</b> will  send an OK status 3 times a day, at 08:47, 16:47, and 00:47.
PACKAGE_VARIABLE Disk Temperature Warning Threshold||vTEMP_WARNING=40|| If an unRAID disk goes over this threshold (degrees C), a warning e-mail will be sent.
PACKAGE_VERSION_TEST grep "Version:" /var/log/unRAID-status-email  | awk '{print $2}'
PACKAGE_VERSION_STRING 1.3
PACKAGE_MEMORY_USAGE Small 
PACKAGE_INSTALLATION [ ! -f /usr/bin/mail -a ! -f /bin/mail ] && echo "Error: You must first install 'mail' before this package can send a status report via e-mail"
PACKAGE_INSTALLATION [ ! -f /usr/bin/mail -a ! -f /bin/mail ] && exit
PACKAGE_INSTALLATION echo "Version: 1.3" > /var/log/unRAID-status-email
PACKAGE_INSTALLATION echo "vEMAIL_ADDR=\"${vEMAIL_ADDR-root}\"" >/etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION echo "vHOURLY_OK=\"${vHOURLY_OK-NO}\";" >>/etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION echo "vMDCMD_OUT=\"${vMDCMD_OUT-NO}\"" >>/etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION echo "vDF_OUT=\"${vDF_OUT-NO}\"" >>/etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION echo "vTEMP_WARNING=\"${vTEMP_WARNING-40}\"" >>/etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION cat >>/etc/cron.hourly/smtp_status.sh << 'THE_END_OF_SCRIPT'
# For those trying to figure out what I've done here...
# the leading "M" in each of the following lines in the "here" document is needed to preserve indentation. 
# They are removed by a "sed" command at the end of this script
PACKAGE_INSTALLATION M# The email subject
PACKAGE_INSTALLATION MsSubject="unRaid Status"
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M# Choose to include the contents of /proc/mdcmd in your status 
PACKAGE_INSTALLATION MbIncludeMdcmd="False"
PACKAGE_INSTALLATION Mif [ "${vMDCMD_OUT-NO}" = "YES" ]; then
PACKAGE_INSTALLATION M  bIncludeMdcmd="True"
PACKAGE_INSTALLATION Mfi
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M# initialize the error message to an empty string if no hourly OK message is desired
PACKAGE_INSTALLATION Memsg=""
PACKAGE_INSTALLATION Mif [ "${vHOURLY_OK-NO}" = "YES" ]; then
PACKAGE_INSTALLATION M  emsg="unRaid is OK"
PACKAGE_INSTALLATION M  sSubject="unRaid Status OK"
PACKAGE_INSTALLATION Mfi
PACKAGE_INSTALLATION Mif [ "${vHOURLY_OK}" != "" ]; then
PACKAGE_INSTALLATION M  hr=`date +%H`
PACKAGE_INSTALLATION M  for i in ${vHOURLY_OK}
PACKAGE_INSTALLATION M  do
PACKAGE_INSTALLATION M    if [ "$i" = "$hr" ]; then
PACKAGE_INSTALLATION M      emsg="unRaid is OK"
PACKAGE_INSTALLATION M      sSubject="unRaid Status OK"
PACKAGE_INSTALLATION M      break
PACKAGE_INSTALLATION M    fi
PACKAGE_INSTALLATION M  done
PACKAGE_INSTALLATION Mfi
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M/root/mdcmd status | strings >/tmp/array_status
PACKAGE_INSTALLATION Mgrep "mdState=STARTED" /tmp/array_status >/dev/null 2>&1
PACKAGE_INSTALLATION Mif [ $? != 0 ]
PACKAGE_INSTALLATION Mthen
PACKAGE_INSTALLATION M  emsg="\n\nWARNING - unRAID Array NOT STARTED\n\n"
PACKAGE_INSTALLATION M  sSubject="unRaid Status WARNING - Array Not Started"
PACKAGE_INSTALLATION M  bIncludeMdcmd="True"
PACKAGE_INSTALLATION Mfi 
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION Megrep "=DISK_INVALID|=DISK_DSBL" /tmp/array_status >/tmp/disk_not_normal 2>&1
PACKAGE_INSTALLATION Mif [ $? = 0 ]
PACKAGE_INSTALLATION Mthen
PACKAGE_INSTALLATION M  sSubject="unRaid Failure Notification - One or more disks are disabled or invalid."
PACKAGE_INSTALLATION M  emsg="\n\nERROR: The unRaid array needs attention. One or more disks are disabled or invalid.\n\n"
PACKAGE_INSTALLATION M  emsg+="\n`cat /tmp/disk_not_normal | sed 's/rdevStatus./Disk /'`"
PACKAGE_INSTALLATION M  bIncludeMdcmd="True"
PACKAGE_INSTALLATION Mfi 
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M# RESYNC MESSAGES
PACKAGE_INSTALLATION MRESYNC=`egrep "^mdResync" /tmp/array_status | cut -d "=" -f2 | sed 1q`
PACKAGE_INSTALLATION Mif [ "$RESYNC" != "0" -a "$RESYNC" != "" ]; then 
PACKAGE_INSTALLATION M  RESYNCPERCENT=`egrep "^mdResyncPrcnt" /tmp/array_status | cut -d "=" -f2` 
PACKAGE_INSTALLATION M  RESYNCFINISH=`egrep "^mdResyncFinish" /tmp/array_status | cut -d "=" -f2` 
PACKAGE_INSTALLATION M  RESYNCSPEED=`egrep "^mdResyncSpeed"   /tmp/array_status | cut -d "=" -f2`  
PACKAGE_INSTALLATION M  NL=`echo "\n"`                                               
PACKAGE_INSTALLATION M  sSubject="unRaid Resync Notification"                        
PACKAGE_INSTALLATION M  emsg="The unRaid array is resync/rebuilding parity.${NL}${NL}"
PACKAGE_INSTALLATION M  if [ ! -z "${RESYNCPERCENT}" ]; then 
PACKAGE_INSTALLATION M    emsg="${emsg}Parity CHECK/RESYNC in progress, "      
PACKAGE_INSTALLATION M    emsg="${emsg} ${RESYNCPERCENT}% complete, "          
PACKAGE_INSTALLATION M    emsg="${emsg} est. finish in $RESYNCFINISH minutes." 
PACKAGE_INSTALLATION M    emsg="${emsg} Speed: ${RESYNCSPEED} kb/s."
PACKAGE_INSTALLATION M  fi                                                           
PACKAGE_INSTALLATION M  bIncludeMdcmd="False"                                        
PACKAGE_INSTALLATION Mfi   
PACKAGE_INSTALLATION Mdisks=`ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -Hl | grep -v plugdev | grep -v "by-id/usb" | grep -v '\-part[1-9]$' | awk '{print $9}'`
PACKAGE_INSTALLATION Mfor i in $disks
PACKAGE_INSTALLATION Mdo
PACKAGE_INSTALLATION M  hdparm -C $i 2>/dev/null | egrep "standby|unknown" >/dev/null
PACKAGE_INSTALLATION M  if [ "$?" != 0 ]; then
PACKAGE_INSTALLATION M    temp=`smartctl -d ata -A $i | grep -i temperature | sed 1q | awk '{ print $10 }'`
PACKAGE_INSTALLATION M    if [ "$temp" != "" ]
PACKAGE_INSTALLATION M    then
PACKAGE_INSTALLATION M      if [ "$temp" -gt "${vTEMP_WARNING-40}" ];then
PACKAGE_INSTALLATION M        emsg="WARNING disk $i temperature is ${temp}C\n$emsg"
PACKAGE_INSTALLATION M        sSubject="unRaid Disk Temperature Notification"                        
PACKAGE_INSTALLATION M      fi
PACKAGE_INSTALLATION M    fi
PACKAGE_INSTALLATION M  fi
PACKAGE_INSTALLATION Mdone
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION Mif [ "$emsg" != "" ]
PACKAGE_INSTALLATION Mthen
PACKAGE_INSTALLATION M  # Message Subject
PACKAGE_INSTALLATION M  sEcho+="Subject:$sSubject\n"
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M  # Message Body (You can change this to look how you want.  Just
PACKAGE_INSTALLATION M  # 	       to include \n at the end of each line.)
PACKAGE_INSTALLATION M  sEcho+="Status update for unRAID  $HOSTNAME\n"
PACKAGE_INSTALLATION M  sEcho+="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n"
PACKAGE_INSTALLATION M  sEcho+="Status: $emsg\n"
PACKAGE_INSTALLATION M  sEcho+="Server Name: $HOSTNAME\n"
PACKAGE_INSTALLATION M  sEcho+="Server IP: `ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`\n"
PACKAGE_INSTALLATION M  sEcho+="Date: "
PACKAGE_INSTALLATION M  sEcho+=`date 2>/dev/null`
PACKAGE_INSTALLATION M  sEcho+="\n"
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M  # Add the contents of "df" if elected by the user
PACKAGE_INSTALLATION M  if [ "${vDF_OUT-NO}" = "YES" ]; then
PACKAGE_INSTALLATION M    sEcho+=`df`
PACKAGE_INSTALLATION M    sEcho+="\n"
PACKAGE_INSTALLATION M  fi
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M  # Add the contents of /proc/mdcmd if elected by the user
PACKAGE_INSTALLATION M  if [ "$bIncludeMdcmd" = "True" ]
PACKAGE_INSTALLATION M  then
PACKAGE_INSTALLATION M    sEcho+="\n"
PACKAGE_INSTALLATION M    sEcho+="Output of /proc/mdcmd:\n"
PACKAGE_INSTALLATION M    sEcho+="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n"
PACKAGE_INSTALLATION M     
PACKAGE_INSTALLATION M    sEcho+=`/root/mdcmd status|strings`
PACKAGE_INSTALLATION M    sEcho+="\n"
PACKAGE_INSTALLATION M  fi 
PACKAGE_INSTALLATION M
PACKAGE_INSTALLATION M  echo -e "$sEcho"|mail -s "$sSubject" ${vEMAIL_ADDR-root}
PACKAGE_INSTALLATION Mfi
PACKAGE_INSTALLATION THE_END_OF_SCRIPT
PACKAGE_INSTALLATION sed -i "s/^M//" /etc/cron.hourly/smtp_status.sh
PACKAGE_INSTALLATION chmod +x /etc/cron.hourly/smtp_status.sh

The three parameters

mdResyncPrcnt

mdResyncFinish

mdResyncSpeed

are no longer part of the output in /proc/mdcmd in version 5.0.

 

I do not know the equivalents... in 5.0.  If you can figure it out, I can update the mail output.

 

I see mdResync which seems to be the total size and

mdresyncPos which tells you the portion checked thus far.

I don't know how to determine when the check started. (to calculate the rate)

 

 

 

Joe L.

 

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.