2009-05-04 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DB.pm: Enabled mysql_auto_reconnect. * lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Log error messages when external programs are not found. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1673 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c7cf81f5d0
commit
15b9d59716
|
@ -1,3 +1,11 @@
|
|||
2009-05-04 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/DB.pm: Enabled mysql_auto_reconnect.
|
||||
|
||||
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
|
||||
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Log
|
||||
error messages when external programs are not found.
|
||||
|
||||
2009-04-28 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/SNMPServer.pm: Disabled output from snmptrapd.
|
||||
|
|
|
@ -51,7 +51,15 @@ sub db_connect ($$$$$$) {
|
|||
my ($rdbms, $db_name, $db_host, $db_port, $db_user, $db_pass) = @_;
|
||||
|
||||
if ($rdbms eq 'mysql') {
|
||||
return DBI->connect("DBI:mysql:$db_name:$db_host:3306", $db_user, $db_pass, { RaiseError => 1, AutoCommit => 1 });
|
||||
|
||||
# Connect to MySQL
|
||||
my $dbh = DBI->connect("DBI:mysql:$db_name:$db_host:3306", $db_user, $db_pass, { RaiseError => 1, AutoCommit => 1 });
|
||||
return undef unless defined ($dbh);
|
||||
|
||||
# Enable auto reconnect
|
||||
$dbh->{'mysql_auto_reconnect'} = 1;
|
||||
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
return undef;
|
||||
|
|
|
@ -51,6 +51,7 @@ sub new ($$$) {
|
|||
return undef unless $config->{'networkserver'} == 1;
|
||||
|
||||
if (! -e $config->{'snmpget'}) {
|
||||
logger ($config, ' [E] ' . $config->{'snmpget'} . " needed by Pandora FMS Network Server not found.", 0);
|
||||
print ' [E] ' . $config->{'snmpget'} . " needed by Pandora FMS Network Server not found.\n\n";
|
||||
return undef;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ sub new ($$;$) {
|
|||
|
||||
# Check for pandora_exec
|
||||
if (system($config->{'plugin_exec'} . ' > /dev/null 2>&1') != 256) {
|
||||
print " [E] pandora_exec not found.\n\n";
|
||||
logger ($config, " [E] pandora_exec not found. Plugin Server not started.", 0);
|
||||
print " [E] pandora_exec not found. Plugin Server not started.\n\n";
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ sub new ($$;$) {
|
|||
|
||||
# Start snmptrapd
|
||||
if (system ($config->{'snmp_trapd'} . ' -t -On -n -a -Lf ' . $config->{'snmp_logfile'} . ' -p /var/run/pandora_snmptrapd.pid -F %4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\\\n >/dev/null 2>&1') != 0) {
|
||||
logger ($config, " [E] Could not start snmptrapd.\n\n", 0);
|
||||
print " [E] Could not start snmptrapd.\n\n";
|
||||
return undef;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ sub new ($$;$) {
|
|||
|
||||
# Check for a WMI client
|
||||
if (system ($config->{'wmi_client'} . ' > /dev/null 2>&1') != 256) {
|
||||
logger ($config, ' [E] ' . $config->{'wmi_client'} . " not found. Pandora FMS WMI Server needs a DCOM/WMI client.", 0);
|
||||
print ' [E] ' . $config->{'wmi_client'} . " not found. Pandora FMS WMI Server needs a DCOM/WMI client.\n\n";
|
||||
return undef;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue