mail replication joblog

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

dirk adamsky

New Member
Apr 24, 2012
14
0
1
Hello Gea,

I have a omnios+napp-it backup server with paid replication plugin.
The server gives me a daily status mail.
I also like to receive an email with the replication job results.
Is that possible?

Best regards,

dirk adamsky
 

gea

Well-Known Member
Dec 31, 2010
3,173
1,197
113
DE
You would need to edit the script
/var/web-gui/data/napp-it/zfsos/_lib/scripts/job-email.pl
to include content of last log /var/web-gui/_log/jobs/jobs.log
 

kgkfxp

New Member
Mar 25, 2015
9
0
1
54
Hmm anyone have any specific instruction on how to edit this file so that it emails the results on the last replication?
Looks like doing : cat /var/web-gui/_log/jobs/jobs.log |grep replication |head -1
will print out the needed info. I don't know how to have edit job-email.pl such that it will email out the results.
 

gea

Well-Known Member
Dec 31, 2010
3,173
1,197
113
DE
You can use WinSCP to browse and edit files (enable SSH+root in menu services >> SSH)
Then open the mailscript /var/web-gui/data/napp-it/zfsos/_lib/scripts/job-email.pl

and goto line 347 where outputs are collected in $text
and add your log

$text.=&exe("cat /var/web-gui/_log/jobs/jobs.log |grep replication |head -1");

or (see line 349):

If there is a file /var/web-gui/_log/tmp/mail-status.log
it will be added to the status mail so a

&exe("cat /var/web-gui/_log/jobs/jobs.log |grep replication |head -1 >> /var/web-gui/_log/tmp/mail-status.log");

for example done by a user defined autojob does the same
 

kgkfxp

New Member
Mar 25, 2015
9
0
1
54
Thank you . I haved added it to the daily status message. What would be the best way to trigger a status message right after completion of a replication? ( If possible ? )
 

gea

Well-Known Member
Dec 31, 2010
3,173
1,197
113
DE
You can
- modify the status email script
- modify the replication script

- add an "other" job that monitors the replication or check the logs
an send a status mail.This is update save.