[NetBackup] -
原文网址: http://www.samag.com/documents/s=9053/sam0403a/0403a.htm
大概的流程图
+-----------+ collector +-----------+ +-----------+ | NetBackup | script | MySQL | Perl | Chart or | | Catalog |------------->| Database |---------->| Graph | +-----------+ query +-----------+ +-----------+
The main concept is to run a collector script that queries the NetBackup catalog for backup statistics and stores that information in a MySQL database. A second program then uses the backup data in the MySQL database to generate a chart with Perl and the help of GD::Graph::bars. Alternatively, you can use SQL commands to query the MySQL database directly and produce any type of custom report. Figure 1 shows some example output.
Performance data gathered for each backup would include the backup ID, the duration, the client host, the schedule type (full or incremental), the amount of data backed up, the number of files, the kilobytes per second, the policy used, the date the backup started, and the server that initiated the backup. This data can then be queried to help answer such questions as:
- Which system is the best performer?
mysql> select client,kbpersec from backperf order by kbpersec desc limit 1; +------------+----------+ | client | kbpersec | +------------+----------+ | somehost | 24612 | +------------+----------+
- Which systems back up the most data?
mysql> select client,kbytes from backperf order by kbytes desc limit 1; +---------+-----------+ | client | kbytes | +---------+-----------+ | ct01sts | 746335072 | +---------+-----------+
- What is the average number of files being backed up?
mysql> select avg(numfiles) from backperf; +---------------+ | avg(numfiles) | +---------------+ | 102661.9459 | +---------------+
Other questions we could answer include: How long is client X taking to back up? What is the median/average backup time? How many files are the poor performers backing up? Which are the good performers?
These kinds of questions can be answered by analyzing the data shown in the previous examples. Figure 1 shows kilobytes/sec, which helps identify which systems might need attention and provides a good report to check every morning.
The Setup
Now let's get to the nitty-gritty. The first piece in this setup is a MySQL database. This article assumes you have a MySQL server running. Using nbperf.sql(Listing 1), you can create a MySQL table called "backperf" to store your backup performance data.
#mysql -u root -p mysql> create database nbperf (control-d) #cat nbperf.sql | mysql -u root -p nbperf
At this point you have a database (nbperf) with one table (backperf).
The next piece is to put data into the table on a regular basis. Ideally, this would occur as a cron job sometime after the backups are complete (early morning in most cases). Because the collector can run as often as you like, scheduling depends on your environment. The collector, co_backperf.pl (Listing 2), will need to be modified to fit your system environment. Set the $database and $hostname variables to the database you created in the above steps on the MySQL server. You will also need to modify @servers to contain the NetBackup servers on which you want to collect data (i.e., "server1" and "server2"). Going through the listing, the next important thing to note is the $cmd variable. "bpimagelist" is the guts of the output we want to store; every time it runs, it produces a listing of everything in the NetBackup catalog since the "-d" option and includes several important fields. Typical output of this command looks like this:
IMAGE clientname 0 0 6 clientname_1054339491 policyname 0 *NULL* root schedulename 0 5 1054339491 1324 1062374691 0 0 2659008 113017 1 1 0 policyname_1054339491_FULL.f *NULL* *NULL* 0 1 0 0 0 *NULL* 0 0 0 0 0 0 0 *NULL* 0 0 0
Although this looks confusing, co_backperf.pl will parse it. If you want to get a better "user" view of this data, you can add the "-U" flag to the command (but don't change this in the script). If the output of this command contains lines with "IMAGE", a split occurs on whitespace and several fields are noted. In particular, we grab these:
$backupid = $fields[5]; $seconds = $fields[14]; $client = $fields[1]; $schedtype = $fields[11]; $kb = $fields[18]; $num_files = $fields[19]; $kbpersec = ($kb/$seconds); $policy = $fields[6]; $backdate = $fields[13]; $backserver= $host; $backdate = &humantime($backdate);
After noting the important fields, co_backperf.pl will insert an entry into the database for this backup id (field 5 is the backup id). Running the script a second time will produce several failed inserts. This is because entries that are in the database will still appear in the catalog for some time until they expire, but the failed insert will prevent duplicate entries. This is done by a primary key set on the backupid field. Thus, even if the NetBackup catalog expires an entry, its historical performance data is still kept in the MySQL database. Additionally, one could write a co_driveindex.pl that would run bperror commands to collect the drive on which a specific backup id occurred. This is handy for checking the balancing of your drive usage for multiple tape drive configurations. (The drive_index field is unused in this article.)
Attention!!!
Note that I call the primitive rsh in my script, but you can use ssh or any other method. If you run the script locally on the backup server, you could remove the call altogether. One significant improvement would be to switch the command calls to use Net::SSH::Perl or a similar module.
Next, I will cover the representation of this data, which makes for good management meetings. mkimage_backperf.pl (Listing 3) creates an image using GD::Graph and a few other CPAN modules. In the listing, you'll notice $database, $hostname, $user, and $password must modified as with co_backperf.pl. Then, we issue the following query:
SELECT backdate, client, kbpersec, policy, (to_days(now()) - to_days(backdate)) as age FROM nbperf WHERE (to_days(now()) - to_days(backdate)) < 2 $policy_hunt ORDER BY policy DESC
Here we query the backup date, the client, the kilobytes per second, the policy that was used, and the "age", which is calculated with some MySQL functions. This produces a list of rows for backups that occurred within the last 24 hours. The order in which they will appear in the chart is by policy name, descending. Each row is used to build the X and Y axis of the chart, using the GD::Graph to produce the result (see Figure 1). That's it! From this point, you could modify mkimage_backperf.pl to have a different y_max_value if your drives are slower or faster than my drives. The resulting image will be written to an img/ directory, so you need to create that directory before running the script (see Figure 1). Note that, if you don't want all this fancy charting, you could simply run this on the backup server:
/opt/openv/netbackup/bin/admincmd/bperror -all -hoursago 24 \
|grep "wrote backup" | \
awk {'print $1 " " $15 " " $20'} | sed 's/,//g'
This command would give you the backup jobs and speeds from the last 24 hours. You could then store or chart these results as you like. You could also use Excel or another charting program once you have the data in the database.
Assumptions
You'll need to install the Perl modules GD::Graph and DBI/DBD::mysql and have a MySQL installation available for use. Also, note that the kilobytes per second that is calculated does not take into account whether a tape needs to be switched. This field is calculated as kilobytes backed up / seconds. You could run bperror commands and change your collector to use the actual tape speeds, but in my case a library switches tapes rather rapidly and the value is close enough to get a good picture. Besides, if a backup were slow because a drive wasn't free, or the tape wasn't found for a while, I'd want to know.
Alternatives
Veritas has a product called NetBackup Advanced Reporter, which provides reporting capabilities for backup data. I did not review this portion of NetBackup since I didn't know it existed until after I began creating my own scripts. I think the product requires a separate license, and users looking for a more supportable solution might check into this product. The co_backperf.pl would break if future versions of NetBackup changed the format of the output, but then so would a lot of other systems administration scripts that have been written around NetBackup over the years.
Conclusion
Although Veritas NetBackup provides various command-line utilities for acquiring backup statistics, there is almost always the need to tie this data into another database or use open source tools to do something with the data. MySQL acts as a good starting point for storing the data because of its simplicity and availability. Perl makes sense for parsing the output of the various NetBackup commands, and GD::Graph works well to make simple graphs. The most difficult part of this setup is getting GD::Graph to install on a Solaris system but the module is used widely enough that you can find help to work through the quirks.
The Author
Jerry Uanino holds a B.S. in Computer Information Systems from Marist College and has worked for IBM, US Internetworking, Enterasys Networks, and most recently Factset Research Systems. He can be reached at: juanino@yahoo.com.
=========================================
-- -- Table structure for table 'backperf' -- CREATE TABLE backperf ( backupid varchar(50) NOT NULL default '', seconds int(11) NOT NULL default '0', client varchar(30) NOT NULL default '', schedtype varchar(30) NOT NULL default '', kbytes bigint(20) NOT NULL default '0', numfiles bigint(20) NOT NULL default '0', kbpersec int(11) NOT NULL default '0', policy varchar(40) NOT NULL default '', backdate datetime NOT NULL default '0000-00-00 00:00:00', backserver varchar(40) default NULL, drive_index int(11) default NULL, PRIMARY KEY (backupid) ) TYPE=MyISAM;
Listing 2 co_backperf.pl
#!/usr/bin/perl -w
# purpose: collect bpimage output
# and store in db
use DBI;
use Data::Dumper;
use strict;
my $success = 0;
my $failure = 0;
my @failures;
# Connect to DB
my $database = 'nbperf';
my $hostname = 'databaseserver';
my $dsn = "DBI:mysql:database=$database;host=$hostname";
my $user = 'database_user';
my $password = 'password';
my $dbh = DBI->connect($dsn, $user, $password);
# list the systems to collect data on
my @systems = ('server1','server2');
foreach my $system (@systems) {
my $host=$system;
print "\n--> Trying $host \n";
my $local_user="root";
my $remote_user="root";
# get all image data since 1980 aka everything
my $cmd=" /opt/openv/netbackup/bin/admincmd/bpimagelist -d 01/01/1980";
my $query = qq{
};
my @lines;
if (@lines = `rsh $host $cmd`) {
$success++;
print "Parsing, $host, stage 1: ";
print "Got " . scalar(@lines) . " lines \n";
foreach my $line (@lines) {
my ($backupid, $seconds, $client, $schedtype, $kb, $num_files);
my ($kbpersec, $policy, $backdate, $backserver);
if ($line =~ /IMAGE/) {
my @fields;
(@fields) = split(/\s+/,$line);
$backupid = $fields[5];
$seconds = $fields[14];
$client = $fields[1];
$schedtype = $fields[11];
$kb = $fields[18];
$num_files = $fields[19];
$kbpersec = ($kb/$seconds);
$policy = $fields[6];
$backdate = $fields[13];
$backserver= $host;
$backdate = &humantime($backdate);
print "Updating database... \n";
$query = qq{
INSERT INTO backperf
(backupid, seconds, client, schedtype, kbytes,
numfiles, kbpersec, policy, backdate, backserver)
values
('$backupid', '$seconds', '$client', '$schedtype',
'$kb', '$num_files', $kbpersec, '$policy',
'$backdate', '$backserver')
};
print $query;
my $sth = $dbh->prepare($query);
$sth->execute;
} # end up line record for each image
}
} else {
$failure++;
push(@failures, $host);
}
}
print "Total success: $success \n";
print "Total fails: $failure \n";
($failure>0) && print "Failed systems: @failures \n";
#################
sub humantime {
# convert a unix time to human readable time
my $time_req = shift;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = \
localtime($time_req);
$year = 1900+$year;
$mon++;
my $humantime = "$year-$mon-$mday $hour:$min:$sec \n";
return $humantime;
}
#!/usr/bin/perl -w
# purpose: make graphs for backperf table
use DBI;
use Data::Dumper;
use GD::Graph::bars;
use CGI qw/:standard *table/;
use strict;
my $policy_hunt = $ARGV[0];
if ($policy_hunt) {
$policy_hunt = qq{
AND policy = '$policy_hunt'
};
}
my $success = 0;
my $failure = 0;
my @failures;
# Connect to DB
my $database = 'nbperf';
my $hostname = 'databaseserver';
my $dsn = "DBI:mysql:database=$database;host=$hostname";
my $user = 'database_user';
my $password = 'password';
my $dbh = DBI->connect($dsn, $user, $password);
my @y;
my @x;
# get data from the last 1 days
my $timespan = " 24 hours ";
my $query = qq {
SELECT backdate, client, kbpersec, policy,
(to_days(now()) - to_days(backdate)) as age
FROM backperf WHERE
(to_days(now()) - to_days(backdate)) < 2
$policy_hunt
ORDER BY policy DESC
};
my $sth = $dbh->prepare($query);
$sth->execute;
my $rows = $sth->rows;
unless ($rows > 0) {
$query = qq{
SELECT backdate, client, kbpersec, policy,
(to_days(now()) - to_days(backdate)) as age
FROM backperf WHERE
(to_days(now()) - to_days(backdate)) < 4
$policy_hunt
ORDER BY policy DESC
};
$sth = $dbh->prepare($query);
$sth->execute;
$timespan = " 3 days";
}
while (my $hash_ref = $sth->fetchrow_hashref) {
my $backdate = $hash_ref->{backdate};
my $client = $hash_ref->{client};
my $kbpersec = $hash_ref->{kbpersec};
my $policy = $hash_ref->{policy};
push(@x, "$client - $policy");
push(@y, $kbpersec);
}
# make and save graph
my $graph = GD::Graph::bars->new(800,400);
my $x_ref = \@x;
my $y_ref = \@y;
my @data = (
$x_ref, $y_ref
);
$graph->set(
x_label => 'host - policy',
y_label => 'kb/sec',
x_labels_vertical => 1,
title => "Backup Speeds in Last $timespan",
y_max_value => 25000,
y_tick_number => 100,
y_label_skip => 30
);
my $format = $graph->export_format;
open(IMG,">img/backperf.png");
binmode IMG;
my $pic = $graph->plot(\@data);
print IMG $pic->png;
[NetBackup] -
Troubleshooting email notification can be difficult, due to the fact that no output is displayed. The best way to determine if the nbmail.cmd script and Blat are working correctly is to remove the -q from the end of the Blat command and redirect the output of the command to a text file.
For example,
- Original Blat command from the nbmail.cmd script:
@blat %3 -s %2 -t %1 -i NetBackup -q
- Modified Blat command used for troubleshooting:
@blat %3 -s %2 -t %1 -i NetBackup >C:\nbmail_test.txt
This change will output exactly what the Blat utility is sending to the mail server and should return any errors that the server returns.
Below is an example of the output:
Sending C:\WINNT\TEMP\nb_AC6.tmp to email_address@veritas.com Subject:NetBkup on test client - 150 started Login name is user.name@veritas.com
[NetBackup] -
Top ten reasons why nbmail can fail:
- BLAT is commented out in the nbmail.cmd script -- remove the '@rem' from in front of the BLAT command.
- No email address configured or email address incorrectly configured on Universal Settings tab.
- The BLAT line in nbmail.cmd is not correctly configured; syntax has changed in the later versions -- check the readme for your version of BLAT.
- BLAT is not on the path, and no path was specified in nbmail.cmd -- place the blat.exe program in a directory on your path, or add the path before BLAT in the script.
- BLAT version is greater than 1.84, and no profile was created -- see the BLAT readme for details on profiles.
- Mail account did not exist on email server -- create the account.
- Mail server required authentication for Simple Mail Transfer Protocol (SMTP), and the account used for VERITAS NetBackup (tm) client process is not authorized -- change user account for NetBackup Client Service (default is local system, which may not have permission to send mail).
- BLAT sometimes needs the -ti <n> timeout parameter if there are delays in the system -- <n> is in seconds.
- Command line extensions are not enabled -- The registry key HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions should be set to 0x1.
- BLAT binary is corrupt or incompatible with email system -- download a newer version.
如何查看 NetBackup 程序调用了 nbmail.cmd 呢?
答案是通过setting up the BPCD log。具体步骤如下:
- Select Client sends mail on Universal Settings tab (properties on the master server). The option Server sends mail does not log anything in the BPCD log, so even if you require this option, test it with the Client setting first.
- Make sure that an email address is configured on the Universal Settings tab.
- Make sure the call to BLAT is uncommented in the nbmail.cmd script.
- Make sure that a directory called BPCD exists in NetBackup\Logs on the master server.
- a. For NetBackup 3.4 only: Launch the NetBackup client, click Actions | Configure and go to the Troubleshooting tab. Enter 2 for General and 9 for Verbose.
b. For NetBackup 4.5 only - Launch the Backup, Archive and Restore program, click File | NetBackup Client Properties and go to the Troubleshooting tab. Enter 2 for General and 5 for Verbose. - Re-start the NetBackup Client Service to make sure these settings take effect.
- Run a backup of a directory on the master server.
- The BPCD log should contain something similar to the following:
07:34:04.128 [3864.4052] <2> bpcd main: BPCD_SEND_MAIL_RQST
07:34:04.128 [3864.4052] <2> bpcd main: mailaddr = joe.bloggs@veritas.com
07:34:04.128 [3864.4052] <2> bpcd main: subject = Backup on MYMASTER - 0 started
07:34:04.128 [3864.4052] <2> bpcd main: message = Backup on client MYMASTER by root succeeded.
File list
---------
C:\WINNT\system32\drivers\etc
07:34:04.128 [3864.4052] <2> sendViaScript: attempting to send mail
07:34:04.198 [3864.4052] <2> bpcd main: BPCD_DISCONNECT_RQST
If you don't see this in the log, then nbmail is not being called, and you have a configuration problem within NetBackup itself. If you see the entries in the log, but receive no email, then verify whether the email address is correct and valid. If the email address is correct, then the problem lies either with the nbmail.cmd script itself, or with BLAT.
Troubleshooting BLAT:
The later versions of BLAT (from version 1.82 onwards) use profiles. The idea is that you configure your user or server and any other settings for the mail system in a profile and then just specify this when you use the command. The following technote describes this: http://support.veritas.com/docs/244258
So an appropriate change in nbmail.cmd would be to change the BLAT line as follows:
@blat %3 -s %2 -t %1 -p NetBackup -q
where NetBackup is a profile you created.
When testing BLAT, you need to remove the -q switch and pipe the output to a file; you could replace the above line with:
@echo:Testing %1 ,%2 ,%3 >>C:\Testing.txt <blat> %3 -s %2 -t %1 -p NetBackup>>c:\Testing.txt
*** Note the emission of -q switch ***
When you test nbmail.cmd from the command line, it is helpful to use the same account that NetBackup client service is using, this will help highlight any account permission issues that may stop the process from working.
[NetBackup] -
看了一下 这篇文章,似乎意思是 Catalog 本身属于数据文件,如果单纯就查看 catalog 内容来看,可以还原到其他机器上查看 catalog 内容,如果要在其他机器上使用这个 catalog,那就必须设定 hostname 和 IP 与原机器一致了。
Master server 上包含以下 NetBackup catalog 文件:
- install_path\NetBackup\db 【 ntbbkp03 上大概 13.4 G 】
- install_path\NetBackup\var 【 ntbbkp03 上大概 23.6 K 】
- install_path\Volmgr\database 【 ntbbkp03 上大概 664 K 】
Media server 上包含以下 NetBackup catalog 文件:
- install_path\netbackup\db\media
- install_path\netbackup\var
- install_path\volmgr\database
我查看了一下, install_path\NetBackup\db 这个目录下的 images 文件夹最大,包含了所有 clent 的 image 信息。
可以利用 bprecover 命令恢复 Catalog 信息(恢复 Catalog 前需要重新安装 NetBackup 软件。)
如何确定 Catalog 的最新备份呢?
Little Hint
Before you can recover the NetBackup catalogs, you must know which media ID has their latest backups. Without this media ID, you cannot accurately recover your catalogs and your only option is to use the NetBackup import feature to import all lost backup records into your NetBackup catalog (see the NetBackup System Administrator’s Guide, Volume I).
时刻得知最新的 catalog 备份的介质信息的方法是配置 email 通知,这样在每次 catalog 备份后会发一封邮件通知管理员。
如果事先知道具体是哪些 media 备份了 Catalog,但是不能确认到底哪个 media 上的是最新的,可以使用 bprecover -l 命令,列出具体某一个 media 上的备份信息包括具体的时间和数据信息。
示例 1:使用原始设备列出
假定将目录备份到磁带,但是目录的“介质管理器部分”丢失,因此介质管理器无法控制驱动器。
在这种情况下,请将介质插入到适当的驱动器中(假定原始设备路径为 \\.\Tape1)。然后,在拥有该驱动器的 NetBackup 服务器上执行以下 bprecover 命令。
bprecover -l -tpath \\.\Tape1 Database Backup Information from \\.\Tape1 Created: 03/31/97 11:31:34 Server: bphost Block Size: 32768 Path ---- IMAGE1 D:\apps\VERITAS\NetBackup\db IMAGE2 D:\apps\VERITAS\Volmgr\database
示例 2:使用介质管理器控制的驱动器列出
假定目录的“介质管理器部分”完好无损,且备份将存储到介质 ID 为 000001 的 dlt 磁带上。将该磁带插入到相应的驱动器中。然后,在拥有该驱动器的 NetBackup 服务器上执行以下bprecover 命令(NetBackup 设备管理器服务必须是活动的)。
bprecover -l -ev 000001 -d dlt Database Backup Information from 000001 Created: 03/31/97 05:50:51 Server: bphost Block size: 32768 Path ---- IMAGE1 D:\apps\VERITAS\Netbackup\db IMAGE2 D:\apps\VERITAS\Volmgr\database IMAGE3 D:\apps\VERITAS\NetBackup\var
示例 3:列出磁盘路径
假定目录备份的目标磁盘路径为 D:\apps\dbbackup,而此磁盘没有故障。执行以下 bprecover 命令列出备份信息。
bprecover -l -dpath D:\apps\dbbackup Database Backup Information from D:\apps\dbbackup Created: 03/31/97 11:31:34 Server: bphost Block size: 32768 Path ---- IMAGE1 D:\apps\VERITAS\NetBackup\db IMAGE2 D:\apps\VERITAS\NetBackup\var IMAGE3 D:\apps\VERITAS\Volmgr\database
bprecover 命令语法
bprecover: -l -m media_ID -d density [-v]
-l -tpath [-v]
-l -dpath [-v]
-l -opath [-v]
-r [ALL|image_number] -m media_ID -d density [-stdout] [-dhost ] -v]
-r [ALL|image_number] -tpath [-stdout] [-dhost ] [-v]
-r [ALL|image_number] -dpath [-stdout] [-dhost ] [-v]
-r [ALL|image_number] -opath [-stdout] [-dhost ] [-v]
恢复 NetBackup catalog 的过程
恢复目录所需的方法取决于:
- 包含 NetBackup 目录备份的介质类型(磁带或磁盘)。
- 那些目录的介质管理器部分是否仍完好无损。介质管理器目录文件通常在install_path\Volmgr\database 目录中。
Attention!!
介质管理器设备目录是二进制文件,您无法将它们恢复到不同类型的平台上。
恢复 Catalog 的准备工作
- 重新安装 NetBackup 软件(如果需要)。
- 查找包含最新目录备份的磁带。
- 确保您要恢复目录的磁盘包含 catalog 所在的目录。
这是必需的,因为 bprecover 命令总是将 NetBackup 目录恢复到从中备份这些目录的路径(不允许使用其他路径进行恢复)。
在介质管理器目录丢失的情况下从磁带恢复目录
如果 NetBackup 目录备份在磁带上,且介质管理器目录已丢失,请在 bprecover 命令中指定原始设备路径。此方法涉及在驱动器中安装备份磁带和使用 -tpath 参数。
Attention!!!
如果您计划用于恢复的设备的配置丢失,请按照 Windows 系统文档中的说明重新安装该设备。
使用 robtest 得到的 ntbbkp03 上的 tape 信息
E:\Program Files\VERITAS\Volmgr\bin\tldtest.exe -r \\.\Changer0 -d1 Tape0 -d2 Tape1 -d3 Tape2 -d4 Tape3 E:\Program Files\VERITAS\Volmgr\bin\tldtest.exe -r \\.\Changer1 -d1 Tape4 -d2 Tape5 -d3 Tape6 -d4 Tape7
使用 robtest 得到的 ntbbkp04 上的 tape 信息
C:\Program Files\VERITAS\Volmgr\bin\tldtest.exe -r \\.\Changer0 -d1 Tape0 -d2 Tape1 -d3 Tape2 -d4 Tape3
[NetBackup] -
blat -to xnming21@163.com -cc xnming21@hotmail.com -subject test -body "This is a test." -attach 20070523.txt
具体语法如下
Blat v2.5.0 w/GSS encryption (build : Sep 14 2005 22:46:29)
Win32 console utility to send mail via SMTP or post to usenet via NNTP
by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde
http://www.blat.net
syntax:
Blat <filename> -to <recipient> [optional switches (see below)]
Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q]
Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
Blat -h
-------------------------------- Installation ---------------------------------
-install[SMTP|NNTP|POP3] <server addr> <sender's email addr> [<try n times>
[<port> [<profile> [<username> [<password>]]]]]
: set server, sender, number of tries and port for profile
(<try n times> and <port> may be replaced by '-')
port defaults are SMTP=25, NNTP=119, POP3=110
default profile can be specified with a '-'
username and/or password may be stored to the registry
order of options is specific
use -installNNTP for storing NNTP information
use -installPOP3 for storing POP3 information
(sender and try are ignored, use '-' in place of these)
--------------------------------- The Basics ----------------------------------
<filename> : file with the message body to be sent
if your message body is on the command line, use a hyphen (-)
as your first argument, and -body followed by your message
if your message will come from the console/keyboard, use the
hyphen as your first argument, but do not use -body option.
-of <file> : text file containing more options (also -optionfile)
-to <recipient> : recipient list (also -t) (comma separated)
-tf <file> : recipient list filename
-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
-cf <file> : cc recipient list filename
-bcc <recipient>: blind carbon copy recipient list (also -b)
(comma separated)
-bf <file> : bcc recipient list filename
-maxNames <x> : send to groups of <x> number of recipients
-ur : set To: header to Undisclosed Recipients if not using the
-to and -cc options
-subject <subj> : subject line, surround with quotes to include spaces(also -s)
-ss : suppress subject line if not defined
-sf <file> : file containing subject line
-body <text> : message body, surround with quotes to include spaces
-sig <file> : text file containing your email signature
-tag <file> : text file containing taglines, to be randomly chosen
-ps <file> : final message text, possibly for unsubscribe instructions
----------------------------- Registry overrides ------------------------------
-p <profile> : send with server, user, and port defined in <profile>
: use username and password if defined in <profile>
-profile : list all profiles in the Registry
-server <addr> : specify SMTP server to be used (optionally, addr:port)
-serverSMTP <addr>
: same as -server
-serverNNTP <addr>
: specify NNTP server to be used (optionally, addr:port)
-serverPOP3 <addr>
: specify POP3 server to be used (optionally, addr:port)
when POP3 access is required before sending email
-f <sender> : override the default sender address (must be known to server)
-i <addr> : a 'From:' address, not necessarily known to the server
-port <port> : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP <port>: same as -port
-portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119)
-portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110)
-u <username> : username for AUTH LOGIN (use with -pw)
-pw <password> : password for AUTH LOGIN (use with -u)
-pu <username> : username for POP3 LOGIN (use with -ppw)
-ppw <password> : password for POP3 LOGIN (use with -pu)
---------------------- Miscellaneous RFC header switches ----------------------
-organization <organization>
: Organization field (also -o and -org)
-ua : include User-Agent header line instead of X-Mailer
-x <X-Header: detail>
: custom 'X-' header. eg: -x "X-INFO: Blat is Great!"
-noh : prevent X-Mailer/User-Agent header from showing Blat homepage
-noh2 : prevent X-Mailer header entirely
-d : request disposition notification
-r : request return receipt
-charset <cs> : user defined charset. The default is ISO-8859-1
-a1 <header> : add custom header line at the end of the regular headers
-a2 <header> : same as -a1, for a second custom header line
-dsn <nsfd> : use Delivery Status Notifications (RFC 3461)
n = never, s = successful, f = failure, d = delayed
can be used together, however N takes precedence
-hdrencb : use base64 for encoding headers, if necessary
-hdrencq : use quoted-printable for encoding headers, if necessary
-priority <pr> : set message priority 0 for low, 1 for high
----------------------- Attachment and encoding options -----------------------
-attach <file> : attach binary file(s) to message (filenames comma separated)
-attacht <file> : attach text file(s) to message (filenames comma separated)
-attachi <file> : attach text file(s) as INLINE (filenames comma separated)
-embed <file> : embed file(s) in HTML. Object tag in HTML must specify
content-id using cid: tag. eg: <img src="cid:image.jpg">
-af <file> : file containing list of binary file(s) to attach (comma
separated)
-atf <file> : file containing list of text file(s) to attach (comma
separated)
-aef <file> : file containing list of embed file(s) to attach (comma
separated)
-base64 : send binary files using base64 (binary MIME)
-uuencode : send binary files UUEncoded
-enriched : send an enriched text message (Content-Type=text/enriched)
-unicode : message body is in 16- or 32-bit Unicode format
-html : send an HTML message (Content-Type=text/html)
-alttext <text> : plain text for use as alternate text
-alttextf <file>: plain text file for use as alternate text
-mime : MIME Quoted-Printable Content-Transfer-Encoding
-8bitmime : ask for 8bit data support when sending MIME
-multipart <size>
: send multipart messages, breaking attachments on <size>
KB boundaries, where <size> is per 1000 bytes
-nomps : do not allow multipart messages
---------------------------- NNTP specific options ----------------------------
-groups <usenet groups>
: list of newsgroups (comma separated)
-------------------------------- Other options --------------------------------
-h : displays this help (also -?, /?, -help or /help)
-q : suppresses all output to the screen
-debug : echoes server communications to a log file or screen
(overrides -q if echoes to the screen)
-log <file> : log everything but usage to <file>
-timestamp : when -log is used, a timestamp is added to each log line
-ti <n> : set timeout to 'n' seconds. Blat will wait 'n' seconds for
server responses
-try <n times> : how many times blat should try to send (1 to 'INFINITE')
-binary : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
body
-hostname <hst> : select the hostname used to send the message via SMTP
this is typically your local machine name
-raw : do not add CR/LF after headers
-delay <x> : wait x seconds between messages being sent when used with
-maxnames or -multipart
-comment <char> : use this character to mark the start of commments in
options files and recipient list files. The default is ;
-superdebug : hex/ascii dump the data between Blat and the server
-superdebugT : ascii dump the data between Blat and the server
-------------------------------------------------------------------------------
Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.
Optionally, the following options can be used instead of the -f and -i
options:
-mailfrom <addr> The RFC 821 MAIL From: statement
-from <addr> The RFC 822 From: statement
-replyto <addr> The RFC 822 Reply-To: statement
-returnpath <addr> The RFC 822 Return-Path: statement
-sender <addr> The RFC 822 Sender: statement
For backward consistency, the -f and -i options have precedence over these
RFC 822 defined options. If both -f and -i options are omitted then the
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
default sender address.
[NetBackup] -
原文网址http://seer.entsupport.symantec.com/docs/254809.htm
BLAT is a open source utility and the most recent version of BLAT can be downloaded from this site: http://sourceforge.net/projects/blat/
I. Installing and Configuring the BLAT executable
- Download the .ZIP file from the download page specified above
- Extract the files to their own folder.
Note: Most of the files in this .ZIP file are informational and is source code for developmental purposes. - Copy the blat.exe file to the \WINNT\System32 directory in Windows
- From a command prompt, run the following command (Note: This will be the primary account that will send the emails from the specified server):
% blat -install <server addr> <sender's addr>
Note: "<server addr>" is the hostname or IP address of the email server that will send the email notifications.
"<sender's addr>" is the account that will be the primary sender of the email notifications.
Example:
% blat -install emailserver.company.com useraccount@company.com
- Test the installation of blat by creating a text file C:\testfile.txt with a message and emailing it to the NetBackup administrator.
% blat C:\testfile.txt -s test_subject -to useraccount@company.com
If blat is working correctly, the NetBackup administrator should receive the contents of the C:\testfile.txt file.
II. Configuring the nbmail.cmd script
- Open nbmail.cmd using notepad.exe or some other text editor. The file can be found on a NetBackup Server/Client install for Windows at <install_path>\VERITAS\NetBackup\bin.
Please make a backup copy of this script before modifying it.
Note: When using Notepad to modify a script do not use the Word Wrap option. If this option is enabled, then it will need to be unchecked. Using this option can result in extra line feeds being added to the script which will render it non-functional.
- Most of the lines in the nbmail.cmd file are informational. The following line(s) are what need to be adjusted:
For NetBackup 4.5 and 5.x systems find the line:
@rem @blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q
For NetBackup 6.0 systems find the section:
@REM @IF "%~4"=="" ( @REM blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q @REM ) ELSE ( @REM blat %3 -s %2 -t %1 -i NetBackup -server WARTHOG -q -attach %4 @REM )
- Remove "@rem" from the beginning of each line. This will activate the sections needed for blat to run.
- Replace "WARTHOG" with the name of the email server. An example of how this line should now appear is:
Example on NetBackup 4.5 and 5.x systems:
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q
Example on NetBackup 6.0 systems:
@IF "%~4"=="" ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q ) ELSE ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 )
- Save the nbmail.cmd file
- Example of an email sent by NetBackup using blat:
Backup on client
Options explained:by root was partially successful. File list --------- C:\Documents and Settings
- %3 is the file that BLAT will send in the body of the email. This is generated by one of the other scripts, backup_notification.cmd for example.
- -s is the subject line of the email
- %2 is the contents of the subject line. This is generated by another script that calls on blat, backup_notification.cmd, for example.
- -t is who will receive the email.
- %1 - is the email address. This is by default the contents of the Email Address for the administrator of this NetBackup Client field.
- -i is the "From" portion of the email. This is not necessarily known to the email server. In this case it will be "From NetBackup."
- -server is the name of the SMTP server to use.
- -q will suppress all output to the screen.
III. Configure NetBackup to use email notification
To allow a master server to send emails for all failed client backups that end with a non-zero status, do the following:
- Open the NetBackup Administration Console
- Open the Host Properties for the master server and go to the Global Attributes tab
- At the bottom of this page, enter the email address for the NetBackup administrator in the field called Administrator e-mail address: (separate multiple entries with commas)
To allow a specific client to send emails for all successful and failed jobs, do the following:
- Open the NetBackup Administration Console
- Open the Host Properties for the Client and go to the Universal Settings tab
- Under the Administrator section of this page, enter the email address for the NetBackup administrator in the field called Client Administrator's e-mail (separate multiple entries with commas)
NetBackup should send email notifications at this point. To get more information sent to the administrator configure some of the <install_path>\VERITAS\NetBackup\bin\*.cmd files. This would result in additional information for the administrator.
IV. Additional ways to use BLAT and nbmail.cmd
Sending to multiple users can be done in two ways: by creating an administrative group SMTP account on an email server and configuring NetBackup and nbmail.cmd to use that SMTP address, or by configuring the nbmail.cmd file to send to multiple users.
Providing more email address for BLAT can be done by adding additional email addresses after the %1 in the nbmail.cmd file. Here is an example of the syntax required:
Example on NetBackup 4.5 and 5.x systems:
@blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q
Example on NetBackup 6.0 systems:
@IF "%~4"=="" ( blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q ) ELSE ( blat %3 -s %2 -t %1,name1@acme.com,name2@acme.com,name3@acme.com -i NetBackup -server emailserver.company.com -q -attach %4 )
Configured this way, four emails will be sent out. It is important to separate the email addresses with commas (,) and no spaces in between.
V. Troubleshooting BLAT
- It may be necessary to do some troubleshooting of BLAT. If BLAT is run from a straight command line, and it has an error, it will produce a message in the command line results. To make a "log" file for BLAT, make an entry at the end of the nbmail.cmd "@blat" line similar to this:
Example on NetBackup 4.5 and 5.x systems:
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q >>"C:\program files\veritas\netbackup\logs\blat.out.txt"
Example on NetBackup 6.0 systems:
@IF "%~4"=="" ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q >>"C:\program files\veritas\netbackup\logs\blat.out.txt" ) ELSE ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 >>"C:\program files\veritas\netbackup\logs\blat.out.txt" )
This will create a .txt file in the specified directory and will append to the bottom of that file. If there is an error message from BLAT it will show in the specified file.
- There have been instances where email notification is working, but Vault will not send reports correctly. To correct this, a modification to the "blat" line in the nbmail.cmd file is necessary. If you are experiencing this, make the following modification to the nbmail.cmd file:
Example on NetBackup 4.5 and 5.x systems:
@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -mime
Example on NetBackup 6.0 systems:
@IF "%~4"=="" ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -mime ) ELSE ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 -mime )
- There have been instances where email notification is configured correctly, BLAT is configured correctly, but emails are not received. Try making the following modification to the nbmail.cmd file:
Example on NetBackup 4.5 and 5.x systems:@blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -enriched
Example on NetBackup 6.0 systems:
@IF "%~4"=="" ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -enriched ) ELSE ( blat %3 -s %2 -t %1 -i NetBackup -server emailserver.company.com -q -attach %4 -enriched )
Related Documents:
248387: Will VERITAS NetBackup (tm) 4.5 work with command line Simple Mail Transfer Protocol tools other than BLAT?256043: DOCUMENTATION: The nbmail.cmd mail notification -- a mini workshop with troubleshooting tips and details of how to get it working
268192: VERITAS NetBackup (tm) 5.1 System Administrator's Guide, Volume I for Windows
268610: DOCUMENTATION: How to configure email notification and the different methods to email backup exit statuses from a UNIX master in NetBackup
[SMS & SCCM] -
SCCM 2007 Beta 对 Site Servers 和 SMS clients 的软硬件要求不同。
Site Server 的硬件要求:
CPU: 750 MHz processor (2.0 GHz or faster recommended)
RAM: 256 MB minimum (1024 MB recommended)
硬盘空间: 2 GB minimum (5 GB free recommended if using operating system deployment)
Site Server 的软件要求:
Win2003 SP1 or later
Win2003 R2Vista is required for the system health validator point site role
SMS site Server 的一些其他方面的软件要求:
必须安装 IIS 6.0 or later,如果 Site Server 需要执行以下角色:
1. Background Intelligent Transfer Service (BITS)-enabled distribution point (requires BITS server and Web Distributed Authoring and Versioning [WebDAV] extensions)
2. Management point (requires BITS server and WebDAV extensions)
3. State migration point (requires BITS server and WebDAV extensions)
4. Reporting point (requires Active Server pages)
5. Server locator point
6. All SMS distribution point systems using BITS bandwidth throttling require BITS 2.0 or later.
7. System health validator points require that the Network Policy Server service is enabled.
8. The SMS site database server requires Microsoft SQL Server 2005 or SQL Server 2000 SP3a or later.
9. All site systems require Internet Explorer 5.0 or later.
10. All site servers must be a member of a Windows 2000 or Windows 2003 Active Directory domain.
11. SMS primary site servers, secondary site servers, and any computers running the SMS Administrator console require Microsoft Management Console (MMC) 3.0, which is available at Microsoft Management Console 3.0.
12. All computers running the SMS Administrator console require the .NET Framework 2.0
SMS Client 硬件要求:
CPU: 233 MHz or faster processor
RAM: 128 MB minimum, 256 MB or more recommended, 384 MB RAM required if using operating system deployment
硬盘空间: 80 MB
SMS Client 软件要求:
Win2000 SP4 or later
WinXP SP1 or later
Win2003 SP1 or later
Win2003 R2
所有系统上的 Internet Explorer 都必须在 5.0 版以上

