centreon / centreon-clapi

Centreon CLAPI Module
14 stars 14 forks source link

generatetraps - Wrong severity value set #324

Open lboue opened 9 years ago

lboue commented 9 years ago

Hello,

I am trying to generate new SNMP traps from a given MIB file "JUNIPER-VIRTUALCHASSIS-MIB" MIB (http://www.juniper.net/techpubs/en_US/junos12.1/topics/reference/mibs/mib-jnx-virtualchassis.txt). This is not working like you can see below. I am getting a "Could not find DEFINITION" errror.

 centreon -u admin -p password -o VENDOR -a generatetraps -v "Juniper;/usr/share/snmp/mibs/mib-jnx-virtualchassis.txt" 

*****  Processing MIB file *****

snmptranslate version: NET-SNMP version: 5.5
severity: Normal

File to load is:        /tmp/mib-jnx-virtualchassis.txt
File to APPEND TO:      /tmp/mib-jnx-virtualchassis.txt.conf

MIBS environment var:   /tmp/mib-jnx-virtualchassis.txt
mib name: JUNIPER-VIRTUALCHASSIS-MIB

Processing MIB:         JUNIPER-VIRTUALCHASSIS-MIB
#
skipping a TRAP-TYPE / NOTIFICATION-TYPE line - probably an import line.
#
Line: 415
NOTIFICATION-TYPE: jnxVccpPortUp
Variables: jnxVirtualChassisPortAdminStatus jnxVirtualChassisPortOperStatus jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
Enterprise: jnxVccpNotificationsPrefix
Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpPortUp
OID: .1.3.6.1.4.1.2636.4.14.0.1
#
Line: 430
NOTIFICATION-TYPE: jnxVccpPortDown
Variables: jnxVirtualChassisPortAdminStatus jnxVirtualChassisPortOperStatus jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
Enterprise: jnxVccpNotificationsPrefix
Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpPortDown
OID: .1.3.6.1.4.1.2636.4.14.0.2
#
Line: 445
NOTIFICATION-TYPE: jnxVccpMemberUp
Variables: jnxVirtualChassisMemberSerialnumber jnxVirtualChassisMemberRole jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
Enterprise: jnxVccpNotificationsPrefix
Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpMemberUp
OID: .1.3.6.1.4.1.2636.4.14.0.3
#
Line: 459
NOTIFICATION-TYPE: jnxVccpMemberDown
Variables: jnxVirtualChassisMemberSerialnumber jnxVirtualChassisMemberRole jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
Enterprise: jnxVccpNotificationsPrefix
Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpMemberDown
OID: .1.3.6.1.4.1.2636.4.14.0.4

Done

Total translations:        4
Successful translations:   4
Failed translations:       0
2015-11-30 13:55:47 - Wrong severity value set.
2015-11-30 13:55:47 - snmptranslate version: NET-SNMP version: 5.5
2015-11-30 13:55:47 - mib name: 
2015-11-30 13:55:47 - Could not find DEFINITIONS ::= BEGIN statement in MIB file!

I can't find why because I have JUNIPER mibs in /usr/share/snmp/mibs/ directory:

ls /usr/share/snmp/mibs/mib-jnx-*
/usr/share/snmp/mibs/mib-jnx-cfgmgmt.txt       /usr/share/snmp/mibs/mib-jnx-ex-smi.txt          /usr/share/snmp/mibs/mib-jnx-power-supply-unit.txt
/usr/share/snmp/mibs/mib-jnx-chas-defines.txt  /usr/share/snmp/mibs/mib-jnx-fabric-chassis.txt  /usr/share/snmp/mibs/mib-jnx-qf-smi.txt
/usr/share/snmp/mibs/mib-jnx-chassis.txt       /usr/share/snmp/mibs/mib-jnx-hostresources.txt   /usr/share/snmp/mibs/mib-jnx-smi.txt
/usr/share/snmp/mibs/mib-jnx-cos.txt           /usr/share/snmp/mibs/mib-jnx-if-extensions.txt   /usr/share/snmp/mibs/mib-jnx-syslog.txt
/usr/share/snmp/mibs/mib-jnx-event.txt         /usr/share/snmp/mibs/mib-jnx-mac.txt             /usr/share/snmp/mibs/mib-jnx-virtualchassis.txt

If I try with WebUI with the page called "Import SNMP traps from MIB file", it works:

Moving traps in DataBase...
2015-11-30 13:54:32 - snmptranslate version: NET-SNMP version: 5.5
2015-11-30 13:54:32 - mib name: JUNIPER-VIRTUALCHASSIS-MIB
2015-11-30 13:54:32 - Processing MIB: JUNIPER-VIRTUALCHASSIS-MIB
2015-11-30 13:54:32 - #
2015-11-30 13:54:32 - skipping a TRAP-TYPE / NOTIFICATION-TYPE line - probably an import line.
2015-11-30 13:54:32 - #
2015-11-30 13:54:32 - Line: 261
2015-11-30 13:54:32 - NOTIFICATION-TYPE: jnxVccpPortUp
2015-11-30 13:54:32 - Variables: jnxVirtualChassisPortAdminStatus jnxVirtualChassisPortOperStatus jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
2015-11-30 13:54:32 - Enterprise: jnxVccpNotificationsPrefix
2015-11-30 13:54:32 - Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpPortUp
2015-11-30 13:54:32 - OID: .1.3.6.1.4.1.2636.4.14.0.1
2015-11-30 13:54:32 - #
2015-11-30 13:54:32 - Line: 276
2015-11-30 13:54:32 - NOTIFICATION-TYPE: jnxVccpPortDown
2015-11-30 13:54:32 - Variables: jnxVirtualChassisPortAdminStatus jnxVirtualChassisPortOperStatus jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
2015-11-30 13:54:32 - Enterprise: jnxVccpNotificationsPrefix
2015-11-30 13:54:32 - Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpPortDown
2015-11-30 13:54:32 - OID: .1.3.6.1.4.1.2636.4.14.0.2
2015-11-30 13:54:32 - #
2015-11-30 13:54:32 - Line: 291
2015-11-30 13:54:32 - NOTIFICATION-TYPE: jnxVccpMemberUp
2015-11-30 13:54:32 - Variables: jnxVirtualChassisMemberSerialnumber jnxVirtualChassisMemberRole jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
2015-11-30 13:54:32 - Enterprise: jnxVccpNotificationsPrefix
2015-11-30 13:54:32 - Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpMemberUp
2015-11-30 13:54:32 - OID: .1.3.6.1.4.1.2636.4.14.0.3
2015-11-30 13:54:32 - #
2015-11-30 13:54:32 - Line: 305
2015-11-30 13:54:32 - NOTIFICATION-TYPE: jnxVccpMemberDown
2015-11-30 13:54:32 - Variables: jnxVirtualChassisMemberSerialnumber jnxVirtualChassisMemberRole jnxVirtualChassisMemberModel jnxVirtualChassisMemberLocation
2015-11-30 13:54:32 - Enterprise: jnxVccpNotificationsPrefix
2015-11-30 13:54:32 - Looking up via snmptranslate: JUNIPER-VIRTUALCHASSIS-MIB::jnxVccpMemberDown
2015-11-30 13:54:32 - OID: .1.3.6.1.4.1.2636.4.14.0.4
2015-11-30 13:54:32 - Done
2015-11-30 13:54:32 - Total translations: 4
2015-11-30 13:54:32 - Successful translations: 4
2015-11-30 13:54:32 - Failed translations: 0

centreon -u admin -p password -o TRAP -a show| grep Juniper
607;jnxVccpPortUp;.1.3.6.1.4.1.2636.4.14.0.1;Juniper
608;jnxVccpPortDown;.1.3.6.1.4.1.2636.4.14.0.2;Juniper
609;jnxVccpMemberUp;.1.3.6.1.4.1.2636.4.14.0.3;Juniper
610;jnxVccpMemberDown;.1.3.6.1.4.1.2636.4.14.0.4;Juniper

Can you help me?

Regards

querwin commented 8 years ago

Try to reproduce, I've got an error immediatly :

sh: /usr/share/centreon//bin/snmpttconvertmib: Aucun fichier ou dossier de ce type 2016-04-22 10:32:07 - Wrong severity value set.

querwin commented 8 years ago

Seems that the command is now : centFillTrapDB

lboue commented 8 years ago

Thanks, I will try with the centFillTrapDB command.