2013-05-14 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/NetworkServer.pm: Added the Pandora FMS's console MIB
	  to snmp* calls.

	* pandora_server_installer,
	  pandora_server.spec,
	  lib/PandoraFMS/Tools.pm,
	  lib/PandoraFMS/Config.pm,
	  Makefile.PL,
	  pandora_server.redhat.spec,
	  DEBIAN/control: Removed PERL's SNMP lib from the deps.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8131 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2013-05-14 13:56:43 +00:00
parent 5b7779a81f
commit 5a6db8188b
9 changed files with 37 additions and 16 deletions

View File

@ -1,3 +1,16 @@
2013-05-14 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/NetworkServer.pm: Added the Pandora FMS's console MIB
to snmp* calls.
* pandora_server_installer,
pandora_server.spec,
lib/PandoraFMS/Tools.pm,
lib/PandoraFMS/Config.pm,
Makefile.PL,
pandora_server.redhat.spec,
DEBIAN/control: Removed PERL's SNMP lib from the deps.
2013-05-13 Ramon Novoa <rnovoa@artica.es> 2013-05-13 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Tools.pm: Merged from 4.0 branch. Directly call * lib/PandoraFMS/Tools.pm: Merged from 4.0 branch. Directly call

View File

@ -6,5 +6,5 @@ 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), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, libsnmp-perl, snmp-mibs-downloader, libjson-perl Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, snmp-mibs-downloader, libjson-perl
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.

View File

@ -17,7 +17,6 @@ WriteMakefile(
PREREQ_PM => { PREREQ_PM => {
NetAddr::IP => 0, NetAddr::IP => 0,
DBI => 0, DBI => 0,
SNMP => 0,
threads::shared => 0, threads::shared => 0,
IO::Socket => 0, IO::Socket => 0,
Socket6 => 0, Socket6 => 0,

View File

@ -152,6 +152,9 @@ sub pandora_get_sharedconfig ($$) {
# Log module configuration # Log module configuration
$pa_config->{"log_dir"} = pandora_get_tconfig_token ($dbh, 'log_dir', '/var/spool/pandora/data_in/log'); $pa_config->{"log_dir"} = pandora_get_tconfig_token ($dbh, 'log_dir', '/var/spool/pandora/data_in/log');
$pa_config->{"log_interval"} = pandora_get_tconfig_token ($dbh, 'log_interval', 3600); $pa_config->{"log_interval"} = pandora_get_tconfig_token ($dbh, 'log_interval', 3600);
# Pandora FMS Console's attachment directory
$pa_config->{"attachment_dir"} = pandora_get_tconfig_token ($dbh, 'attachment_store', '/var/www/pandora_console/attachment');
} }
########################################################################## ##########################################################################

View File

@ -27,7 +27,6 @@ use Thread::Semaphore;
use IO::Socket::INET6; use IO::Socket::INET6;
use HTML::Entities; use HTML::Entities;
use POSIX qw(strftime); use POSIX qw(strftime);
use SNMP;
# Default lib dir for RPM and DEB packages # Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
@ -285,6 +284,9 @@ sub pandora_snmp_get_command ($$$$$$$$$$$) {
$snmp_target = $snmp_target.":".$snmp_port; $snmp_target = $snmp_target.":".$snmp_port;
} }
# Pandora FMS's console MIB directory
my $mib_dir = $pa_config->{'attachment_dir'} . '/mibs';
# On windows, we need the snmpget command from net-snmp, already present on win agent # On windows, we need the snmpget command from net-snmp, already present on win agent
# the call is the same than in linux # the call is the same than in linux
if (($OSNAME eq "MSWin32") || ($OSNAME eq "MSWin32-x64") || ($OSNAME eq "cygwin")){ if (($OSNAME eq "MSWin32") || ($OSNAME eq "MSWin32-x64") || ($OSNAME eq "cygwin")){
@ -298,9 +300,9 @@ sub pandora_snmp_get_command ($$$$$$$$$$$) {
# by default LINUX/FreeBSD/Solaris calls # by default LINUX/FreeBSD/Solaris calls
else { else {
if ($snmp_version ne "3"){ if ($snmp_version ne "3"){
$output = `$snmpget_cmd -v $snmp_version -r $snmp_retries -t $snmp_timeout -OUevqt -c '$snmp_community' $snmp_target $snmp_oid 2>/dev/null`; $output = `$snmpget_cmd -M+"$mib_dir" -v $snmp_version -r $snmp_retries -t $snmp_timeout -OUevqt -c '$snmp_community' $snmp_target $snmp_oid 2>/dev/null`;
} else { } else {
$output = `$snmpget_cmd -v $snmp_version -r $snmp_retries -t $snmp_timeout -OUevqt -l $snmp3_security_level $snmp3_extra $snmp_target $snmp_oid 2>/dev/null`; $output = `$snmpget_cmd -M+"$mib_dir" -v $snmp_version -r $snmp_retries -t $snmp_timeout -OUevqt -l $snmp3_security_level $snmp3_extra $snmp_target $snmp_oid 2>/dev/null`;
} }
} }
@ -345,7 +347,7 @@ sub pandora_query_snmp ($$$) {
return (undef, 0) unless ($snmp_oid ne ''); return (undef, 0) unless ($snmp_oid ne '');
if ($snmp_oid =~ m/[a-zA-Z]/) { if ($snmp_oid =~ m/[a-zA-Z]/) {
$snmp_oid = translate_obj ($dbh, $snmp_oid, ); $snmp_oid = translate_obj ($pa_config, $dbh, $snmp_oid, );
# Could not translate OID, disable the module # Could not translate OID, disable the module
if (! defined ($snmp_oid) || $snmp_oid eq '') { if (! defined ($snmp_oid) || $snmp_oid eq '') {

View File

@ -981,11 +981,15 @@ sub month_have_days($$) {
############################################################################### ###############################################################################
# Convert a text obj tag to an OID and update the module configuration. # Convert a text obj tag to an OID and update the module configuration.
############################################################################### ###############################################################################
sub translate_obj ($$) { sub translate_obj ($$$) {
my ($dbh, $obj) = @_; my ($pa_config, $dbh, $obj) = @_;
# Pandora FMS's console MIB directory
my $mib_dir = $pa_config->{'attachment_dir'} . '/mibs';
# Translate! # Translate!
my $oid = `snmptranslate -On -mALL $obj 2>/dev/null`; my $oid = `snmptranslate -On -mALL -M+"$mib_dir" $obj 2>/dev/null`;
if ($? != 0) { if ($? != 0) {
return undef; return undef;
} }

View File

@ -27,7 +27,7 @@ Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
Requires: perl-XML-Simple perl-XML-Twig net-snmp-utils Requires: perl-XML-Simple perl-XML-Twig net-snmp-utils
Requires: perl-NetAddr-IP net-snmp net-tools Requires: perl-NetAddr-IP net-snmp net-tools
Requires: perl-IO-Socket-INET6 perl-Socket6 Requires: perl-IO-Socket-INET6 perl-Socket6
Requires: nmap wmic sudo net-snmp-perl perl-JSON Requires: nmap wmic sudo perl-JSON
%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.

View File

@ -25,7 +25,7 @@ Provides: %{name}-%{version}
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
Requires: perl-NetAddr-IP net-snmp net-tools perl-XML-Twig Requires: perl-NetAddr-IP net-snmp net-tools perl-XML-Twig
Requires: nmap wmic sudo perl-HTML-Tree perl-XML-Simple Requires: nmap wmic sudo perl-HTML-Tree perl-XML-Simple
Requires: perl-IO-Socket-INET6 perl-Socket6 perl-SNMP snmp-mibs perl-JSON Requires: perl-IO-Socket-INET6 perl-Socket6 snmp-mibs perl-JSON
%description %description

View File

@ -109,17 +109,17 @@ install () {
echo "The complete installation guide is at: http://openideas.info/wiki/index.php?title=Pandora" 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 libjson-perllibio-socket-inet6-perl libsocket6-perl libxml-simple-perl libxml-twig-perl libnetaddr-ip-perl libdbi-perl libsnmp-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2 snmp-mibs-downloader" echo " # apt-get install snmp snmpd libjson-perllibio-socket-inet6-perl libsocket6-perl libxml-simple-perl libxml-twig-perl libnetaddr-ip-perl libdbi-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2 snmp-mibs-downloader"
echo " " echo " "
echo "For CentOS / RHEL do: " echo "For CentOS / RHEL do: "
echo " " echo " "
echo " # yum install perl-XML-Simple* perl-XML-Twig perl-JSON perl-IO-Socket* perl-Socket6 perl-Time-modules* perl-NetAddr-IP* perl-DateTime* perl-ExtUtils perl-DBI perl-SNMP nmap " echo " # yum install perl-XML-Simple* perl-XML-Twig perl-JSON perl-IO-Socket* perl-Socket6 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 nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON echo " # zypper install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON
perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6 perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6
perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client perl-SNMP" perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client"
echo " " echo " "
echo " You also will need to install (optionally) 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 " "
@ -134,12 +134,12 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client perl-S
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-NetAddr-IP p5-XML-Simple p5-XML-Twig p5-HTML-Parser p5-Net-SNMP p5-SNMP p5-DBD-mysql p5-Socket6 p5-IO-Socket-INET6" echo " Recommended: p5-DBI p5-NetAddr-IP p5-XML-Simple p5-XML-Twig p5-HTML-Parser p5-DBD-mysql p5-Socket6 p5-IO-Socket-INET6"
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 Time::Local DBI SNMP Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON" echo " $ cpan Time::Local DBI Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON"
echo " " echo " "
rm output rm output
else else