[HOWTO] Manage Automatic Daily Email Reports

Status
Not open for further replies.

Varun Chandak

Dabbler
Joined
Jul 20, 2014
Messages
29

Steps:
1.
Enable SSH through the Services Tab and then SSH onto the FreeNAS box as root.
2. Run the command: 'mount -uw /' (don't copy the " ' " characters) - this enables the root filesystem to be written to and persist changes after a reboot
3. Use your favourite text editor (I like nano) to edit a file: 'nano /conf/base/etc/defaults/periodic.conf'
Update line 33
From: daily_output="root"
To: daily_output="/tmp/output.txt"

Update line 163
From: daily_status_security_output="root"
To: daily_status_security_output="/tmp/security.txt"

here you have mounted the / partition in write mode.... Do we have to revert it back to 'mount -ur /' to make it readonly ?
 

Varun Chandak

Dabbler
Joined
Jul 20, 2014
Messages
29
@joeshmuck,

Sorry, I probably should have specified. I'm using the first script posted on this thread. The second, I noticed, makes reference to dated file names, but the author doesn't specify how those files would be created (and named). I believe the script is running correctly because I get an with the contents of the error message in the script. ie:

echo "No daily $OUTPUT file found!" | mail -s "Error: No daily $OUTPUT file produced" root

So, my assumption is that the system is not outputting the contents of the daily reports to the file (as specified by changing values in the periodic.conf file). Thus, since the two files are never created, the script can't find them, and errors. I have double and triple checked my periodic.conf (both), and restarted the system, so I believe that part to be correct.

Edit:

I think I'm an idiot. I just noticed he mentions in the OP that the "mount -uw" is intended to persist through reboots. I've been remounting the root FS read only after my changes, so I'm going to take a wild guess that it's not able to write the files necessary to get emailed via the scheduled job. I've changed the location of the files written to my storage area, and I'll know tonight if it works.
I have set the path to a folder in my volume dataset, that is rw.. isn't it ? and still it doesn't work. :(
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
I have set the path to a folder in my volume dataset, that is rw.. isn't it ? and still it doesn't work. :(
This script is deprecated. I don't know why they haven't removed the stickies on both this thread and the one linking to it in the New to Freenas forum.

Read about how to setup security emails and other emailed reports, I think in CyberJock's guide.

I asked a question about this script a while ago also, here's a post from a post on the last page:
You don't need this script in recent FreeNAS versions. They cut down on the email "spam" and there are no longer daily mails, but instead you only get an email if there is an issue (exactly like the original purpose of this script).

...
 

Varun Chandak

Dabbler
Joined
Jul 20, 2014
Messages
29
This script is deprecated. I don't know why they haven't removed the stickies on both this thread and the one linking to it in the New to Freenas forum.

Read about how to setup security emails and other emailed reports, I think in CyberJock's guide.

I asked a question about this script a while ago also, here's a post from a post on the last page:
thanks for the reply... now i need to look for cyberjock's guide...! :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176

gotenks

Cadet
Joined
Mar 1, 2017
Messages
9
FreeNAS-11.1-U1
Clean installed FreeNAS 10 then moved 20-30TB of data in, then had to upgrade it to v11 and here were are using the latest and greatest stable release, also seeing the same two email notifications on the weekend and then one daily. I am tired of manually deleting them from my inbox and don't want to remove my email because if something serious happens I do want that notification.

Empty security run outputs still are filling up my Inbox here and I just used this solution to locate the lines in /etc/defaults/periodic.conf and see how this goes!
 
Status
Not open for further replies.
Top