Giter Club home page Giter Club logo

freenas-report's People

Contributors

edgarsuit avatar reven avatar saxx0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freenas-report's Issues

Harddrive missed and unknown message

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 with the missing drive:
image

Image without the missing drive.
image

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 :)

Getting a weird issue with the date conversion...

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#

Last Test Age incorrect when power on time >65535 hours

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.

date: illegal option

./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

Why are we adding 0 to smart error heath value?

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;

Haven't been receiving Emails, also couldn't chmod the sh, instead need to use setfacl

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!

Unable to extract information from DELL SAS drives

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

Scrub Info Incorrect if run in TrueNAS 12 RC1

Output of zpool status command is slightly different in CORE, so script requires minor changes in Scrub section:

  1. adjust awk print statements for scrubRepBytes, scrubErrors, scrubTime and scrubDate -2.
  2. remove "B" from scrubRepBytes

Illegal time format

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

Timestamp issue

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]

FreeNAS 11.2-u8 Failed conversion of ``1-on-Sun_Nov'' using format ``%Y-%b-%e_%H:%M:%S''

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]

Works perfect but not saving config

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!

Temperature not read for all drives

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

RC12.0 $scrubDate: awk fields

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!

Error message after upgrading to TrueNAS 12

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]

Seek Error Health 200%

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.

SMART attribute "Realloc Events" not displayed

Here is a status of my pool (in a bad shape), reported with your script:
Screenshot from 2020-09-08 02-27-13

You can see that the column Realloc Events is left blank except for one displaying 0.

The only idea I have right now is that it could be due to numbers being to big to fit inside the boxes.

No SMART Details from Disks

The SMART list is empty, when i manually read the SMART details from the FreeNAS shell it gives me a normal output with SMART Parameters. I´m running FreeNAS 11.3 U1. If i choose the option to list the SMART parameters of my M.2 drives when i get a normal output in the mail.

image

Realloc'd Sectors formating issue after scrub is ran

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.

can't get mails...

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?

Realloc'd sectors don't show up

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

Used space of Pools not correctly displayed

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

Space character in pool name results in error

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

SSD Smart Attributes

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.