Ad Widget

Collapse

помогите.. "invalid trap data found" zabbix 3.4.15

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zar
    Senior Member
    • Mar 2018
    • 148

    #1

    помогите.. "invalid trap data found" zabbix 3.4.15

    zabbix 3.4.15
    @f02-srv-mon01:/var/log/zabbix# uname -a
    Linux f02-srv-mon01 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    mibs отключены

    Настраиваю snmp TRAP до этого не пользовался.

    заббикс сегодня обновлял до этого такая же ошибка была в другой версии.

    snmptt trap ловит отлично вот лог его:
    Code:
    @f02-srv-mon01:/var/log/zabbix# cat snmptt.log
    23:53:02 2019/03/01 .1.3.6.1.6.3.1.1.5.2 Normal "Status Events" 10.202.250.156 - Device reinitialized (warmStart)
    23:53:02 2019/03/01 .1.3.6.1.6.3.1.1.5.2 Normal "Status Events" 10.202.250.155 - Device reinitialized (warmStart)
    дальше идем в логи zabbix и видим
    Code:
     14171:20190301:235303.779 invalid trap data found "23:53:02 2019/03/01 .1.3.6.1.6.3.1.1.5.2 Normal "Status Events" 10.202.250.156 - Device reinitialized (warmStart)
    23:53:02 2019/03/01 .1.3.6.1.6.3.1.1.5.2 Normal "Status Events" 10.202.250.155 - Device reinitialized (warmStart)
    и трап не подхватывается хостом... через snmptrap.fallback

    при этом если делать тествый трап
    Code:
    snmptrap -v 1 -c public 10.202.100.150 '1.2.3.4.5.6' '192.193.194.195' 6 99 '55' 1.11.12.13.14.15  s "teststring"
    он спокойно проходит
    Code:
     cat snmptt.log
    23:52:49 2019/03/01 .1.2.3.4.5.6.0.99 Normal "General event" 192.193.194.195 - ZBXTRAP 192.193.194.195 10.202.10.124
    ну машина личная в заббикс не заводил, в логах заббикса:
    Code:
    14171:20190301:235238.771 unmatched trap received from "192.193.194.195": 23:52:36 2019/03/01 .1.2.3.4.5.6.0.99 Normal "General event" 192.193.194.195 - 10.202.10.124



    Code:
    @f02-srv-mon01:/etc/snmp# cat snmptrapd.conf
    
    #
    # EXAMPLE-trap.conf:
    #   An example configuration file for configuring the Net-SNMP snmptrapd agent.
    #
    ###############################################################################
    #
    # This file is intended to only be an example.
    # When the snmptrapd agent starts up, this is where it will look for it.
    #
    # All lines beginning with a '#' are comments and are intended for you
    # to read.  All other lines are configuration commands for the agent.
    
    #
    # PLEASE: read the snmptrapd.conf(5) manual page as well!
    #
    #authCommunity log,execute,net private
    authCommunity log,execute,net public
    disableAuthorization yes
    
    #
    ## send mail when get any events
    #traphandle default /usr/bin/traptoemail -s smtp.example.org [email protected]
    #traphandle default snmptt
    traphandle default snmptt
    #traphandle default /usr/sbin/snmptthandler
    #traphandle perl do "/usr/bin/zabbix_trap_receiver.pl";
    
    #
    ## send mail when get linkDown
    #traphandle .1.3.6.1.6.3.1.1.5.3 /usr/bin/traptoemail -s smtp.example.org [email protected]
    Code:
    @f02-srv-mon01:/etc/snmp# cat snmptrapd.conf
    
    #
    # EXAMPLE-trap.conf:
    #   An example configuration file for configuring the Net-SNMP snmptrapd agent.
    #
    ###############################################################################
    #
    # This file is intended to only be an example.
    # When the snmptrapd agent starts up, this is where it will look for it.
    #
    # All lines beginning with a '#' are comments and are intended for you
    # to read.  All other lines are configuration commands for the agent.
    
    #
    # PLEASE: read the snmptrapd.conf(5) manual page as well!
    #
    #authCommunity log,execute,net private
    authCommunity log,execute,net public
    #authCommunity log,execute,net 'HITACHI DF800'
    disableAuthorization yes
    
    #
    ## send mail when get any events
    #traphandle default /usr/bin/traptoemail -s smtp.example.org [email protected]
    #traphandle default snmptt
    traphandle default snmptt
    #traphandle default /usr/sbin/snmptthandler
    #traphandle perl do "/usr/bin/zabbix_trap_receiver.pl";
    
    #
    ## send mail when get linkDown
    #traphandle .1.3.6.1.6.3.1.1.5.3 /usr/bin/traptoemail -s smtp.example.org [email protected]
    
    
    @f02-srv-mon01:/etc/snmp# cat snmptt.conf
    EVENT general .* "General event" Normal
    FORMAT ZBXTRAP $aA $ar
    #
    #
    #
    EVENT coldStart .1.3.6.1.6.3.1.1.5.1 "Status Events" Normal
    FORMAT Device reinitialized (coldStart)
    #EXEC qpage -f TRAP notifygroup1 "Device reinitialized (coldStart)"
    SDESC
    A coldStart trap signifies that the SNMPv2 entity, acting
    in an agent role, is reinitializing itself and that its
    configuration may have been altered.
    EDESC
    #
    #
    #
    EVENT warmStart .1.3.6.1.6.3.1.1.5.2 "Status Events" Normal
    FORMAT Device reinitialized (warmStart)
    #EXEC qpage -f TRAP notifygroup1 "Device reinitialized (warmStart)"
    SDESC
    A warmStart trap signifies that the SNMPv2 entity, acting
    in an agent role, is reinitializing itself such that its
    configuration is unaltered.
    EDESC
    #
    #
    #
    EVENT linkDown .1.3.6.1.6.3.1.1.5.3 "Status Events" Normal
    FORMAT Link down on interface $1.  Admin state: $2.  Operational state: $3
    #EXEC qpage -f TRAP notifygroup1 "Link down on interface $1.  Admin state: $2.  Operational state: $3"
    SDESC
    A linkDown trap signifies that the SNMP entity, acting in
    an agent role, has detected that the ifOperStatus object for
    one of its communication links is about to enter the down
    state from some other state (but not from the notPresent
    state).  This other state is indicated by the included value
    of ifOperStatus.
    EDESC
    #
    #
    #
    EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Normal
    FORMAT Link up on interface $1.  Admin state: $2.  Operational state: $3
    #EXEC qpage -f TRAP notifygroup1 "Link up on interface $1.  Admin state: $2.  Operational state: $3"
    SDESC
    A linkUp trap signifies that the SNMP entity, acting in an
    agent role, has detected that the ifOperStatus object for
    one of its communication links left the down state and
    transitioned into some other state (but not into the
    notPresent state).  This other state is indicated by the
    included value of ifOperStatus.
    EDESC
    #
    #
    #
    EVENT authenticationFailure .1.3.6.1.6.3.1.1.5.5 "Status Events" Normal
    FORMAT SNMP athentication failure
    #EXEC qpage -f TRAP notifygroup1 "SNMP authentication failure"
    SDESC
    An authenticationFailure trap signifies that the SNMPv2
    entity, acting in an agent role, has received a protocol
    message that is not properly authenticated.  While all
    implementations of the SNMPv2 must be capable of generating
    this trap, the snmpEnableAuthenTraps object indicates
    whether this trap will be generated.
    EDESC
    #
    #EVENT general .* "General event" Normal
    #FORMAT ZBXTRAP $aA $1 $2 $3
    
    @f02-srv-mon01:/etc/snmp#
  • Evgeniy
    Senior Member
    • May 2012
    • 157

    #2
    1)
    Теперь отформатируйте трапы, чтобы они распознавались Zabbix'ом (измените snmptt.conf):
    1. Каждая инструкция FORMAT должна начинаться с “ZBXTRAP [адрес]”, где [адрес] будет сравниваться с IP и DNS адресами у SNMP интерфейсов в Zabbix. Например:
      EVENT coldStart .1.3.6.1.6.3.1.1.5.1 “Status Events” Normal
      FORMAT ZBXTRAP $aA Device reinitialized (coldStart)
    Вашу конструкцию zabbix не понимает и видимо об этом пишет в логе
    EVENT warmStart .1.3.6.1.6.3.1.1.5.2 "Status Events" Normal FORMAT Device reinitialized (warmStart)
    2)
    Zabbix ищет все соответствующие элементы данных с типом “SNMP трап” на интерфейсах узлов сети по каждому трапу, которые совпадают с полученным адресом из трапа
    Т.е. если элемент данных на соответствующем интерфейсе не создан, то и увидите в логе "unmatched trap".
    Last edited by Evgeniy; 01-03-2019, 19:33.

    Comment


    • zar
      zar commented
      Editing a comment
      привет, спасибо за ответ, я не могу описать все трапы которые может отправлять хост.. я их даже не знаю.. мне наверно нужен вообще Аларм на любой трап что падает сэтого хоста т.к. это hitachi datastore ams2100 и любой с нее трап это уже проблема...
  • zar
    Senior Member
    • Mar 2018
    • 148

    #3

    привет, спасибо за ответ, я не могу описать все трапы которые может отправлять хост.. я их даже не знаю.. мне нужен вообще Аларм на любой трап что падает сэтого хоста т.к. это hitachi datastore ams2100 и любой с нее трап это уже проблема...

    я просто не могу понять, почему с конструкцией когда у меня нету
    EVENT coldStart .1.3.6.1.6.3.1.1.5.1 “Status Events” Normal
    FORMAT ZBXTRAP $aA Device reinitialized (coldStart)
    я отправляю тестовый трап со своей машины
    snmptrap -v 1 -c public 10.202.100.150 '1.2.3.4.5.6' '192.193.194.195' 6 99 '55' 1.11.12.13.14.15 s "teststring" и не меняя конструкцию - заббикс его забирает и заносит в переменную snmptrap.fallback
    а когда сам сервер отправлят - то он его непонимает....

    Comment

    • Evgeniy
      Senior Member
      • May 2012
      • 157

      #4
      Почему не можете? У вас в конфиге есть универсальная запись, под которую попадают все возможные трапы:

      Code:
      @f02-srv-mon01:/etc/snmp# cat snmptt.conf  
       EVENT general .* "General event" Normal FORMAT ZBXTRAP $aA $ar
      И тестовый трап с OID '1.2.3.4.5.6' тоже попадает под нее...

      Comment

      • Evgeniy
        Senior Member
        • May 2012
        • 157

        #5
        Если вы хотите получить именно трап coldstart, так и отправьте его...
        snmptrap -v 1 -c public 127.0.0.1 '.1.3.6.1.6.3.1.1.5.1' 'х.х.х.х' 6 33 '55' .1.3.6.1.6.3.1.1.5.3 s "teststring000"
        где 127.0.0.1 - адрес сервера заббикс (получатель)
        х.х.х.х - адрес узла сети (источник), в вашем случае это адрес узла сети в заббиксе = адрес сервера hitachi datastore ams2100
        Заранее проверьте, что в конфиге у вас точно прописано
        EVENT coldStart .1.3.6.1.6.3.1.1.5.1 “Status Events” Normal
        FORMAT ZBXTRAP $aA Device reinitialized (coldStart)

        Comment

        • zar
          Senior Member
          • Mar 2018
          • 148

          #6
          Спасибо! буду смотреть!
          Но тогда вопрос...
          у меня есть эти строки: EVENT general .* "General event" Normal FORMAT ZBXTRAP $aA $1 $2 $3 (тут у меня почему то закоменчено но в самом конфиге строки разкоментированы) НО zabbix ругался на
          14171:20190301:235238.771 unmatched trap received from "192.193.194.195": 23:52:36 2019/03/01 .1.2.3.4.5.6.0.99 Normal "General event" 192.193.194.195 - 10.202.10.124 Всё бы хорошо, но сталкнулся с проблемой самого AMS 2100 не отправляет трапы связанные с ошибками hdd
          сегодня вылетил жесткий диск - ни одного трапа в логах нет.. хотя тестовые приходят...
          когда дергаешь питание с блока - трап приходит... ( грусть печаль. придется искать как настраивать snmtp без трапов... но там вообще непонятки... ошибки не показывает разбираюсь уже несколько недель без передыху (

          Comment

          • Evgeniy
            Senior Member
            • May 2012
            • 157

            #7
            Как-то тяжко у вас с трапами идет.... Увидел другую вашу тему, все же перед глазами в "каком-то mib от хитачи" =))....


            Вот ошибки:
            Hitachi-DF-RAID-LAN-MIB::dfRegressionStatus.0 = INTEGER: 69
            Навскидку, вот расшифровка по битовой маске:
            Code:
            dfRegressionStatus OBJECT-TYPE
                              SYNTAX    INTEGER
                              ACCESS    read-only
                              STATUS    mandatory
                              DESCRIPTION
                                         "A value of regression status.
            
                                          Bit          Comment
                                           0           drive status.
                                           1           spare drive status.
                                           2           data drive status.
                                           3           ENC status.
                                           4-5         not used,always 0.
                                           6           warning status.
                                           7           Other controller status.
                                           8           UPS status.
                                           9           loop status.
                                           10          path status.
                                           11          NAS Server status.
                                           12          NAS Path status.
                                           13          NAS UPS status.
                                           14-15       not used,always 0.
                                           16          battery status.
                                           17          power supply status.
                                           18          AC status.
                                           19          BK status.
                                           20          fan status.
                                           21-23       not used,always 0.
                                           24          cache memory status.
                                           25-31       not used,always 0.
            
                                           When the status is normal,each bit value
                                           is 0. When the status is abnormal,each bit
                                           value is 1.
                                           "
                              ::= { dfWarningCondition 1 }
            69 = 1000101
            Ошибки: drive status, data drive status, warning status.
            А дальше разбирайтесь с функцией band триггеров.

            Comment

            • zar
              Senior Member
              • Mar 2018
              • 148

              #8
              !!!!!!!!!!!! Спасибо огромное!!! очень сильно помог ))))) я видимо слепой стал совсем..... не мог найти куда ошибка выводится!
              слушай, чтоб просто понять и закрепить, сейчас сделал ошибку 131136 как ее расшифровывать?(выдернул питание из одного блока питания)


              Comment


              • Evgeniy
                Evgeniy commented
                Editing a comment
                Перевести число в бинарный вид
                131136=10 0000 0000 0100 0000
                18 AC status.
                7 Other controller status.
            • Kos
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Aug 2015
              • 3404

              #9
              Перевести число в бинарный вид
              131136=10 0000 0000 0100 0000
              18 AC status.
              7 Other controller status.
              Только там нумерация битов с нуля идёт. Так что это не 18 и 7, а 17 и 6:
              17 power supply status.
              6 warning status.

              Comment


              • Evgeniy
                Evgeniy commented
                Editing a comment
                Спасибо, что поправили, обсчитался...
            Working...