Mabuhay

Hello world! This is it. I've always wanted to blog. I don't want no fame but just to let myself heard. No! Just to express myself. So, I don't really care if someone believes in what I'm going to write here nor if ever someone gets interested reading it. My blogs may be a novel-like, a one-liner, it doesn't matter. Still, I'm willing to listen to your views, as long as it justifies mine... Well, enjoy your stay, and I hope you'll learn something new because I just did and sharing it with you.. Welcome!
Showing posts with label configuration files. Show all posts
Showing posts with label configuration files. Show all posts

Wednesday, November 18, 2009

Perl-icious: Function that reads from a config file

I was asked by my colleague to make a function he'll use for one of our scripts - to make our lives easier which I don't think won't happen unless THEY get rid of the night effin' shift! Anyway, it took me sometime to figure this out (I'm learning ok?!) and then I sought the help of a resident guru BE (his initial you idiot!).

Background:

I was to read the NetAgent configuration file and determine if the server is an MDH or P2PS (this is about RMDS). Another was from the RMDS config file to do the same, which means I got to make two.

Apologies but I cannot post config files here. But I believe you can easily understand how it process things.

Here is the code - as a standalone:

sub inNetAgentConfig {

my $host = shift;
my $conf_file = "/path/to/config.file";

open FH, $conf_file or die "Error: $!\n";
$/ = "ATTRIBUTES"; # set the line delimiter to ATTRIBUTES instead of default value of newline; see special variables
my @array = <FH>;

if ( grep {/$host/} $conf_file ) {
foreach my $line ( grep {/$host/} @array ) {
if ( $line =~ /GROUP=(\w+)/ ) {
return $1;
}
}
} else {
return "Non-existent";
}
}


Another function that I made:


sub inRmdsConfig {

my $host = shift;
my $rmds_file = "/path/to/config.file";

open FILE, $rmds_file or die "Error: $!\n";
while (<FILE>) {
chomp ( $_ );

if ( $_ =~ /^$host\*(\w+)\*serverId.?/ ) {
return $1;
} else {
return "Non-existent";
}
}

Wednesday, February 04, 2009

Veritas NetBackup Tutorial: Changes in bp.conf

Aha! Like a li'l child on his first day in school, I was excited. That's me. When I encounter problems/errors I can't help but get excited looking for solutions, the flame of eagerness to learn. Of course, these are limited instances. As for today, it will on modifications in bp.conf. A good friend asked me if changes be made on the config file needs to re-read them. Since I am NOT familiar with this nor had the experience, I provided no answer [sorry but, my shift is up and just want to go home, ha ha]. But, this doesn't mean that I'll just lay down and die. Not me! When I got home, I searched for the solution. I even asked taqadus from his blog for some advise [Thank you!]. And my conviction is final when I got into forums and been reading suggestions/solutions the same over and over again. Plus documentation from Symantec and part of which reads:

...
Note: This command will only detect and incorporate some bp.conf configuration changes. Many NetBackup configuration changes, such as adding or changing a SERVER entry, require a complete stop and start of the NetBackup daemons. If the bp.conf configuration change does not take effect, then the NetBackup daemons must be restarted. To do so, when no backups or restores are running, execute the commands:

# /usr/openv/netbackup/bin/goodies/netbackup stop

# /usr/openv/netbackup/bin/goodies/netbackup start

Monday, December 29, 2008

Veritas NetBackup Tutorial: config, executable files

Previously on Netbackup [cool; sounds like Heroes]... we discussed the overview on how NBU works. Going forward, we'll do check out the directories and files needed and/or configured for it to work.

Well, the one of the most - IF not the most - important files is bp.conf located in /usr/openv/netbackup. This file [which can be found accross setup] tells how a machine is configured: Master, Media Manager, and/or Client. Please also note that a machine can be configured as follows:

Master-MM-Client-in-one
MM-Client-in-one

Client

And here is a sample of a basic entry:

$ more /usr/open/netbackup/bp.conf
SERVER=[name of Master]
SERVER=[name of Media Manager]

...[list of other servers]

EMMSERVER=[name of EMM; mostly Master - depending on setup]

CLIENT_NAME=[name of Client; depending on the role as defined above]

... [additional options follows]


Another config file you might want to check-up is /usr/openv/volmgr/vm.conf which contains:

MM_SERVER_NAME=[name of MM]

In addition to these files, we are also considering native UNIX files and ensure that they're properly configured to allow NBU to run:

/etc/services - defines service names and corresponding ports
/etc/inetd.conf
/dev - device files directory which will identify the robots and tapes

Forgive me, I've been busy with specifics and gravely forgot the parent of it all. Almost all of the files: config and commands are located in /usr/openv for Unices or [install directory]\VERITAS for Windows.

So what we're talking here are:

../netbackup - contains NBU, VolMgr binaries, NBU DB
../db/data - EMM & NB databases
../netbackup/db - NBU DB of class, schedules, images, etc.
../netbackup/logs - log files

Here are the daemons, in addition to what was listed before:

tldd - started with ltid robotic daemon one on each MM server
tldcd - started with ltid; talks to the robot
bpbrm - backup and restore manager
bptm - tape manager
bpdm - disk manager
avrd - bar code reader

Next, we'll go to basic troubleshooting of common issues encountered.

World Clock