edgarsuit / freenas-report Goto Github PK
View Code? Open in Web Editor NEWSMART & ZPool Status Report for FreeNAS
License: GNU General Public License v3.0
SMART & ZPool Status Report for FreeNAS
License: GNU General Public License v3.0
Hi all!
I just cloned this repo and shanged the e-mailadres between the "", saved the file and executed it with sh report.sh.
I can't seem to receive the email?
An attempt to restore a config created with this script fails under TrueNAS 12. Saving and reloading a config through the UI works. For details, please refer to this TrueNAS forum post https://www.truenas.com/community/threads/pool-restoration-journey-truenas-12.93581/post-647700
The email shows markup, hmm. Will try digging into the script.
What is this stat and why is it at 200%? Is that a good number or bad? I'm not finding info on that stat.
The "Last Test Age (days)" is reported incorrectly in the SMART report table when the power on time >65535 hours. This seems to be because the life time hours reported by smartctl test table is a 16 bit value and rolls over at 65536 while the power on time does not. So math goes bad. This seems to be a limitation on smartctl. Perhaps there is not much one can do about this other than assuming that the most recent test is more recent than 65535 hours and then subtract multiple of this from the power on time and use the remainder.
I am not sure what is causing this, I think it started when I virtualized freenas under ESXi but I didn't pay enough attention to when this happened to cross reference when I virtualized.
I get this error:
date: illegal option -- 0 usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] date: illegal option -- 2 usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Hey, I'm getting this error message when the script is running after upgrading to TrueNAS 12. Do you have any ideas what's wrong? What is messed up?
Thanks!
date: illegal option -- 0
usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] [-v[+|-]val[ymwdHMS]]
[-I[date | hours | minutes | seconds]]
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
date: illegal option -- 0
usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] [-v[+|-]val[ymwdHMS]]
[-I[date | hours | minutes | seconds]]
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
./report.sh
date: illegal option -- 0
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
My FreeNAS version is
FreeBSD ANGELING.PORING.NET 11.0-STABLE FreeBSD 11.0-STABLE #0 r321665+25fe8ba8d06(freenas/11.0-stable): Mon Sep 25 06:24:11 UTC 2017 root@gauntlet:/freenas-11-releng/freenas/_BE/objs/freenas-11-releng/freenas/_BE/os/sys/FreeNAS.amd64 amd64
Here is a screenshot of the Realloc'd Sectors column that has the formatting error.
Here is the text output:
< td style="text-align:center; background-color:#f4f4f4; height:25px; border:1px solid black; border-collapse:collapse; font-family:courier;">0
I'm using version 1.3 and am unsure why this is occurring after a scrub is completed.
if [ "$(smartctl -i /dev/"${drive}" | grep "SMART support is: Enabled")" ] && ! [ "$(smartctl -i /dev/"${drive}" | grep "Solid State Device")" ]; then
If I change the above line in the shell script to:
if [ "$(smartctl -i /dev/"${drive}" | grep "SMART support is:[[:space:]]*Enabled")" ] && ! [ "$(smartctl -i /dev/"${drive}" | grep "Solid State Device")" ]; then
The SMART information are still incorrect: https://imgur.com/VqPe34G
# smartctl -i /dev/da23
smartctl 6.5 2016-05-07 r4318 [FreeBSD 11.0-STABLE amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: HITACHI
Product: HUS723030ALS640
Revision: M2D4
Compliance: SPC-4
User Capacity: 3,000,592,982,016 bytes [3.00 TB]
Logical block size: 512 bytes
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Logical Unit id: 0x5000cca03e5d1e24
Serial number: ********
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Sun Jan 13 07:56:06 2019 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
I noticed that even with some brand new drives I am getting a warn on seek error health in the report. I then did some digging into the code to better understand the threshold and it seems that anything less than 100 will display the earring colour.
What confused me though was why we are adding 0 to the value does anyone know? Maybe this can be cleaned up?
if ((seekErrorHealth + 0) < 100) seekErrorHealthColor = warnColor; else seekErrorHealthColor = bgColor;
My root level pool has a space in it, i.e. "Main Pool"
This results in the script parsing the name as two separate pools "Main" and "Pool", which ends up in an error:
cannot open 'Main': no such pool
cannot open 'Pool': no such pool
Is this an easy fix?
Thanks
Hi,
I had started to work on the original version of the script to simplify it and worked on finding the smart attributes for SSDs.
Here are what I have
ssd_serial_num[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/Serial Number:/{print $3}') ssd_temp[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/194 Temperature_Celsius/{print $10}') ssd_poweron[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/9 Power_On_Hours/{print $10}') ssd_raw_read_err_rate[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/1 Raw_Read_Error_Rate/{print $10}') ssd_powercycle[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/12 Power_Cycle_Count/{print $10}') ssd_prog_fail_count[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/181 Program_Fail_Cnt_Total/{print $10}') ssd_erase_fail_count[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/182 Erase_Fail_Count_Total/{print $10}') ssd_uncorrec_errors[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/187 Reported_Uncorrect/{print $10}') ssd_lifetime_wr[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/241 Lifetime_Writes_GiB/{print $10}') ssd_lifetime_rd[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/242 Lifetime_Reads_GiB/{print $10}') ssd_realloc_event[$index3]=$(smartctl -A -i -v 7,hex48 /dev/$ssd | awk '/196 Not_In_Use/{print $10}') ssd_last_Test_Hours[$index3]=$(smartctl -l selftest /dev/"$ssd" | grep "# 1" | awk '{print $9}')
The current script is more complex than I want to take time understanding but i can test updates.
I also created a $ssd variable to put SSD data in instead of trying to mix-match extracted attributes between rust and ssd. I found conflicts when only using text for attributes hence the reason you have the number in front.
Hope this help!
Jonathan
I have no idea what I'm doing, followed the setup as best I could, when it came to chmod +x multi_report.sh, it says Operation not permitted, after google searching found a forum that says you have to use setfacl as chmod doesn't work with windows SMB shares? If someone could give me the setfacl I need to use that'd be lovely. I tried to look through a setfacl instructional page, but couldn't find a command that makes a file executable. The Cronjob is running though, so it seems like it is executable? But I haven't received any emails, tried updating the email but nothing has worked yet. The email I'm trying to send it to is on the 1and1 email server, anyone else had this problem and know how to fix? Sorry if I'm not providing enough information, if you need more please ask and I'll try to give it to you. Thanks!
would be nice to see the frag status :)
I'm getting the following error when running since 18-January:
Failed conversion of
17-on-Mon_Jan'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] [-v[+|-]val[ymwdHMS]]
[-I[date | hours | minutes | seconds]]
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Same thing when executing from command line. Curious thing is from day 17 to 30 it said 17-on-Mon_Jan'' using format
%Y-%b-%e_%H:%M:%S'' and from the first of February it changed to 31-on-Mon_Jan'' using format
%Y-%b-%e_%H:%M:%S'.
The only reference I see to that time format is from line 231
Hi,
first, I am using this script a long time ago for now. Thanks for it :)
Since two days one of my harddrives are missing in the summary and I get a unknown message
Image without the missing drive.
Errormessage:
awk: newline in string 37267 newer... at source line 1 awk: newline in string Extended 19... at source line 1
Freenas dont have any errors about this drive at the moment. Poos is not degraded.
Thanks for help :)
Maybe i am wrong. But at the pool menu on the Admin-Website of Freenas there is a different value.
The script told me for my Tank 55% used and on the website i have 65% of pool usage
Thanks
Johannes
Running FreeNAS 11.2-U8 gives this error, system time/date/zone is set correctly:
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 26-on-Thu_Nov'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 8-on-Sun_Nov'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 25-on-Sun_Oct'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 15-on-Sun_Nov'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 1-on-Sun_Nov'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of 22-on-Sun_Nov'' using format
%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Hello,
I encountered the same issue as described at "https://www.gitmemory.com/issue/edgarsuit/FreeNAS-Report/24/812802235"
Further error message:
awk: newline in string
newer... at source line 1
Temporary fix (added one more space at the end of "# 1":
lastTestHours=$("$smartctl" -l selftest "$drive" | grep "# 1 " | awk '{print $9}')
As per title, I'm assuming the script simply runs on the FreeNAS server itself, but it is not totally clear whether it must be executed from the local server or can be ran remotely using the APIs.
Scrub time is not showing correctly in the emails. Additionally, I am receiving an additional email now. I found that these errors are appearing and generating the second email:
Failed conversion of ``25-on-Sun_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of ``25-on-Sun_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of ``25-on-Sun_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Failed conversion of ``23-on-Fri_Feb'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]
Started when I updated to 11.1-U#
It's a red box without any numbers or letters and the seek error health is always at 090% or 087%
I've got Seagate drives btw
Hi,
I am getting emails without any issues but it's not saving the backups in the backup folder.
I created a new folder:
mkdir /mnt/raid2TB/FreeNas\ Configs
cd /mnt/raid2TB/FreeNas\ Configs
FreeNas Configs
But script is giving me error:
cp: /mnt/raid2TB/FreeNas\ Configs/FreeNAS_Config_2020-06-25.tar.gz: No such file or directory
One more question:
Does it also save the Export Pool Encryption Keys
and Export Password Secret Seed
?? If not then how could i include those as well because this will replicate exactly how i take backups via GUI
Great project and thank you!
It should pull from Temperature_Case
or Temperature_Internal
(or an average of the two):
########## SMART status report for ada0 drive (Intel 730 and: {serial}) ##########
smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build)
SMART overall-health self-assessment test result: PASSED
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 2189
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 43
170 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
174 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 39
175 Power_Loss_Cap_Test 0x0033 100 100 010 Pre-fail Always - 629 (12 9058)
183 SATA_Downshift_Count 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 090 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
190 Temperature_Case 0x0022 080 072 000 Old_age Always - 20 (Min/Max 18/28)
192 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 39
194 Temperature_Internal 0x0022 100 100 000 Old_age Always - 27
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
199 CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
225 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 2685
226 Workld_Media_Wear_Indic 0x0032 100 100 000 Old_age Always - 0
227 Workld_Host_Reads_Perc 0x0032 100 100 000 Old_age Always - 81
228 Workload_Minutes 0x0032 100 100 000 Old_age Always - 131164
232 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0032 100 100 000 Old_age Always - 0
234 Thermal_Throttle 0x0032 100 100 000 Old_age Always - 0/0
241 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 2685
242 Host_Reads_32MiB 0x0032 100 100 000 Old_age Always - 15674
Output of zpool status command is slightly different in CORE, so script requires minor changes in Scrub section:
looks like the output of zpool status has changed slightly on the version of BSD that comes with 12,0; statusDate just needs to chnage slightly from:
scrubDate="$(echo "$statusOutput" | grep "scan" | awk '{print $17"-"$14"-"$15"_"$16}')"
to
scrubDate="$(echo "$statusOutput" | grep "scan" | awk '{print $15"-"$12"-"$13"_"$14}')"
thanks for the script BTW!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.