mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2010-10-07 Sancho Lerena <slerena@artica.es>
* conf/pandora_server.conf: Removed multicast options * Makefile.PL: Removed need for dependencies on Mail::Sendmail and Traceroute::PurePerl, now are included in the Pandora FMS distribution. * lib/PandoraFMS/Config.pm: Removed options for multicast * lib/PandoraFMS/Traceroute.pm, lib/PandoraFMS/Sendmail.pm, lib/PandoraFMS/Traceroute/PurePerl.pm: Now included on Pandora FMS distribution, this will help to do easier installs of Pandora, because that packages was difficult to build/install in different distros. * lib/PandoraFMS/Core.pm: Removed the old multicast-on change enterprise feature, not used/supported anymore. * lib/PandoraFMS/ReconServer.pm: Now uses the internal Traceroute Pureperl implementation. * lib/PandoraFMS/Tools.pm: Now uses the internal Mail::Sendmail copy. * bin/pandora_server: Removed the multicast option from main loop. * FreeBSD/pandora_server.conf: Removed multicast from options. * util/mcast_client.pl: Deleted sample client for multicast. * util/pandora_logrotate: Updated the rotate options for SNMP logfile. * util/compaq_chassis_trap_manager2.pl: Added sample of SNMP Trap postprocessor. * pandora_server.redhat.spec, pandora_server.spec, DEBIAN/control: Updated packages deps and other minor changes (xprobe2 is not mandatory now). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3365 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1a3a930e5c
commit
91f6cb5780
@ -1,3 +1,42 @@
|
|||||||
|
2010-10-07 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
|
* conf/pandora_server.conf: Removed multicast options
|
||||||
|
|
||||||
|
* Makefile.PL: Removed need for dependencies on Mail::Sendmail
|
||||||
|
and Traceroute::PurePerl, now are included in the Pandora FMS
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Config.pm: Removed options for multicast
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Traceroute.pm,
|
||||||
|
lib/PandoraFMS/Sendmail.pm,
|
||||||
|
lib/PandoraFMS/Traceroute/PurePerl.pm: Now included on Pandora FMS
|
||||||
|
distribution, this will help to do easier installs of Pandora, because
|
||||||
|
that packages was difficult to build/install in different distros.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm: Removed the old multicast-on change enterprise
|
||||||
|
feature, not used/supported anymore.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/ReconServer.pm: Now uses the internal Traceroute Pureperl
|
||||||
|
implementation.
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Tools.pm: Now uses the internal Mail::Sendmail copy.
|
||||||
|
|
||||||
|
* bin/pandora_server: Removed the multicast option from main loop.
|
||||||
|
|
||||||
|
* FreeBSD/pandora_server.conf: Removed multicast from options.
|
||||||
|
|
||||||
|
* util/mcast_client.pl: Deleted sample client for multicast.
|
||||||
|
|
||||||
|
* util/pandora_logrotate: Updated the rotate options for SNMP logfile.
|
||||||
|
|
||||||
|
* util/compaq_chassis_trap_manager2.pl: Added sample of SNMP Trap postprocessor.
|
||||||
|
|
||||||
|
* pandora_server.redhat.spec,
|
||||||
|
pandora_server.spec,
|
||||||
|
DEBIAN/control: Updated packages deps and other minor changes (xprobe2 is not
|
||||||
|
mandatory now).
|
||||||
|
|
||||||
2010-10-06 Ramon Novoa <rnovoa@artica.es>
|
2010-10-06 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Retrieve agent information before the module
|
* lib/PandoraFMS/Core.pm: Retrieve agent information before the module
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package: PandoraFMS-Server
|
package: PandoraFMS-Server
|
||||||
Version: 3.1
|
Version: 3.2
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
Installed-Size: 640
|
Installed-Size: 640
|
||||||
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
|
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
|
||||||
Homepage: http://pandorafms.org/
|
Homepage: http://pandorafms.org/
|
||||||
Depends: perl (>= 5.8), libmail-sendmail-perl, libio-socket-multicast-perl, libdbi-perl, libdbd-mysql-perl,libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo
|
Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo
|
||||||
Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server.
|
Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server.
|
||||||
|
@ -225,15 +225,6 @@ autocreate 1
|
|||||||
|
|
||||||
max_log_size 65536
|
max_log_size 65536
|
||||||
|
|
||||||
# Send XML over Multicast channels async uptades on events and sync full tree
|
|
||||||
# info of tagged items (With custom ID) (only enterprise).
|
|
||||||
|
|
||||||
# mcast_status_port 22222
|
|
||||||
# mcast_status_group 224.1.1.1
|
|
||||||
|
|
||||||
# mcast_change_port 11111
|
|
||||||
# mcast_change_group 224.1.1.1
|
|
||||||
|
|
||||||
# max_queue_files (250 by default)
|
# max_queue_files (250 by default)
|
||||||
# When server have more than max_queue_files in incoming directory, skips the read
|
# When server have more than max_queue_files in incoming directory, skips the read
|
||||||
# the directory to avoid filesystem overhead.
|
# the directory to avoid filesystem overhead.
|
||||||
|
@ -10,13 +10,10 @@ WriteMakefile(
|
|||||||
DBI => 0,
|
DBI => 0,
|
||||||
threads::shared => 0,
|
threads::shared => 0,
|
||||||
IO::Socket => 0,
|
IO::Socket => 0,
|
||||||
Time::Format => 0,
|
|
||||||
Time::Local => 0,
|
Time::Local => 0,
|
||||||
XML::Simple => 0,
|
XML::Simple => 0,
|
||||||
Time::HiRes => 0,
|
Time::HiRes => 0,
|
||||||
IO::Socket => 0,
|
IO::Socket => 0,
|
||||||
Mail::Sendmail => 0,
|
|
||||||
Net::Traceroute::PurePerl => 0,
|
|
||||||
HTML::Entities => 0,
|
HTML::Entities => 0,
|
||||||
},
|
},
|
||||||
EXE_FILES => [ 'bin/pandora_server', 'bin/pandora_exec'],
|
EXE_FILES => [ 'bin/pandora_server', 'bin/pandora_exec'],
|
||||||
|
@ -233,8 +233,6 @@ while (1) {
|
|||||||
# Set the status of unknown modules
|
# Set the status of unknown modules
|
||||||
pandora_module_unknown (\%Config, $DBH);
|
pandora_module_unknown (\%Config, $DBH);
|
||||||
|
|
||||||
# Multicast status report each 30 x Server Threshold secs
|
|
||||||
enterprise_hook('mcast_status_report', [\%Config, $DBH]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# TASKS DONE EACH 60 SECONDS (Low latency tasks)
|
# TASKS DONE EACH 60 SECONDS (Low latency tasks)
|
||||||
@ -255,12 +253,12 @@ while (1) {
|
|||||||
pandora_group_statistics (\%Config, $DBH);
|
pandora_group_statistics (\%Config, $DBH);
|
||||||
pandora_server_statistics (\%Config, $DBH);
|
pandora_server_statistics (\%Config, $DBH);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Pandora self monitoring
|
# Pandora self monitoring
|
||||||
if (defined($Config{"self_monitoring"})
|
if (defined($Config{"self_monitoring"})
|
||||||
&& $Config{"self_monitoring"} == 1){
|
&& $Config{"self_monitoring"} == 1){
|
||||||
pandora_self_monitoring (\%Config, $DBH);
|
pandora_self_monitoring (\%Config, $DBH);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -221,15 +221,6 @@ autocreate 1
|
|||||||
|
|
||||||
max_log_size 65536
|
max_log_size 65536
|
||||||
|
|
||||||
# Send XML over Multicast channels async uptades on events and sync full tree
|
|
||||||
# info of tagged items (With custom ID) (only enterprise).
|
|
||||||
|
|
||||||
# mcast_status_port 22222
|
|
||||||
# mcast_status_group 224.1.1.1
|
|
||||||
|
|
||||||
# mcast_change_port 11111
|
|
||||||
# mcast_change_group 224.1.1.1
|
|
||||||
|
|
||||||
# max_queue_files (250 by default)
|
# max_queue_files (250 by default)
|
||||||
# When server have more than max_queue_files in incoming directory, skips the read
|
# When server have more than max_queue_files in incoming directory, skips the read
|
||||||
# the directory to avoid filesystem overhead.
|
# the directory to avoid filesystem overhead.
|
||||||
|
@ -258,15 +258,6 @@ sub pandora_load_config {
|
|||||||
# max log size (bytes)
|
# max log size (bytes)
|
||||||
$pa_config->{'max_log_size'} = 32000;
|
$pa_config->{'max_log_size'} = 32000;
|
||||||
|
|
||||||
# Multicast status report
|
|
||||||
$pa_config->{'mcast_status_group'} = '';
|
|
||||||
$pa_config->{'mcast_status_port'} = '';
|
|
||||||
|
|
||||||
|
|
||||||
# Multicast change report
|
|
||||||
$pa_config->{'mcast_change_group'} = '';
|
|
||||||
$pa_config->{'mcast_change_port'} = '';
|
|
||||||
|
|
||||||
# Ignore the timestamp in the XML and use the file timestamp instead
|
# Ignore the timestamp in the XML and use the file timestamp instead
|
||||||
$pa_config->{'use_xml_timestamp'} = 0;
|
$pa_config->{'use_xml_timestamp'} = 0;
|
||||||
|
|
||||||
@ -520,18 +511,6 @@ sub pandora_load_config {
|
|||||||
elsif ($parametro =~ m/^max_log_size\s([0-9]*)/i) {
|
elsif ($parametro =~ m/^max_log_size\s([0-9]*)/i) {
|
||||||
$pa_config->{'max_log_size'}= clean_blank($1);
|
$pa_config->{'max_log_size'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
elsif ($parametro =~ m/^mcast_status_group\s([0-9\.]*)/i) {
|
|
||||||
$pa_config->{'mcast_status_group'}= clean_blank($1);
|
|
||||||
}
|
|
||||||
elsif ($parametro =~ m/^mcast_change_group\s([0-9\.]*)/i) {
|
|
||||||
$pa_config->{'mcast_change_group'}= clean_blank($1);
|
|
||||||
}
|
|
||||||
elsif ($parametro =~ m/^mcast_status_port\s([0-9]*)/i) {
|
|
||||||
$pa_config->{'mcast_status_port'}= clean_blank($1);
|
|
||||||
}
|
|
||||||
elsif ($parametro =~ m/^mcast_change_port\s([0-9]*)/i) {
|
|
||||||
$pa_config->{'mcast_change_port'}= clean_blank($1);
|
|
||||||
}
|
|
||||||
elsif ($parametro =~ m/^wmi_threads\s([0-9]*)/i) {
|
elsif ($parametro =~ m/^wmi_threads\s([0-9]*)/i) {
|
||||||
$pa_config->{'wmi_threads'}= clean_blank($1);
|
$pa_config->{'wmi_threads'}= clean_blank($1);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ PandoraFMS::Core - Core functions of Pandora FMS
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
Version 3.1
|
Version 3.2
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
@ -1602,12 +1602,10 @@ sub generate_status_event ($$$$$$$) {
|
|||||||
if ($status == 0) {
|
if ($status == 0) {
|
||||||
($event_type, $severity) = ('going_down_normal', 2);
|
($event_type, $severity) = ('going_down_normal', 2);
|
||||||
$description .= "going to NORMAL";
|
$description .= "going to NORMAL";
|
||||||
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'OK', $dbh]);
|
|
||||||
# Critical
|
# Critical
|
||||||
} elsif ($status == 1) {
|
} elsif ($status == 1) {
|
||||||
($event_type, $severity) = ('going_up_critical', 4);
|
($event_type, $severity) = ('going_up_critical', 4);
|
||||||
$description .= "going to CRITICAL";
|
$description .= "going to CRITICAL";
|
||||||
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'ERR', $dbh]);
|
|
||||||
# Warning
|
# Warning
|
||||||
} elsif ($status == 2) {
|
} elsif ($status == 2) {
|
||||||
|
|
||||||
@ -1624,7 +1622,6 @@ sub generate_status_event ($$$$$$$) {
|
|||||||
# Unknown last_status
|
# Unknown last_status
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'WARN', $dbh]);
|
|
||||||
} else {
|
} else {
|
||||||
# Unknown status
|
# Unknown status
|
||||||
logger($pa_config, "Unknown status $status for module '" . $module->{'nombre'} . "' agent '" . $agent->{'nombre'} . "'.", 10);
|
logger($pa_config, "Unknown status $status for module '" . $module->{'nombre'} . "' agent '" . $agent->{'nombre'} . "'.", 10);
|
||||||
@ -2006,8 +2003,16 @@ sub pandora_self_monitoring ($$) {
|
|||||||
|
|
||||||
my $agents_unknown = get_db_value ($dbh, "SELECT * FROM tagente_estado, tagente WHERE tagente.disabled =0 AND tagente.id_agente = tagente_estado.id_agente AND running_by = $my_data_server AND utimestamp < NOW() - (current_interval * 2) limit 10;");
|
my $agents_unknown = get_db_value ($dbh, "SELECT * FROM tagente_estado, tagente WHERE tagente.disabled =0 AND tagente.id_agente = tagente_estado.id_agente AND running_by = $my_data_server AND utimestamp < NOW() - (current_interval * 2) limit 10;");
|
||||||
|
|
||||||
|
if (!defined($agents_unknown)){
|
||||||
|
$agents_unknown = 0;
|
||||||
|
}
|
||||||
|
|
||||||
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");
|
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");
|
||||||
|
|
||||||
|
if (!defined($queued_modules)){
|
||||||
|
$queued_modules = 0;
|
||||||
|
}
|
||||||
|
|
||||||
my $dbmaintance = get_db_value ($dbh, "SELECT COUNT(*) FROM tconfig WHERE token = 'db_maintance' AND `value` > UNIX_TIMESTAMP() - 86400");
|
my $dbmaintance = get_db_value ($dbh, "SELECT COUNT(*) FROM tconfig WHERE token = 'db_maintance' AND `value` > UNIX_TIMESTAMP() - 86400");
|
||||||
|
|
||||||
$xml_output .=" <module>";
|
$xml_output .=" <module>";
|
||||||
|
@ -45,7 +45,7 @@ my @TaskQueue :shared;
|
|||||||
my %PendingTasks :shared;
|
my %PendingTasks :shared;
|
||||||
my $Sem :shared = Thread::Semaphore->new;
|
my $Sem :shared = Thread::Semaphore->new;
|
||||||
my $TaskSem :shared = Thread::Semaphore->new (0);
|
my $TaskSem :shared = Thread::Semaphore->new (0);
|
||||||
my $TracerouteAvailable = (eval 'use Net::Traceroute::PurePerl; 1') ? 1 : 0;
|
my $TracerouteAvailable = (eval 'use PandoraFMS::Traceroute::PurePerl; 1') ? 1 : 0;
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# Recon Server class constructor.
|
# Recon Server class constructor.
|
||||||
@ -396,7 +396,7 @@ sub get_host_parent ($$){
|
|||||||
my $traceroutetimeout = $pa_config->{'networktimeout'};
|
my $traceroutetimeout = $pa_config->{'networktimeout'};
|
||||||
|
|
||||||
|
|
||||||
my $tr = Net::Traceroute::PurePerl->new (
|
my $tr = PandoraFMS::Traceroute::PurePerl->new (
|
||||||
backend => 'PurePerl',
|
backend => 'PurePerl',
|
||||||
host => $host,
|
host => $host,
|
||||||
debug => 0,
|
debug => 0,
|
||||||
|
1032
pandora_server/lib/PandoraFMS/Sendmail.pm
Normal file
1032
pandora_server/lib/PandoraFMS/Sendmail.pm
Normal file
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ use warnings;
|
|||||||
use Time::Local;
|
use Time::Local;
|
||||||
use POSIX qw(setsid strftime);
|
use POSIX qw(setsid strftime);
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use Mail::Sendmail; # New in 2.0. Used to sendmail internally, without external scripts
|
use PandoraFMS::Sendmail; # New in 2.0. Used to sendmail internally, without external scripts
|
||||||
#use Module::Loaded;
|
#use Module::Loaded;
|
||||||
|
|
||||||
# Used to calculate the MD5 checksum of a string
|
# Used to calculate the MD5 checksum of a string
|
||||||
@ -334,11 +334,6 @@ sub enterprise_load ($) {
|
|||||||
my $pa_config = shift;
|
my $pa_config = shift;
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
eval 'local $SIG{__DIE__}; require IO::Socket::Multicast';
|
|
||||||
if ($@) {
|
|
||||||
print_message ($pa_config, " [*] Error loading Pandora FMS Enterprise: IO::Socket::Multicast not found.", 1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Already loaded
|
# Already loaded
|
||||||
#return 1 if (is_loaded ('PandoraFMS::Enterprise'));
|
#return 1 if (is_loaded ('PandoraFMS::Enterprise'));
|
||||||
|
1065
pandora_server/lib/PandoraFMS/Traceroute.pm
Normal file
1065
pandora_server/lib/PandoraFMS/Traceroute.pm
Normal file
File diff suppressed because it is too large
Load Diff
1295
pandora_server/lib/PandoraFMS/Traceroute/PurePerl.pm
Normal file
1295
pandora_server/lib/PandoraFMS/Traceroute/PurePerl.pm
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,10 +24,10 @@ Prereq: %{_sbindir}/useradd
|
|||||||
AutoReq: 0
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
Requires: coreutils
|
Requires: coreutils
|
||||||
Requires: perl-Mail-Sendmail perl-DBI perl-DBD-mysql perl-Time-Format
|
Requires: perl-DBI perl-DBD-mysql
|
||||||
Requires: perl-XML-Simple perl-XML-SAX
|
Requires: perl-XML-Simple perl-XML-SAX
|
||||||
Requires: perl-NetAddr-IP net-snmp net-tools
|
Requires: perl-NetAddr-IP net-snmp net-tools
|
||||||
Requires: nmap wmic sudo xprobe2
|
Requires: nmap wmic sudo
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.
|
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.
|
||||||
|
@ -21,9 +21,9 @@ BuildArchitectures: noarch
|
|||||||
Requires(pre): /usr/sbin/useradd
|
Requires(pre): /usr/sbin/useradd
|
||||||
AutoReq: 0
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
Requires: perl-Mail-Sendmail perl-DBI perl-DBD-mysql perl-time-format
|
Requires: perl-DBI perl-DBD-mysql
|
||||||
Requires: perl-NetAddr-IP net-snmp net-tools
|
Requires: perl-NetAddr-IP net-snmp net-tools
|
||||||
Requires: nmap wmic sudo xprobe2 perl-HTML-Tree perl-XML-SAX
|
Requires: nmap wmic sudo perl-HTML-Tree perl-XML-SAX
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.
|
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.
|
||||||
|
@ -90,22 +90,22 @@ install () {
|
|||||||
echo "You are missing the following dependencies"
|
echo "You are missing the following dependencies"
|
||||||
echo " "
|
echo " "
|
||||||
cat output | awk -F ": prerequisite" '{print $2}' | awk -F " " '{print $1}'
|
cat output | awk -F ": prerequisite" '{print $2}' | awk -F " " '{print $1}'
|
||||||
echo "The complete installation guide is at: "http://www.openideas.info/wiki/index.php?title=Pandora_2.0:Documentation_en:Install_Server#Pandora_FMS_Server_installation" "
|
echo "The complete installation guide is at: http://openideas.info/wiki/index.php?title=Pandora"
|
||||||
echo " "
|
echo " "
|
||||||
echo "Debian-based distribution do:"
|
echo "Debian-based distribution do:"
|
||||||
echo " # apt-get install snmp snmpd libtime-format-perl libxml-simple-perl libnetaddr-ip-perl libdbi-perl libxml-simple-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2 libmail-sendmail-perl"
|
echo " # apt-get install snmp snmpd libxml-simple-perl libnetaddr-ip-perl libdbi-perl libxml-simple-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2"
|
||||||
echo " "
|
echo " "
|
||||||
echo "For CentOS / RHEL do: "
|
echo "For CentOS / RHEL do: "
|
||||||
echo " "
|
echo " "
|
||||||
echo " # yum install perl-XML-SAX* perl-Tie* perl-XML-Simple* perl-IO-Socket* perl-Time-modules* perl-NetAddr-IP* perl-DateTime* perl-ExtUtils perl-DBI nmap xprobe2"
|
echo " # yum install perl-XML-SAX* perl-Tie* perl-XML-Simple* perl-IO-Socket* perl-Time-modules* perl-NetAddr-IP* perl-DateTime* perl-ExtUtils perl-DBI nmap "
|
||||||
echo " "
|
echo " "
|
||||||
echo "For OpenSUSE / SLES do : "
|
echo "For OpenSUSE / SLES do : "
|
||||||
echo " "
|
echo " "
|
||||||
echo " # zypper install install nmap perl-DBD-mysql perl-DBI perl-Date-Calc perl-HTML-Parser
|
echo " # zypper install install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser
|
||||||
perl-HTML-Encoding perl-HTML-Tree perl-IO-Socket-Multicast perl-Mail-Sendmail perl-NetAddr-IP
|
perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP
|
||||||
perl-TimeDate perl-XML-Simple perl-libwww-perl mysql-client"
|
perl-TimeDate perl-XML-Simple perl-libwww-perl mysql-client"
|
||||||
echo " "
|
echo " "
|
||||||
echo " You also will need to install xprobe2 and wmiclient from rpm (download from our website)"
|
echo " You also will need to install (optionally) xprobe2 and wmiclient from rpm (download from our website)"
|
||||||
echo " "
|
echo " "
|
||||||
echo "For FreeBSD do : "
|
echo "For FreeBSD do : "
|
||||||
echo " "
|
echo " "
|
||||||
@ -118,12 +118,12 @@ perl-TimeDate perl-XML-Simple perl-libwww-perl mysql-client"
|
|||||||
echo " # make install"
|
echo " # make install"
|
||||||
echo " "
|
echo " "
|
||||||
echo " Install following tools from ports. Don't use packages."
|
echo " Install following tools from ports. Don't use packages."
|
||||||
echo " Recommended: p5-DBI p5-Mail-Sendmail p5-NetAddr-IP p5-XML-Simple p5-Time-Format p5-HTML-Parser p5-Net-Traceroute-PurePerl p5-IO-Socket-Multicast p5-DBD-mysql"
|
echo " Recommended: p5-DBI p5-NetAddr-IP p5-XML-Simple p5-HTML-Parser p5-DBD-mysql"
|
||||||
echo " Optional: nmap xprobe"
|
echo " Optional: nmap xprobe"
|
||||||
echo " "
|
echo " "
|
||||||
echo "To get it from source through CPAN do"
|
echo "To get it from source through CPAN do"
|
||||||
echo " "
|
echo " "
|
||||||
echo " $ cpan Digest::MD5 Time::Local DBI XML::Simple IO::Socket Time::HiRes Time::Format NetAddr::IP Mail::Sendmail Net::Traceroute::PurePerl HTML::Entities"
|
echo " $ cpan Time::Local DBI XML::Simple IO::Socket Time::HiRes NetAddr::IP HTML::Entities"
|
||||||
echo " "
|
echo " "
|
||||||
rm output
|
rm output
|
||||||
else
|
else
|
||||||
|
90
pandora_server/util/compaq_chassis_trap_manager2.pl
Executable file
90
pandora_server/util/compaq_chassis_trap_manager2.pl
Executable file
@ -0,0 +1,90 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
# (c) Sancho Lerena 2010 <slerena@artica.es>
|
||||||
|
# Specific Pandora FMS trap collector for Compaq Hardware
|
||||||
|
|
||||||
|
# Parameter list: list_event, code with TRAP VALUES to match
|
||||||
|
# module_name: Name of the module generated.
|
||||||
|
|
||||||
|
my @list_event = ('22013', '22042', '22039');
|
||||||
|
my $module_name = "evento_enclosure";
|
||||||
|
|
||||||
|
use POSIX qw(setsid strftime);
|
||||||
|
|
||||||
|
sub show_help {
|
||||||
|
print "\nSpecific Pandora FMS trap collector for compaq Hardware\n";
|
||||||
|
print "(c) Sancho Lerena 2010 <slerena@artica.es>\n";
|
||||||
|
print "Usage:\n\n";
|
||||||
|
print " compaq_chassis_trap_manager.pl <destination_agent_name> <TRAP DATA>\n\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub writexml {
|
||||||
|
my ($hostname, $xmlmessage ) = @_;
|
||||||
|
my $file = "/var/spool/pandora/data_in/$hostname.".rand(1000).".data";
|
||||||
|
|
||||||
|
# my $file = "/tmp/compaq.debug";
|
||||||
|
open (FILE, ">> $file") or die "[FATAL] Cannot write to XML '$file'";
|
||||||
|
print FILE $xmlmessage;
|
||||||
|
close (FILE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($#ARGV == -1){
|
||||||
|
show_help();
|
||||||
|
}
|
||||||
|
|
||||||
|
$chunk = "";
|
||||||
|
|
||||||
|
# First parameter is always destination host for virtual server
|
||||||
|
$target_host = $ARGV[0];
|
||||||
|
|
||||||
|
foreach $argnum (1 .. $#ARGV) {
|
||||||
|
if ($chunk ne ""){
|
||||||
|
$chunk .= " ";
|
||||||
|
}
|
||||||
|
$chunk .= $ARGV[$argnum];
|
||||||
|
}
|
||||||
|
|
||||||
|
my $hostname = "";
|
||||||
|
my $now = strftime ("%Y-%m-%d %H:%M:%S", localtime());
|
||||||
|
my $xmldata = "<agent_data agent_name='$target_host' timestamp='$now' version='1.0' os='Other' os_version='N/A' interval='9999999999'>";
|
||||||
|
|
||||||
|
my $blade = "N/A";
|
||||||
|
my $index_pos = 1;
|
||||||
|
my $enclosure = "N/A";
|
||||||
|
my $rack = "N/A";
|
||||||
|
|
||||||
|
# Get position
|
||||||
|
if ($chunk =~ m/.1.3.6.1.4.1.232.22.2.4.1.1.1.8.([0-9])*\s/){
|
||||||
|
$index_pos = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get blade
|
||||||
|
if ($chunk =~ m/.1.3.6.1.4.1.232.22.2.4.1.1.1.4.$index_pos \= STRING\: ([A-Za-z0-9\-\.]*)\s/){
|
||||||
|
$blade = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get enclosure
|
||||||
|
if ($chunk =~ m/.1.3.6.1.4.1.232.22.2.4.1.1.1.5.$index_pos \= STRING\: ([A-Za-z0-9\-\.]*)\s/){
|
||||||
|
$enclosure = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get rack
|
||||||
|
if ($chunk =~ m/1.3.6.1.4.1.232.22.2.2.1.1.2.1 \= STRING\: ([A-Za-z0-9\-\.]*)\s\.1/){
|
||||||
|
$rack = $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $event_code = "";
|
||||||
|
foreach $argnum (0 .. $#list_event) {
|
||||||
|
if ($chunk =~ m/\s\.($list_event[$argnum])\s/){
|
||||||
|
$text = chunk;
|
||||||
|
$event_code = $1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$xmldata .=
|
||||||
|
"<module><name>$module_name_$event_code</name><type>async_string</type><data><![CDATA[$text]]></data></module>\n";
|
||||||
|
$xmldata .= "</agent_data>\n";
|
||||||
|
|
||||||
|
writexml ($target_host, $xmldata);
|
||||||
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
# Multicast client
|
|
||||||
# Copyright (c) 2007 Artica Soluciones Tecnologicas S.L.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use IO::Socket::Multicast;
|
|
||||||
|
|
||||||
if ($#ARGV != 1) {
|
|
||||||
print "Usage: $0 <group> <port>\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $group = $ARGV[0];
|
|
||||||
my $port = $ARGV[1];
|
|
||||||
|
|
||||||
my $sock = IO::Socket::Multicast->new(Proto=>'udp',LocalPort=>$port);
|
|
||||||
$sock->mcast_add($group) || die "Couldn't set group: $!\n";
|
|
||||||
|
|
||||||
print "Press ctr-c to quit\n";
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
my $data;
|
|
||||||
next unless $sock->recv($data,1024);
|
|
||||||
print $data;
|
|
||||||
}
|
|
@ -30,11 +30,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/var/log/pandora/pandora_snmptrap.log {
|
/var/log/pandora/pandora_snmptrap.log {
|
||||||
daily
|
weekly
|
||||||
missingok
|
missingok
|
||||||
size 150000
|
size 500000
|
||||||
rotate 1
|
rotate 1
|
||||||
maxage 7
|
maxage 365
|
||||||
notifempty
|
notifempty
|
||||||
create 644 root root
|
create 664 root root
|
||||||
|
postrotate
|
||||||
|
/etc/init.d/pandora_server restart
|
||||||
|
endscript
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user