Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Perl for Oracle DBAs - dbup.pl

Re: Perl for Oracle DBAs - dbup.pl

From: Dwayne Cox <dwaynec_at_infotechfl.com>
Date: Thu, 26 Jun 2003 18:54:21 -0700
Message-ID: <F001.005BAD91.20030626183937@fatcity.com>


Hi Jared,

Kudos on such a great book!

Below is my entire file. I did try it with the pager field filled but I had the same result.
Again, pardon the long email. And thanks for taking a look at this.

Here is the function containing line 597 of dbup.pl:

 sub getDba {

       my $self = shift;

# date format YYYYMMDD
my ($currDate) = @_;
#print "Currdate: $currDate\n";
my @lt = localtime(time); $currDate ||= Date::Format::strftime('%Y%m%d', @lt); my $currHour = Date::Format::strftime('%H',@lt); my $cutOffHour = 12; my $dateKey; my $prevDate; for my $date ( sort keys %{$self} ){ #print "date key: $date\n"; $dateKey = $prevDate; if ( $currDate le $date ) { if ( $cutOffHour le $currHour and $currDate eq $date ) { $dateKey = $date; }; last; } #last if $currDate < $date; $prevDate = $date; } #use Data::Dumper;
#print Dumper ( $self );
#print "found datekey: $dateKey\n";
return $self->{$dateKey}; <---- line 597 }

package uptime;

# this line is required
package dbup;
use PDBA;
use vars qw( $dateFormat $ignoreFile

            %parms %uptime %addresses
            %onCallList @supervisors );

# format of date in ignoreFile
$dateFormat = "%Y/%m/%d-%H:%M:%S";
$ignoreFile = 'dbignore.conf';
%parms = ( mailServer => 'mail.infotechfl.com',
          fromAddress => '[EMAIL PROTECTED]',

# how often to check database connectivity
# measured in seconds
# low value used for testing
#connectInterval => 30,
connectInterval => 120,
# avoid hangs - timeout is in seconds
connectionTimeOut => 10,
# hours are 0 - 23
# these are the hours to page immediately without
# retrying the connection. outside of these hours,
# retry a configurable number of times before paging
hoursToPageImmediate => [0..23],
# use a limited range for testing during the day
#hoursToPageImmediate => [19..20],
# don't page DBA during lunch. :)
#hoursToPageImmediate => [6..11, 13..18],
# how many times to retry a connection when the time
# is outside the range of hoursToPage
maxConnectRetries => 3,
# *everything* is logged
# will use PDBA_HOME
#logfile => qq{$ENV{PDBA_HOME}/logs/dbup.log},
logfile => PDBA->pdbaHome() . q{/logs/dbup.log},
);

%uptime = (

       pvprod => { machine => 'polar',
                   upDays => [1..5],
                   upHours => [0..23],
                   username => 'system',
                   alertLevel => 3 },
       pvtest => { machine => 'polar',
                   upDays => [1..5],
                   upHours => [6..18],
                   username => 'system',
                   alertLevel => 2 },
       pvtrn => { machine => 'polar',
                  upDays => [1..5],
                  upHours => [6..18],
                  username => 'system',
                  alertLevel => 2 },
        alp2 => { machine => 'batchdb',
                  upDays => [1..5],
                  upHours => [6..18],
                  username => 'system',
                  alertLevel => 2 },

);
%addresses = (
       'dbamgr' => { pager => '[EMAIL PROTECTED]',
                     emailWork => '[EMAIL PROTECTED]',
                     emailHome => '[EMAIL PROTECTED]' },
       'opsmgr' => { pager => '[EMAIL PROTECTED]',
                     emailWork => '[EMAIL PROTECTED]',
                     emailHome => '[EMAIL PROTECTED]' },
       'corpdba' => { pager => '[EMAIL PROTECTED]',
                    emailWork => '[EMAIL PROTECTED]',
                    emailHome => '[EMAIL PROTECTED]' },
);
[EMAIL PROTECTED] = ('opsmgr','dbamgr');

%onCallList = ( 'default' => 'corpdba' );

[EMAIL PROTECTED] wrote:

Dwayne,

Offhand, I would say that the problem is due to the pager attribute being empty in the %addresses hash.

Try putting a value in it.

Also, what is line 597 in dbup.pl? Yours is likely a few lines different than mine.
Please show it in context. ie. with surrounding lines as well.

Jared  

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Dwayne Cox
 INET: [EMAIL PROTECTED]
Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Jun 26 2003 - 20:54:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US