NOTE: This is beta software. Use at your own risk!
Prologue
Let me start by saying, I'm fairly new to FreeNAS, so please bear with me if this has been done before.
Before I start by telling what the program does, you need to know my build.
I'm using a SuperMicro SC846 server, which comes with a 3ware/LSI 9650SE 24M8 raid card.
A couple of days ago when I was setting up FreeNAS, I wanted to do something to monitor my disks. I realised I would get a daily mail from the FreeNAS system, but daily doesn't cut it with 24 drives...
I started setting up SMART checks (short, long and offline) realising it was a pain to time it all (So to stay clear of scrubs and other SMART checks).
Then last night I fell over a line in the manual stating that if you had a RAID controller, you shouldn't schedule SMART checks, as the RAId controller should do that for you.
GREAT!!!
I did some testing using tw_cli and it seems like mine does.
Then I went down in the basement and pulled a drive. Back at the computer, the only "notice" I got was an entry in the messages log. No mail, no nothing...
After some more reading around, I found that I would need the 3ware GUI (w3dm or something) - But that isn't included in FreeNAS and couldn't really find a way to get it working.
Then, what's a hacker to do?
I created my own littel "wrapper" around the tw_cli program.
What It Does
It queries tw_cli for the disk status. This status is then checked for the keyword: "OK"
If OK isn't in the status a mail is sent to root.
The next time it runs, it will remember the last errors. This makes sure you are only noticed about a disc one time (I run it every 15th minute and only want to know it once) but notify's you of new errors.
It will use a temporary director in /tmp called tw (/tmp/tw).
This will notice you if you pull a drive and potentially if one of your drives fail (Haven't tested this as I don't have a bad drive... But a failed drive wouldn't have "OK" as a status... So it should notify you).
Installing
Installing is easy. Currently it's onlt distributed in source format, but will run fine on FreeNAS.
Use the following commands to install it:
Please note: It will NOT survive a reboot! Haven't found a way to do that yet...
Then I add 2 cron jobs.
One to run every 15th minute using this code: /tmp/3ware_info_0.1.py
One to run every night at 00:00: rm /tmp/tw/tw_last_error
The last cron reset's my "last_error" so I get notified once per day per failed drive.
Epilogue
Hope you can use it.
Currently It only supports 24 drives and 3ware controller. But I bet you can modify it if you need.
If you can't do it yourself, ask me nicely and I'll give it a shot.
EDIT: Oh yeah, I forgot. The output mail will look like this:
Prologue
Let me start by saying, I'm fairly new to FreeNAS, so please bear with me if this has been done before.
Before I start by telling what the program does, you need to know my build.
I'm using a SuperMicro SC846 server, which comes with a 3ware/LSI 9650SE 24M8 raid card.
A couple of days ago when I was setting up FreeNAS, I wanted to do something to monitor my disks. I realised I would get a daily mail from the FreeNAS system, but daily doesn't cut it with 24 drives...
I started setting up SMART checks (short, long and offline) realising it was a pain to time it all (So to stay clear of scrubs and other SMART checks).
Then last night I fell over a line in the manual stating that if you had a RAID controller, you shouldn't schedule SMART checks, as the RAId controller should do that for you.
GREAT!!!
I did some testing using tw_cli and it seems like mine does.
Then I went down in the basement and pulled a drive. Back at the computer, the only "notice" I got was an entry in the messages log. No mail, no nothing...
After some more reading around, I found that I would need the 3ware GUI (w3dm or something) - But that isn't included in FreeNAS and couldn't really find a way to get it working.
Then, what's a hacker to do?
I created my own littel "wrapper" around the tw_cli program.
What It Does
It queries tw_cli for the disk status. This status is then checked for the keyword: "OK"
If OK isn't in the status a mail is sent to root.
The next time it runs, it will remember the last errors. This makes sure you are only noticed about a disc one time (I run it every 15th minute and only want to know it once) but notify's you of new errors.
It will use a temporary director in /tmp called tw (/tmp/tw).
This will notice you if you pull a drive and potentially if one of your drives fail (Haven't tested this as I don't have a bad drive... But a failed drive wouldn't have "OK" as a status... So it should notify you).
Installing
Installing is easy. Currently it's onlt distributed in source format, but will run fine on FreeNAS.
Use the following commands to install it:
Code:
cd /tmp wget www.v42.dk/data/code/python2/3ware_info_0.1.py chmod +x 3ware_info_0.1.py
Please note: It will NOT survive a reboot! Haven't found a way to do that yet...
Then I add 2 cron jobs.
One to run every 15th minute using this code: /tmp/3ware_info_0.1.py
One to run every night at 00:00: rm /tmp/tw/tw_last_error
The last cron reset's my "last_error" so I get notified once per day per failed drive.
Epilogue
Hope you can use it.
Currently It only supports 24 drives and 3ware controller. But I bet you can modify it if you need.
If you can't do it yourself, ask me nicely and I'll give it a shot.
EDIT: Oh yeah, I forgot. The output mail will look like this:
Code:
Local Time: Wed Jul 17 16:45:04 2013 DISC WARNING!!! The following disk is not behaving normally: /c0/u4 status = INOPERABLE