mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2012-02-20 Koichiro Kikuchi <koichiro@rworks.jp>
* lib/PandoraFMS/SNMPServer.pm: Parse source field to obtain source IP address not only when trap version is SNMPv2, but also when snmp_pdu_address set to 1. * conf/pandora_server.conf: Fixed comment. * FreeBSD/pandora_server.conf: Added missing configuration tokens. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5626 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b5da410728
commit
7970e644a1
@ -1,3 +1,13 @@
|
|||||||
|
2012-02-20 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/SNMPServer.pm: Parse source field to obtain source
|
||||||
|
IP address not only when trap version is SNMPv2, but also
|
||||||
|
snmp_pdu_address set to 1.
|
||||||
|
|
||||||
|
* conf/pandora_server.conf: Fixed comment.
|
||||||
|
|
||||||
|
* FreeBSD/pandora_server.conf: Added missing configuration tokens.
|
||||||
|
|
||||||
2012-02-20 Ramon Novoa <rnovoa@artica.es>
|
2012-02-20 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* conf/pandora_server.conf,
|
* conf/pandora_server.conf,
|
||||||
|
@ -38,6 +38,9 @@ errorlog_file /var/log/pandora/pandora_server.error
|
|||||||
|
|
||||||
# daemon 1
|
# daemon 1
|
||||||
|
|
||||||
|
# dbengine: mysql, postgresql or oracle (mysql by default)
|
||||||
|
#dbengine mysql
|
||||||
|
|
||||||
# Database credentials. A VERY important configuration.
|
# Database credentials. A VERY important configuration.
|
||||||
# This must be the same credentials used by your Pandora FMS Console
|
# This must be the same credentials used by your Pandora FMS Console
|
||||||
# but could be different if your console is not running in the same
|
# but could be different if your console is not running in the same
|
||||||
@ -59,6 +62,9 @@ dbpass pandora
|
|||||||
|
|
||||||
dbhost localhost
|
dbhost localhost
|
||||||
|
|
||||||
|
# By default, parent agent will not update
|
||||||
|
#update_parent 0
|
||||||
|
|
||||||
# verbosity: level of detail on errors/messages (0 default, 1 verbose, 2 debug.... 10 noisy)
|
# verbosity: level of detail on errors/messages (0 default, 1 verbose, 2 debug.... 10 noisy)
|
||||||
# -v in command line (verbose) or -d (debug). Set this to 10 when try to locate problems and
|
# -v in command line (verbose) or -d (debug). Set this to 10 when try to locate problems and
|
||||||
# set to 0 or 1 on production enviroments.
|
# set to 0 or 1 on production enviroments.
|
||||||
@ -74,6 +80,12 @@ master 1
|
|||||||
|
|
||||||
snmpconsole 1
|
snmpconsole 1
|
||||||
|
|
||||||
|
# snmptrapd will ignore authenticationFailure traps if set to 1.
|
||||||
|
snmp_ignore_authfailure 1
|
||||||
|
|
||||||
|
# snmptrapd will read the PDU source address instead of the agent-addr field is set to 1.
|
||||||
|
snmp_pdu_address 0
|
||||||
|
|
||||||
# Activate (1) Pandora Network Server
|
# Activate (1) Pandora Network Server
|
||||||
|
|
||||||
networkserver 1
|
networkserver 1
|
||||||
@ -334,3 +346,15 @@ snmp_threads 2
|
|||||||
# Block size for block producer/consumer servers, that is, the number of modules
|
# Block size for block producer/consumer servers, that is, the number of modules
|
||||||
# per block (15 by default) (PANDORA FMS ENTERPRISE ONLY).
|
# per block (15 by default) (PANDORA FMS ENTERPRISE ONLY).
|
||||||
block_size 15
|
block_size 15
|
||||||
|
|
||||||
|
# Enable (1) or disable (0) Pandora FMS Netflow Server (PANDORA FMS ENTERPRISE ONLY).
|
||||||
|
netflowserver 1
|
||||||
|
|
||||||
|
# Path to the netflow daemon nfcapd.
|
||||||
|
netflow_daemon /usr/local/bin/nfcapd
|
||||||
|
|
||||||
|
# Netflow file rotation interval in seconds.
|
||||||
|
netflow_interval 300
|
||||||
|
|
||||||
|
# Base directory where netflow files will be stored.
|
||||||
|
netflow_basedir /tmp
|
||||||
|
@ -232,7 +232,7 @@ autocreate 1
|
|||||||
|
|
||||||
max_log_size 65536
|
max_log_size 65536
|
||||||
|
|
||||||
# max_queue_files (250 by default)
|
# max_queue_files (500 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.
|
||||||
|
|
||||||
|
@ -171,13 +171,6 @@ sub pandora_snmptrapd {
|
|||||||
($date, $time, $source, $data) = split(/\[\*\*\]/, $line, 4);
|
($date, $time, $source, $data) = split(/\[\*\*\]/, $line, 4);
|
||||||
my @data = split(/\t/, $data);
|
my @data = split(/\t/, $data);
|
||||||
|
|
||||||
# extract IP address from %b part:
|
|
||||||
# * destination part appears in Net-SNMP > 5.3
|
|
||||||
# * protocol name part and bracketted IP addr w/ port number appear in
|
|
||||||
# Net-SNMP > 5.1 (Net-SNMP 5.1 has IP addr only).
|
|
||||||
# * port number is signed in Net-SNMP 5.2
|
|
||||||
$source =~ s/(?:(?:TCP|UDP):\s*)?\[?([^] ]+)\]?(?::-?\d+)?(?:\s*->.*)?$/$1/;
|
|
||||||
|
|
||||||
shift @data; # Drop unused 1st data.
|
shift @data; # Drop unused 1st data.
|
||||||
$oid = shift @data;
|
$oid = shift @data;
|
||||||
|
|
||||||
@ -189,6 +182,15 @@ sub pandora_snmptrapd {
|
|||||||
$data = join("\t", @data);
|
$data = join("\t", @data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($trap_ver eq "SNMPv2" || $pa_config->{'snmp_pdu_address'} eq '1' ) {
|
||||||
|
# extract IP address from %b part:
|
||||||
|
# * destination part (->[dest_ip]:dest_port) appears in Net-SNMP > 5.3
|
||||||
|
# * protocol name (TCP: or UDP:) and bracketted IP addr w/ port number appear in
|
||||||
|
# Net-SNMP > 5.1 (Net-SNMP 5.1 has IP addr only).
|
||||||
|
# * port number is signed (often negative) in Net-SNMP 5.2
|
||||||
|
$source =~ s/(?:(?:TCP|UDP):\s*)?\[?([^] ]+)\]?(?::-?\d+)?(?:\s*->.*)?$/$1/;
|
||||||
|
}
|
||||||
|
|
||||||
my $timestamp = $date . ' ' . $time;
|
my $timestamp = $date . ' ' . $time;
|
||||||
my ($custom_oid, $custom_type, $custom_value) = ('', '', '');
|
my ($custom_oid, $custom_type, $custom_value) = ('', '', '');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user