Networker

Re: [Networker] notification variables

2009-12-15 16:32:14
Subject: Re: [Networker] notification variables
From: Gerrit Sere <gerrit AT MILIEUINFO DOT BE>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Tue, 15 Dec 2009 22:29:51 +0100
Hey,

We use a perl script: called "processmail.pl"

#!/usr/bin/perl

# versie 0.1
# 20 mei 2008
# Origional commando:  /usr/ucb/mail -s "backup-master savegroup completion" 
root


@data=localtime;
$datum=sprintf("%s_%02s_%02s_%d",$data[5]+1900,$data[4]+1,$data[3],$$);
$mailTempDirectory="/opt/admin/backup/maillogs";
$mailTemp="$mailTempDirectory/mail_${datum}";
$mailLog="${mailTempDirectory}/mailSend";

# Save the output

open(MAIL,">$mailTemp");
print MAIL while(<STDIN>);
close MAIL;

open(MAIL,"<$mailTemp");

while (<MAIL>) {

        if (/Sun StorageTek\(TM\) Enterprise Backup savegroup:/) {
                @velden=split;
                $savegroep=$velden[6];
                last;
        }
}

close MAIL;

open(LOG,">>${mailLog}");
open(MAIL,"<$mailTemp");

open(SEND,qq{|/usr/bin/mailx -s "backup-master savegroup completion - 
$savegroep" root});

while (<MAIL>) {
        print SEND;
}

print LOG "$savegroep mail sent at ",scalar localtime,"\n";

close MAIL;
close SEND;
close LOG;


Groetjes,
Gerrit

Vlaamse Overheid
Departement Leefmilieu, Natuur en Energie
Afdeling Centraal Databeheer
Graaf de Ferraris-gebouw
Koning Albert II-laan 20
1000 Brussel


Op 2-nov-2009, om 16:31 heeft Chester Martin het volgende geschreven:

> Here's how I do it for linux, not pretty, but it works... 
> 
> - In the owner notification I point it to a script on the networker
> server, I also pass an argument of the server name from the owner
> notification field (Ex. /scriptdirectory/script.sh networkerclient).
> 
> - The job information is stored in "cat" (I have no idea how it gets
> there, it's just there) so I cat>>/scriptdirectory/someoutputfile
> 
> - Then run a mail command with the subject of "Backup of $1 is
> complete."  $1 is the argument (server name) that you passed from the
> owner notification.  I then give the email the "body" of the
> "someoutputfile" file.
> 
> Any server that I don't want an email from, in the place of
> "networkerclient" in the owner notification field I put NoMail, then
> I've coded the script to where if it $1=NoMail it doesn't send an
> email...
> 
> 
> 
> 
> -----Original Message-----
> From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] 
> On
> Behalf Of Alan Rubin
> Sent: Sunday, November 01, 2009 11:27 PM
> To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
> Subject: Re: [Networker] notification variables
> 
> Davina,
> 
> I didn't really want to get that complicated.  Preston De Guise didn't
> want to toot his own horn, but as a customer I can say that the IDATA
> Tools seem to do the job quite well.  I'm going to give the idata-notify
> utility a go as it seems to give us the detail we need.
> 
> Regards, 
> 
> 
> Alan Rubin
> Unix Systems Administrator
> Midrange Server Group, Data Centre Services
> Department of Business and Employment
> Northern Territory Government
> Phone: +61 (08) 8999 5111
> Fax:      +61 (08) 8999 7493
> e-Mail: alan.rubin AT nt.gov DOT au
> 
> -----Original Message-----
> From: Davina Treiber [mailto:Davina.Treiber AT PeeVRo.co DOT uk] 
> Sent: Monday, 2 November 2009 9:20 AM
> To: EMC NetWorker discussion; Alan Rubin
> Subject: Re: [Networker] notification variables
> 
> Alan Rubin wrote:
>> Hello,
>> 
>> We're running 7.4.4 and I was wondering if there is any way to
> generate dynamic information in the subject line when we're mailing
> notifications such as Savegroup completion?  So, instead of the subject
> saying, "nsrserverhost's savegroup completion," it could say something
> like, "5WeekIncremental's savegroup completion."  It's kind of hard to
> pick out specific information when you come into the office on a Monday
> and there are 100 messages sitting in the mailbox all with the exact
> same subject line.  I see in some of the default notification
> configurations the use of variables like '%s', but I don't know where an
> entire list of these variables and their definitions lives.  Any help?
>> 
>> Regards,
>> 
>> Alan Rubin
>> Unix Systems Administrator
>> Midrange Server Group, Data Centre Services
>> Department of Business and Employment
>> Northern Territory Government
>> Phone: +61 (08) 8999 5111
> 
> I'm not sure about lists of variables, but is it possible to extract
> most of the information from the text, so if you pipe the notification
> into a script, you can parse out what you need and re-present the
> message with slight modifications.
> 
> To sign off this list, send email to listserv AT listserv.temple DOT edu and
> type "signoff networker" in the body of the email. Please write to
> networker-request AT listserv.temple DOT edu if you have any problems with 
> this
> list. You can access the archives at
> http://listserv.temple.edu/archives/networker.html or
> via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
> 
> To sign off this list, send email to listserv AT listserv.temple DOT edu and 
> type "signoff networker" in the body of the email. Please write to 
> networker-request AT listserv.temple DOT edu if you have any problems with 
> this list. You can access the archives at 
> http://listserv.temple.edu/archives/networker.html or
> via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Networker] notification variables, Gerrit Sere <=