Networker

[Networker] AW: [Networker] Customising completion notifications

2002-10-21 10:28:09
Subject: [Networker] AW: [Networker] Customising completion notifications
From: Kalbus Johanes <Johanes.Kalbus AT ITELLIUM DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Mon, 21 Oct 2002 16:27:38 +0200
Hi Vince,

I am afraid - in that you are completely on your own. What you need will be
a script that parses the savegroup output for the group and then output the
completion report to different files. That would be the easiest. Below I've
stated how I would write it in perl. It is not tested and might as well
beautified in some cases and of course can be written as a shell script -
but I like perl better :-)

Yours

 Johanes

------------------------------ script starts here
--------------------------------
#!/bin/perl  

require 5.005
 
  open (FILE, "-") || die "$0 ERROR: Cannot read from STDIN.\n";
  @INPUT = <FILE>;
  close (FILE);

## First line of Savegroup Notice looks like that:
## Jul  5 15:06:30 server root: NetWorker Savegroup: (notice) NT_monthly
completed, 10 client(s) (All Succeeded)
##

  @TEMP1 = split /(notice)/, $INPUT[0];  ## Splits the line after (notice)
  @TEMP2 = split / /, $TEMP1[1];         ## Takes the part after (notice)
and splits it up at the spaces
  @GROUPNAME = split /_/, $TEMP2[0];     ## Split the NT_monthly at the
underscore

## This will create a filename of: Logfile_monthly.log

  $Filename = "/path/to/wherever/you/log/Logfile_".$GROUPNAME[1].".log";

## This will append the completion report to the logfile  

  open (FILE, ">>$Filename" ) || die "$0 ERROR: cannot open $Filename for
logging.\n";
  foreach $rawline (@INPUT) {
    print FILE $rawline;
  }
  close (FILE);
------------------------------- script ends here
---------------------------------


-----Ursprüngliche Nachricht-----
Von: Vince Howard [mailto:v.howard AT WANSBECK.GOV DOT UK]
Gesendet: Montag, 21. Oktober 2002 13:06
An: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Betreff: Re: [Networker] Customising completion notifications


> Vince,
>
> Take a look at http://www.gilles.paquet.net/perl/scripts/htmlgen.zip.
>
> It seriously lacks of documentation, but it works, at least
> for me. Don't hesitate to mail me if you have problem.
>
> Gilles.

Gilles,

Thanks for your contribution but, although it works well at what it does,
I'm afraid it doesn't really help me.

Unfortunately I think I may have misled you.  Although I stated that I have
"two 'groups' of backups", what I should have said is I have 2 _sets_ of
groups (consisting of 3 actual savegroups which in turn cover 13 clients).
This means I get the savegroup notifications intermixed so there's no fixed
division between them, e.g.

NetWorker Savegroup: (notice) NT_monthly completed, 6 client(s) (All
Succeeded)
...
NetWorker Savegroup: (notice) Novell_servers completed, 3 client(s) (All
Succeeded)
...
NetWorker Savegroup: (notice) NT_servers completed, 6 client(s) (All
Succeeded)
...
NetWorker Savegroup: (notice) UNIX_monthly completed, 4 client(s) (All
Succeeded)
...

You can see from the above that what I need is a script to filter
'???_server' notifications to 1 file and '???_monthly' notifications to
another.


Best regards,

Vince
_________________________________________
Vince Howard
Programmer/UNIX Systems Administrator
Wansbeck District Council
Front Street West
Bedlington
Northumberland
NE22 5TU
UK

Tel (direct line): +44 (0)1670 843472
fax: +44 (0)1670 843486 / 843484
e-mail: v.howard AT wansbeck.gov DOT uk
----------------------------------------------------------------------------
----------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received this email in error please notify the
originator of the message. This email message has been scanned
for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of  Wansbeck District Council.

--
Note: To sign off this list, send a "signoff" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

--
Note: To sign off this list, send a "signoff" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

<Prev in Thread] Current Thread [Next in Thread>
  • [Networker] AW: [Networker] Customising completion notifications, Kalbus Johanes <=