0

Hey All,

I am looking to make a couple of scripts to do the following (seperate files, not all in one).

DNS, MySQL, POP3/IMAP+SMTP

Basically, i want to try connecting to these sources, and check they are running on the server. If they are not running, i will create a message and post it to a log file.

I have done something like:

use strict;

use CGI qw(:all);
use CGI:Carp qw ( fatalsToBroswer);
use Mysql;

use DBI;

print ("Content-type: text/html\n\n");

$DB_Host = "localhost";
$DB_Name = "test";
$DB_User = "test";
$DB_Password = "test";

print "Trying to connect to MySQL DB<br>";
if (!($dbh = Mysql->Connect($DB_Host,$DB_Name,$DB_User,$DB_Password)))
{
   print "Could Not Connect to Database! Reason: ".($Mysql::db_errstr);
   exit;
}
print "Successful MySQL DB Connection";
exit 0;

This works, but is there a more simple way to do this? What about the other things such as checking DNS and SMTP/POP3 services are running?

Thank you in advance

TH

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Krstevski
0

My post was a mistake, I ask the moderator to delete.
Sorry and thanks.

Edited by Krstevski: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.