•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 456,509 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,657 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 1017 | Replies: 2
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
#!/usr/local/bin/perl
#check_oracle#
use strict;
use DBI;
use Net:
MTP;
$ENV{'ORACLE_HOME'} = '/app/oracle/product/9.2';
my $errors;
my $total = 0;
check_oracle();
if($total > 0) {
my $mailer = Net:
MTP->new("142.1.0.1");
$mailer->mail('dpr-prod@repl1.newport.net');
$mailer->to('root');
$mailer->data();
$mailer->datasend("Subject: DPR database");
$mailer->datasend("\n");
$mailer->datasend($errors);
$mailer->dataend();
}
sub check_oracle {
my $username = '######_@@@@';
my $password = '@@@@';
my $tnsalias = 'DPR';
my $dbh = DBI->connect('dbi:Oracle:'.$tnsalias, $username, $password, { PrintError => 0 });
unless($dbh) {
$errors .= "DPR database may be unavailable.\n";
$total++;
};
}
#check_oracle#
use strict;
use DBI;
use Net:
MTP;$ENV{'ORACLE_HOME'} = '/app/oracle/product/9.2';
my $errors;
my $total = 0;
check_oracle();
if($total > 0) {
my $mailer = Net:
MTP->new("142.1.0.1");$mailer->mail('dpr-prod@repl1.newport.net');
$mailer->to('root');
$mailer->data();
$mailer->datasend("Subject: DPR database");
$mailer->datasend("\n");
$mailer->datasend($errors);
$mailer->dataend();
}
sub check_oracle {
my $username = '######_@@@@';
my $password = '@@@@';
my $tnsalias = 'DPR';
my $dbh = DBI->connect('dbi:Oracle:'.$tnsalias, $username, $password, { PrintError => 0 });
unless($dbh) {
$errors .= "DPR database may be unavailable.\n";
$total++;
};
}
Last edited by sunil_kumar : Sep 29th, 2007 at 3:36 pm.
Whats wrong with it?
What errors did it return?
What errors did it return?
Attention!! - IT Professionals[][][]
dEmOn1337 Needs IT Professionals for Online Community!
http://demon1337/forum/ --> Computer/Internet Security and Development Forum
You are chosen! XD
dEmOn1337 Needs IT Professionals for Online Community!
http://demon1337/forum/ --> Computer/Internet Security and Development Forum
You are chosen! XD
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Queue; correct code but error msg :Help (C++)
- Can some one help me with this code plz (Visual Basic 4 / 5 / 6)
- creating our own C++ strcat() function, code reqd (C++)
- Plz, helping with writing a bit of code. Thanks (C++)
- tell me plz (C)
- plz tell me wherez my mistake in dis program!! (C++)
- Console Window Code (Java)
- MERGED: Deleting duplicates in an array (plz help me out!!!!!!!) (C)
- Help with error checking code (C++)
Other Threads in the Perl Forum
- Previous Thread: Writing array elements to a file in perl
- Next Thread: Process manager with perl


Linear Mode