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:
slerena 2010-10-07 15:09:04 +00:00
parent 1a3a930e5c
commit 91f6cb5780
19 changed files with 3560 additions and 104 deletions

View File

@ -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>
* lib/PandoraFMS/Core.pm: Retrieve agent information before the module

View File

@ -1,10 +1,10 @@
package: PandoraFMS-Server
Version: 3.1
Version: 3.2
Architecture: all
Priority: optional
Section: admin
Installed-Size: 640
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
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.

View File

@ -225,15 +225,6 @@ autocreate 1
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)
# When server have more than max_queue_files in incoming directory, skips the read
# the directory to avoid filesystem overhead.

View File

@ -10,13 +10,10 @@ WriteMakefile(
DBI => 0,
threads::shared => 0,
IO::Socket => 0,
Time::Format => 0,
Time::Local => 0,
XML::Simple => 0,
Time::HiRes => 0,
IO::Socket => 0,
Mail::Sendmail => 0,
Net::Traceroute::PurePerl => 0,
HTML::Entities => 0,
},
EXE_FILES => [ 'bin/pandora_server', 'bin/pandora_exec'],

View File

@ -233,8 +233,6 @@ while (1) {
# Set the status of unknown modules
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)
@ -255,12 +253,12 @@ while (1) {
pandora_group_statistics (\%Config, $DBH);
pandora_server_statistics (\%Config, $DBH);
}
}
# Pandora self monitoring
if (defined($Config{"self_monitoring"})
&& $Config{"self_monitoring"} == 1){
pandora_self_monitoring (\%Config, $DBH);
}
# Pandora self monitoring
if (defined($Config{"self_monitoring"})
&& $Config{"self_monitoring"} == 1){
pandora_self_monitoring (\%Config, $DBH);
}
}
};

View File

@ -221,15 +221,6 @@ autocreate 1
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)
# When server have more than max_queue_files in incoming directory, skips the read
# the directory to avoid filesystem overhead.

View File

@ -258,15 +258,6 @@ sub pandora_load_config {
# max log size (bytes)
$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
$pa_config->{'use_xml_timestamp'} = 0;
@ -520,18 +511,6 @@ sub pandora_load_config {
elsif ($parametro =~ m/^max_log_size\s([0-9]*)/i) {
$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) {
$pa_config->{'wmi_threads'}= clean_blank($1);
}

View File

@ -23,7 +23,7 @@ PandoraFMS::Core - Core functions of Pandora FMS
=head1 VERSION
Version 3.1
Version 3.2
=head1 SYNOPSIS
@ -1602,12 +1602,10 @@ sub generate_status_event ($$$$$$$) {
if ($status == 0) {
($event_type, $severity) = ('going_down_normal', 2);
$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
} elsif ($status == 1) {
($event_type, $severity) = ('going_up_critical', 4);
$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
} elsif ($status == 2) {
@ -1624,7 +1622,6 @@ sub generate_status_event ($$$$$$$) {
# Unknown last_status
return;
}
enterprise_hook('mcast_change_report', [$pa_config, $module->{'nombre'}, $module->{'custom_id'}, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 'WARN', $dbh]);
} else {
# Unknown status
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;");
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"}."'");
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");
$xml_output .=" <module>";

View File

@ -45,7 +45,7 @@ my @TaskQueue :shared;
my %PendingTasks :shared;
my $Sem :shared = Thread::Semaphore->new;
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.
@ -396,7 +396,7 @@ sub get_host_parent ($$){
my $traceroutetimeout = $pa_config->{'networktimeout'};
my $tr = Net::Traceroute::PurePerl->new (
my $tr = PandoraFMS::Traceroute::PurePerl->new (
backend => 'PurePerl',
host => $host,
debug => 0,

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ use warnings;
use Time::Local;
use POSIX qw(setsid strftime);
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;
# Used to calculate the MD5 checksum of a string
@ -334,11 +334,6 @@ sub enterprise_load ($) {
my $pa_config = shift;
# 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
#return 1 if (is_loaded ('PandoraFMS::Enterprise'));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,10 +24,10 @@ Prereq: %{_sbindir}/useradd
AutoReq: 0
Provides: %{name}-%{version}
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-NetAddr-IP net-snmp net-tools
Requires: nmap wmic sudo xprobe2
Requires: nmap wmic 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.

View File

@ -21,9 +21,9 @@ BuildArchitectures: noarch
Requires(pre): /usr/sbin/useradd
AutoReq: 0
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: nmap wmic sudo xprobe2 perl-HTML-Tree perl-XML-SAX
Requires: nmap wmic sudo perl-HTML-Tree perl-XML-SAX
%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.

View File

@ -90,22 +90,22 @@ install () {
echo "You are missing the following dependencies"
echo " "
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 "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 "For CentOS / RHEL do: "
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 "For OpenSUSE / SLES do : "
echo " "
echo " # zypper install install nmap perl-DBD-mysql perl-DBI perl-Date-Calc perl-HTML-Parser
perl-HTML-Encoding perl-HTML-Tree perl-IO-Socket-Multicast perl-Mail-Sendmail perl-NetAddr-IP
echo " # zypper install install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser
perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP
perl-TimeDate perl-XML-Simple perl-libwww-perl mysql-client"
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 "For FreeBSD do : "
echo " "
@ -118,12 +118,12 @@ perl-TimeDate perl-XML-Simple perl-libwww-perl mysql-client"
echo " # make install"
echo " "
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 " "
echo "To get it from source through CPAN do"
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 " "
rm output
else

View 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);

View File

@ -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;
}

View File

@ -30,11 +30,15 @@
}
/var/log/pandora/pandora_snmptrap.log {
daily
weekly
missingok
size 150000
size 500000
rotate 1
maxage 7
maxage 365
notifempty
create 644 root root
create 664 root root
postrotate
/etc/init.d/pandora_server restart
endscript
}