Using Cron With Scheduled Reports - Juniper NETWORK AND SECURITY MANAGER 2010.2 - ADMINISTRATION GUIDE REV1 Administration Manual

Table of Contents

Advertisement

Network and Security Manager Administration Guide
794
cd $dir
# Each report in $1 is mailed as an attachment.
/usr/bin/perl -w email.pl -d $1 -o /dev/null
# Each report in $1 is embedded into an email and mailed.
#/usr/bin/perl -w email.pl -d $1 -embed -o /dev/null
# Each report in $1 is attached to a collated message and the collated message
# is mailed
#/usr/bin/perl -w email.pl -d $1 -collate -o /dev/null
# Each report in $1 is embedded into a collated message and the collated message
# is mailed
#/usr/bin/perl -w email.pl -d $1 -collate -embed -o /dev/null
# Don't change this line
exit $?
The required SMTP settings are provided in email.pl.
##################################################################
#
CONFIGURABLE PARAMETERS SECTION (CHANGEABLE)
##################################################################
# From address, don't delete \ before the @ separator
my $from_addr = "user\@localhost.localdomain";
# To address, don't delete \ before the @ separator
my $to_addr = "remote-user\@somewhere.net";
# Email server: not required if sendmail is configured for mail transport
my $email_server = "everywhere.net";
# Subject
my $subject = "Reports are here!";
# Body text for emails with reports as attachments
my $body_text_attach = "Attached reports";
# Body text for emails with reports embedded
my $body_text_embed = "Embedded reports";
# Mail transport agent
my $send_mail_prog = "/usr/sbin/sendmail -t";
# Directory prefix for report directory
my $prefix = "/usr/netscreen/GuiSvr/var";
# Report extension type
my $type = "html";
# Mail output file: Capture sent email in this file, /dev/stdout for screen
my $mail_ofile = "/dev/stdout";
###################################################################
NOTE: The
and
email.pl
emailReports.sh
The actual mailing is done by sendmail or other Mail Transfer Agent (MTA). If you require
authentication to send these reports, you must configure the authentication parameters
as part of the MTA configuration. If you are using the FTP script to send you reports,
you will also need to add values for the remote host, userid and password for the FTP
account in the
ftp.sh
file.

Using Cron with Scheduled Reports

The actual scheduling is done using the cron application. This utility executes scripts at
specific times. It is configured through a file called
command crontab -e. This command invokes the
Entries in the table consist of a command set and a schedule. The command to run the
report is the same as described above.
The timing of the job is determined by a string of numbers preceding the script. There are
five places and they represent, in order:
scripts only do MIME formatting of the reports.
. To edit the file, use the
crontab
editor and opens the crontab table.
vi
Copyright © 2010, Juniper Networks, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Network and security manager 2010.2

Table of Contents