Centreon Forum  

Go Back   Centreon Forum > Centreon Use > Setup

Setup For all questions about Centreon Setup

Reply
 
Thread Tools Display Modes
  #1  
Old 17th March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default Trap SNMP

***********
** Français **
***********

Bonjour à tous !

Encore un problème avec les trap snmp... snmptt et snmptrapd. J'ai déjà lu tout le sujet http://forum.centreon.com/f7/besoin-...s-traps-t8549/ qui m'a permis de régler une partie de mon problème, mais ça ne fonctionne toujours pas.

Quand je génère une trap, mon serveur la reçoit bien (vérifié avec tcpdump -i eth1 -u port 162) :
Code:
12:48:16.519615 IP 43.198.132.234.snmp-trap > fralsamismon01.local.snmp-trap:  Trap(81)  E:cisco.1.745 43.198.132.234 linkDown 1506500 [|snmp]
12:48:26.820876 IP 43.198.132.234.snmp-trap > fralsamismon01.local.snmp-trap:  Trap(81)  E:cisco.1.745 43.198.132.234 linkUp 1507500 [|snmp]
Dans le syslog, tout est ok aussi :
Code:
Mar 17 13:32:56 fralsamismon01 snmptrapd[303]: 2010-03-17 13:32:51 43.198.132.234(via UDP: [43.198.132.234]:162) TRAP, SNMP v1, community public ^I.1.3.6.1.4.1.9.1.745 Link Down Trap (0) Uptime: 4:55:40.00 ^I.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1^I.1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)^I.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: down(2)
Mar 17 13:33:07 fralsamismon01 snmptrapd[303]: 2010-03-17 13:33:02 43.198.132.234(via UDP: [43.198.132.234]:162) TRAP, SNMP v1, community public ^I.1.3.6.1.4.1.9.1.745 Link Up Trap (0) Uptime: 4:55:51.00 ^I.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1^I.1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)^I.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: up(1)
Mon premier problème était que snmptt ne fonctionnait pas. Il manquait en fait le module perl "Config::IniFiles" et maintenant il fonctionne.

Cependant, j'ai l'impression que tout ne va pas jusqu'au bout. Je n'ai aucun fichier snmptt.log ni snmptrapd.log, donc j'ai l'impression que snmptrapd ne passe pas et donc que snmptt non plus.

Je suis sous Ubuntu.

snmptrapd.conf :
Code:
###########################################################################
#
# snmptrapd.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Trap Handlers
#
#   Here we define what programs are run when a trap is
#   received by the trap receiver.

# Disable Auth
disableAuthorization yes


# traphandle: When traps are received, a program can be run.
#   When traps are received, the list of configured trap
#   handles is consulted and any configured program is run.
#   If no handler is found, any handler with "default" as the
#   traphandle type is run instead.  The information contained
#   in trap is passed to the program via standard input (see
#   the snmptrapd.conf manual page for details).
#
#   arguments: oid|"default" program args

traphandle  default /usr/local/centreon/bin/snmptt --ini=/etc/snmp/centreon_traps/snmptt.ini
Je suis désolé de reposter à nouveau sur ce sujet, je sais qu'il a été traité plusieurs fois, je l'ai vu et j'ai lu attentivement ces sujets, mais je n'y arrive toujours pas.

Que vous faut-il d'autre pour pouvoir m'aider ?

Merci d'avance !



***********
** English **
***********

Hello !

Again a problem about snmp traps... with snmptt and snmptrapd. I have already read this thread http://forum.centreon.com/f7/besoin-...s-traps-t8549/.

As you can see, I receive traps on the server :
Code:
12:48:16.519615 IP 43.198.132.234.snmp-trap >  fralsamismon01.local.snmp-trap:  Trap(81)  E:cisco.1.745 43.198.132.234  linkDown 1506500 [|snmp]
12:48:26.820876 IP 43.198.132.234.snmp-trap >  fralsamismon01.local.snmp-trap:  Trap(81)  E:cisco.1.745 43.198.132.234  linkUp 1507500 [|snmp]
In the syslog, everything is ok :
Code:
Mar 17 13:32:56 fralsamismon01 snmptrapd[303]: 2010-03-17 13:32:51  43.198.132.234(via UDP: [43.198.132.234]:162) TRAP, SNMP v1, community  public ^I.1.3.6.1.4.1.9.1.745 Link Down Trap (0) Uptime: 4:55:40.00  ^I.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1^I.1.3.6.1.2.1.2.2.1.7.1 = INTEGER:  up(1)^I.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: down(2)
Mar 17 13:33:07 fralsamismon01 snmptrapd[303]: 2010-03-17 13:33:02  43.198.132.234(via UDP: [43.198.132.234]:162) TRAP, SNMP v1, community  public ^I.1.3.6.1.4.1.9.1.745 Link Up Trap (0) Uptime: 4:55:51.00  ^I.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1^I.1.3.6.1.2.1.2.2.1.7.1 = INTEGER:  up(1)^I.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: up(1)
My first problem was snmptt which didn't work. Perl module "Config::IniFiles" was missing and now it works.

However, there is another problem because I have neither snmptt.log nor snmptrapd.log, so I guess snmptrapd and snmptt are not working.

Server is Ubuntu.

snmptrapd.conf :
Code:
###########################################################################
#
# snmptrapd.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Trap Handlers
#
#   Here we define what programs are run when a trap is
#   received by the trap receiver.

# Disable Auth
disableAuthorization yes


# traphandle: When traps are received, a program can be run.
#   When traps are received, the list of configured trap
#   handles is consulted and any configured program is run.
#   If no handler is found, any handler with "default" as the
#   traphandle type is run instead.  The information contained
#   in trap is passed to the program via standard input (see
#   the snmptrapd.conf manual page for details).
#
#   arguments: oid|"default" program args

traphandle  default /usr/local/centreon/bin/snmptt  --ini=/etc/snmp/centreon_traps/snmptt.ini
I am sorry to post again about this subject, I know that it has already been handled many times , I saw and read them, but I can't make it work.

What do you need to help me ?

Thanks !
Reply With Quote
  #2  
Old 22nd March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

petit up ?

J'ai plusieurs éléments à superviser par les traps dans mon entreprise et ça serait vraiment super que quelqu'un puisse m'aider car je n'ai toujours pas trouver d'où vient le problème.... merci d'avance !!

---

I have several items to monitor by traps in my company and it would be great that someone could help me, because I still have not found what the problem is.... thanks !!
Reply With Quote
  #3  
Old 22nd March 2010
surcouf surcouf is offline
Senior Member
Gourou
 
Join Date: Dec 2004
Location: Montgeron
Age: 33
Posts: 1,115
Send a message via MSN to surcouf
Default

Peux-tu fournir le contenu du fichier /etc/snmp/centreon_traps/snmptt.ini, ainsi que les fichiers inclus (normalement mentionnés à la fin du fichier) ?
__________________
Raphaël 'SurcouF' Bordet
Je ne teste pas mes plugins en root, tu ne testes pas tes plugins en root...
Dons Paypal
Reply With Quote
  #4  
Old 22nd March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

Merci pour ta réponse.

Voici les fichiers.

snmptt.ini :

Code:
# SNMPTT v1.0 Configuration File
#
# Linux / Unix
#

[General]
# Set to either 'standalone' or 'daemon'
# standalone: snmptt called from snmptrapd.conf
# daemon: snmptrapd.conf calls snmptthandler
# Ignored by Windows.  See documentation
mode = standalone

multiple_event = 1
dns_enable = 0
strip_domain = 0
strip_domain_list = <<END
myDomain.com
END
resolve_value_ip_addresses = 0
net_snmp_perl_enable = 1
net_snmp_perl_best_guess = 0
translate_log_trap_oid = 0
translate_value_oids = 1
translate_enterprise_oid_format = 1
translate_trap_oid_format = 1
translate_varname_oid_format = 1
translate_integers = 1
#mibs_environment = ALL
wildcard_expansion_separator = " "
allow_unsafe_regex = 0
remove_backslash_from_quotes = 0
dynamic_nodes = 0
description_mode = 0
translate_integers = 1
description_clean = 1
daemon_fork = 1
daemon_uid = root
spool_directory = /var/spool/snmptt/           # aucun répertoire snmptt créé ici
sleep = 2
use_trap_time = 1
keep_unlogged_traps = 1
stdout_enable = 0
log_enable = 1
log_file = /var/log/snmptt.log                   # aucun fichier snmptt.log créé ici
unknown_trap_log_enable = 1
unknown_trap_log_file = /var/log/snmpttunknown.log        # aucun fichier snmptt.log créé ici
statistics_interval = 0
syslog_enable = 0
syslog_facility = local0
syslog_level_debug = <<END
END
syslog_level_info = <<END
END
syslog_level_notice = <<END
END
syslog_level_warning = <<END
END
syslog_level_err = <<END
END
syslog_level_crit = <<END
END
syslog_level_alert = <<END
END
syslog_level = info
syslog_system_enable = 1
syslog_system_facility = local0
syslog_system_level = err

[SQL]
db_translate_enterprise = 0
db_unknown_trap_format = '$-*'
mysql_dbi_enable = 0
mysql_dbi_host = localhost
mysql_dbi_port = 3306
mysql_dbi_database = snmptt
mysql_dbi_table = snmptt
mysql_dbi_table_unknown = snmptt_unknown
mysql_dbi_username = snmpttuser
mysql_dbi_password = password
mysql_ping_on_insert = 1
mysql_ping_interval = 300
postgresql_dbi_enable = 0
postgresql_dbi_module = 0
postgresql_dbi_hostport_enable = 0
postgresql_dbi_host = localhost
postgresql_dbi_port = 5432
postgresql_dbi_database = snmptt
postgresql_dbi_table_unknown = snmptt_unknown
postgresql_dbi_table = snmptt
postgresql_dbi_username = snmpttuser
postgresql_dbi_password = password
postgresql_ping_on_insert = 1
postgresql_ping_interval = 300
dbd_odbc_enable = 0
dbd_odbc_dsn = snmptt
dbd_odbc_table = snmptt
dbd_odbc_table_unknown = snmptt_unknown
dbd_odbc_username = snmptt
dbd_odbc_password = password
dbd_odbc_ping_on_insert = 1
dbd_odbc_ping_interval = 300

[Exec]
exec_enable = 1

[Debugging]
DEBUGGING = 0
DEBUGGING_FILE = /var/log/debug.snmptt            # aucun fichier debug.snmptt créé ici
DEBUGGING_FILE_HANDLER = /var/log/snmptthandler.debug    # aucun fichier debug.snmptt créé ici

[TrapFiles]
snmptt_conf_files = <<END
/etc/snmp/centreon_traps/snmptt-Cisco.conf
/etc/snmp/centreon_traps/snmptt-HP.conf
/etc/snmp/centreon_traps/snmptt-3com.conf
/etc/snmp/centreon_traps/snmptt-Linksys.conf
/etc/snmp/centreon_traps/snmptt-Dell.conf
/etc/snmp/centreon_traps/snmptt-Generic.conf
/etc/snmp/centreon_traps/snmptt-Apache.conf
/etc/snmp/centreon_traps/snmptt-Zebra.conf
/etc/snmp/centreon_traps/snmptt-SQL-Server.conf
/etc/snmp/centreon_traps/snmptt-HP-Compaq.conf
END
Ces répertoires et fichiers n'existent pas :
Quote:
/var/spool/snmptt/
/var/log/snmptt.log
/var/log/snmpttunknown.log
/var/log/debug.snmptt
/var/log/snmptthandler.debug
Pour les fichiers inclus, il n'y a que les fichiers traps et je pense que le fonctionnement est le même pour tous, donc je ne mets que snmptt-Generic.conf :

Code:
EVENT linkDown .1.3.6.1.6.3.1.1.5.3 "Status Event" 2
FORMAT Link down on interface $2. State: $4.
EXEC /usr/local/centreon/bin/centTrapHandler-2.x $aA $A $o "Link down on interface $2. State: $4."
SDESC
A linkDown(2) trap signifies that the sending protocol entity recognizes a failure in one of the communication links represented in the agent's configuration.
EDESC

EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Event" 0
FORMAT Link up on interface $2. State: $4.
EXEC /usr/local/centreon/bin/centTrapHandler-2.x $aA $A $o "Link up on interface $2. State: $4."
SDESC
A linkUp(3) trap signifies that the sending protocol entity recognizes that one of the communication links represented in the agent's configuration has come up.
EDESC

EVENT warmStart .1.3.6.1.6.3.1.1.5.2 "Status Event" 0
FORMAT A warmStart trap signifies that the SNMP entity, $*
EXEC /usr/local/centreon/bin/centTrapHandler-2.x $aA $A $o "A warmStart trap signifies that the SNMP entity, $*"
SDESC
A warmStart trap signifies that the SNMP entity,
supporting a notification originator application,
is reinitializing itself such that its configuration
is unaltered.
Variables:
EDESC

EVENT coldStart .1.3.6.1.6.3.1.1.5.1 "Status Event" 1
FORMAT A coldStart trap signifies that the SNMP entity, $*
EXEC /usr/local/centreon/bin/centTrapHandler-2.x $aA $A $o "A coldStart trap signifies that the SNMP entity, $*"
SDESC
A coldStart trap signifies that the SNMP entity,
supporting a notification originator application, is
reinitializing itself and that its configuration may
have been altered.
Variables:
EDESC

EVENT authenticationFailure .1.3.6.1.6.3.1.1.5.5 "Status Event" 0
FORMAT An authenticationFailure trap signifies that the SNMP $*
EXEC /usr/local/centreon/bin/centTrapHandler-2.x $aA $A $o "An authenticationFailure trap signifies that the SNMP $*"
SDESC
An authenticationFailure trap signifies that the SNMP
entity has received a protocol message that is not
properly authenticated.  While all implementations
of SNMP entities MAY be capable of generating this
trap, the snmpEnableAuthenTraps object indicates
whether this trap will be generated.
Variables:
EDESC
Merci d'avance pour l'aide apportée !
Reply With Quote
  #5  
Old 26th March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

personne ne saurait ?
Reply With Quote
  #6  
Old 31st March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

Merci quand même d'y avoir réfléchi pour ceux qui ont essayé. Je laisse tomber car je ne trouve toujours pas et je dois passer à une autre étape...
Reply With Quote
  #7  
Old 31st March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

Bon, finalement je n'abandonne pas, je n'aime pas ça

J'ai vu dans les processus que snmptrapd travaille quand le serveur reçoit une trap. Par contre, pas de trace de snmptt.

Dans le fichier snmptrapd.conf, il y a une commande qui lance snmptt. J'ai tenté de l'exécuter manuellement, et :
Code:
Config file /etc/snmp/centreon_traps/snmptt.ini loaded
Can't locate SNMP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 4) line 1.

Could not load the Perl module SNMP!  If net_snmp_perl_enable is
enabled then the SNMP module is required.  Please see snmptt.html
for system requirements.  Note:  SNMPTT uses the Net-SNMP package's
SNMP module, NOT the CPAN Net::SNMP module!
Je crois que j'avais effectivement confondu le Net-SNMP avec le module CPAN Net::SNMP...

Last edited by manu7762323; 31st March 2010 at 16:18.
Reply With Quote
  #8  
Old 31st March 2010
surcouf surcouf is offline
Senior Member
Gourou
 
Join Date: Dec 2004
Location: Montgeron
Age: 33
Posts: 1,115
Send a message via MSN to surcouf
Default

Quote:
Originally Posted by manu7762323 View Post
Bon, finalement je n'abandonne pas, je n'aime pas ça

J'ai vu dans les processus que snmptrapd travaille quand le serveur reçoit une trap. Par contre, pas de trace de snmptt.

Dans le fichier snmptrapd.conf, il y a une commande qui lance snmptt. J'ai tenté de l'exécuter manuellement, et :
Code:
Config file /etc/snmp/centreon_traps/snmptt.ini loaded
Can't locate SNMP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 4) line 1.

Could not load the Perl module SNMP!  If net_snmp_perl_enable is
enabled then the SNMP module is required.  Please see snmptt.html
for system requirements.  Note:  SNMPTT uses the Net-SNMP package's
SNMP module, NOT the CPAN Net::SNMP module!
Je crois que j'avais effectivement confondu le Net-SNMP avec le module CPAN Net::SNMP...
C'est en effet un piège à débutants :
- le module pur Perl Net::SNMP ;
- le module Perl SNMP du projet Net-SNMP.
Ces deux modules n'ont en effet rien à voir à part le protocole.
__________________
Raphaël 'SurcouF' Bordet
Je ne teste pas mes plugins en root, tu ne testes pas tes plugins en root...
Dons Paypal
Reply With Quote
  #9  
Old 31st March 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

Maintenant je suis persuadé que je suis toujours débutant
En plus j'ai mis tellement de temps à trouver d'où pouvait provenir le problème alors que c'était finalement tellement simple ...

J'installe ça demain et j'espère que ce sera bon !

Merci pour la précision !
Reply With Quote
  #10  
Old 1st April 2010
manu7762323 manu7762323 is offline
Junior Member
Newbie
 
Join Date: Mar 2010
Posts: 25
Default

Hello !

J'ai des problèmes pour l'installation... La doc sur www.net-snmp.org, dit, pour installer le module perl :
Code:
Installation:

   Build and install the Net-SNMP package - see Net-SNMP README and
   INSTALL docs.

   (Note: To ensure that any previous Net-SNMP, ucd-snmp or cmu snmp
   installation's library or headers are not used by mistake, use the
   -NET-SNMP-CONFIG directive to explicitly set the path to the
   net-snmp-config command that knows about the net-snmp installation you
   want to use.)

   NOTE: build all the perl modules at once using the Makefile.PL in the
   net-snmp/perl directory rather than the one in this directory.

   Unix:

   cd net-snmp/perl
   perl Makefile.PL [-NET-SNMP-CONFIG="sh ../../net-snmp-config"] [-NET-SNMP-IN-SOURCE=true]
   make
   make test
   make install
Quand je tape la 2e ligne "perl Makefile .PL [-NET-SNMP....." j'ai les erreurs suivantes :
Code:
root@mon01:/downloads/net-snmp-5.5/perl# perl Makefile.PL [-NET-SNMP-CONFIG="sh ../../net-snmp-config"] [-NET-SNMP-IN-SOURCE=true]
'[-NET-SNMP-CONFIG' is not a known MakeMaker parameter name.
'[-NET-SNMP-IN-SOURCE' is not a known MakeMaker parameter name.
Unrecognized argument in LIBS ignored: '-Wl,-Bsymbolic-functions'
Writing Makefile for NetSNMP::default_store
Unrecognized argument in LIBS ignored: '-Wl,-Bsymbolic-functions'
Writing Makefile for NetSNMP::ASN
ERROR:
Net-SNMP installed version: 5.4.1 => 5.0401
Perl Module Version:        5.05

These versions must match for perfect support of the module.  It is possible
that different versions may work together, but it is strongly recommended
that you make these two versions identical.  You can get the Net-SNMP
source code and the associated perl modules directly from

   http://www.net-snmp.org/

If you want to continue anyway please set the NETSNMP_DONT_CHECK_VERSION
environmental variable to 1 and re-run the Makefile.PL script.
Je ne comprends pas trop ce qu'il faut que je fasse... est-ce que vous pouvez m'aider ?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:21.