use zmDbConnect instead of all the DBI connect stuff

This commit is contained in:
Isaac Connor 2014-04-09 10:34:58 -04:00
parent 35468af815
commit afc7581146
1 changed files with 1 additions and 1 deletions

2
utils/zm-alarm.pl Normal file → Executable file
View File

@ -13,7 +13,7 @@ use Switch;
$| = 1; $| = 1;
my @monitors; my @monitors;
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ) or die "Could not connect to the database.\n"; my $dbh = zmDbConnect();
my $sql = "SELECT * FROM Monitors"; my $sql = "SELECT * FROM Monitors";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() ); my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() );