Galera, o post abaixo foi originalmente escrito no blog http://abouthpnetworking.com/2014/12/16/comware5-send-test-snmp-traps-and-syslog-messages/ e eu fiz uma versão livre do artigo em português sobre a configuração para gerar logs de testes para servidores NMS.
Em cenários que Switches que são gerenciados por ferramentas de monitoração (como o HP IMC ou qualquer NMS), as vezes é necessário testar as mensagens de traps SNMP e SYSLOG para validar as configurações do equipamento e a rede entre os dispositivos.
Com os comandos abaixo é possível gerar traps e logs de teste em alguns Switches HP, que rodam o Comware5.
Teste de traps SNMP
Digite o comando ‘hidden’ no modo system-view e execute o comando _test
Obs: tenha bastante cautela ao executar os comandos liberados com o ‘_hidecmd’. Após digitar o comando é gerado um warning avisando que o uso incorreto poderá afetar a operação dos serviços no equipamento. Use em equipamentos fora de produção.
<HP>system-view System View: return to User View with Ctrl+Z. [HP] _hidecmd Now you enter a hidden command view for developer's testing, some commands may affect operation by wrong use, please carefully use it with our engineer's direction. [HP-hidecmd] _test trap Test trap have Sended! #Nov 9 22:34:29:593 2014 HP DEVM/1/BOARD INSERTED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.9: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:613 2014 HP DEVM/1/BOARD REMOVED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.8: chassisIndex is 0, slotIndex 0. #Nov 9 22:34:29:633 2014 HP DEVM/1/BOARD STATE CHANGES TO NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.11: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:653 2014 HP DEVM/1/BOARD STATE CHANGES TO FAILURE: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.10: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:674 2014 HP DEVM/1/BOARD TEMPERATURE NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.15: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:694 2014 HP DEVM/1/BOARD TEMPERATURE LOWER: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.14: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:714 2014 HP DEVM/1/BOARD TEMPERATURE UPPER: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.16: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:735 2014 HP DEVM/1/BOARD REQUEST LOADING: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.18: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:755 2014 HP DEVM/1/LOAD FAILURE: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.19: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:775 2014 HP DEVM/1/LOAD FINISHED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.20: chassisIndex is 0, slotIndex 0.4 #Nov 9 22:34:29:796 2014 HP DEVM/1/SUB CARD INSERTED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.13: chassisIndex is 0, slotIndex 0.0, subslotIndex 0.0.1 #Nov 9 22:34:29:816 2014 HP DEVM/1/SUB CARD REMOVED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.12: chassisIndex is 0, slotIndex 0.0, subslotIndex 0.0.1 #Nov 9 22:34:29:836 2014 HP DEVM/1/FAN STATE CHANGES TO FAILURE: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.6: fan ID is 1 #Nov 9 22:34:29:856 2014 HP DEVM/1/FAN STATE CHANGES TO NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.7: fan ID is 1 #Nov 9 22:34:29:877 2014 HP DEVM/1/POWER STATE CHANGES TO FAILURE: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.1: power ID is 1 #Nov 9 22:34:29:897 2014 HP DEVM/1/POWER STATE CHANGES TO NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.2: power ID is 1 #Nov 9 22:34:29:917 2014 HP DEVM/1/MASTER POWER CHANGES TO NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.3: power ID is 1 #Nov 9 22:34:29:937 2014 HP DEVM/1/SLAVE POWER CHANGES TO NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.4: power ID is 1 #Nov 9 22:34:29:958 2014 HP DEVM/1/POWER INSERT: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.23: power ID is 1 #Nov 9 22:34:29:978 2014 HP DEVM/1/POWER REMOVED: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.5: power ID is 1 #Nov 9 22:34:29:999 2014 HP DEVM/1/BOARD TEMPERATURE NORMAL: Trap 1.3.6.1.4.1.11.2.14.11.15.8.35.12.1.17: chassisIndex is 4294967295, slotIndex 4294967295.429496729 #Nov 9 22:34:30:019 2014 HP DEVM/4/SYSTEM COLD START: Trap 1.3.6.1.4.1.11.2.14.11.15.6.8.4: system cold start. #Nov 9 22:34:30:039 2014 HP DEVM/4/SYSTEM WARM START: Trap 1.3.6.1.4.1.11.2.14.11.15.6.8.5: system warm start. #Nov 9 22:34:30:059 2014 HP DEVM/1/REBOOT: Reboot device by command.
Testando as mensagens de syslog
[HP-hidecmd]_test log [HP-hidecmd] %Nov 9 22:34:37:632 2014 HP DEVM/5/SYSTEM_REBOOT: System is rebooting now. %Nov 9 22:34:37:642 2014 HP DEVM/5/BOARD_REBOOT: Board is rebooting on Chassis 0 Slot 1. %Nov 9 22:34:37:652 2014 HP DEVM/5/SUBCARD_REBOOT: SubCard is rebooting on Chassis 0 Slot 1 SubSlot 1. %Nov 9 22:34:37:662 2014 HP DEVM/5/BOARD_STATE_NORMAL: Board state changes to NORMAL on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:683 2014 HP DEVM/2/BOARD_STATE_FAULT: Board state changes to FAULT on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:703 2014 HP DEVM/3/BOARD_REMOVED: Board is removed from Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:723 2014 HP DEVM/4/SUBCARD_INSERTED: SubCard is inserted in Chassis 0 Slot 1 SubSlot 1, type is OnlyTest. %Nov 9 22:34:37:743 2014 HP DEVM/3/SUBCARD_REMOVED: SubCard is removed from Chassis 0 Slot 1 SubSlot 1, type is OnlyTest. %Nov 9 22:34:37:764 2014 HP DEVM/2/SUBCARD_FAULT: SubCard state changes to FAULT on Chassis 0 slot 1 SubSlot 1, type is OnlyTest. %Nov 9 22:34:37:784 2014 HP DEVM/5/FAN_RECOVERED: Fan 1 recovered. %Nov 9 22:34:37:794 2014 HP DEVM/2/FAN_FAILED: Fan 1 failed. %Nov 9 22:34:37:804 2014 HP DEVM/3/FAN_ABSENT: Fan 1 is absent. %Nov 9 22:34:37:814 2014 HP DEVM/5/POWER_RECOVERED: Power OnlyTest recovered. %Nov 9 22:34:37:825 2014 HP DEVM/5/MPOWER_RECOVERED: Master power recovered. %Nov 9 22:34:37:835 2014 HP DEVM/5/SPOWER_RECOVERED: Slave power recovered. %Nov 9 22:34:37:845 2014 HP DEVM/2/POWER_FAILED: Power OnlyTest failed. %Nov 9 22:34:37:855 2014 HP DEVM/3/POWER_ABSENT: Power OnlyTest is absent. %Nov 9 22:34:37:866 2014 HP DEVM/5/BOARD_TEMP_NORMAL: Board temperature changes to normal on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:886 2014 HP DEVM/4/BOARD_TEMP_TOOLOW: Board temperature is too low on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:906 2014 HP DEVM/4/BOARD_TEMP_TOOHIGH: Board temperature is too high on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:37:926 2014 HP DEVM/5/RPS_NORMAL: RPS 1 is normal. %Nov 9 22:34:37:937 2014 HP DEVM/3/RPS_ABSENT: RPS 1 is absent. %Nov 9 22:34:37:947 2014 HP DEVM/4/CFCARD_INSERTED: Compact Flash Card is inserted in Chassis 0 Slot 1 Compact Flash Slot 1. %Nov 9 22:34:37:967 2014 HP DEVM/3/CFCARD_REMOVED: Compact Flash Card is removed from Chassis 0 Slot 1 Compact Flash Slot 1. %Nov 9 22:34:37:987 2014 HP DEVM/5/BOARD_CURRENT_NORMAL: Board current changes to normal on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:008 2014 HP DEVM/4/BOARD_CURRENT_TOOSMALL: Board current is too small on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:028 2014 HP DEVM/4/BOARD_CURRENT_TOOBIG: Board current is too big on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:048 2014 HP DEVM/5/BOARD_VOLTAGE_NORMAL: Board voltage changes to normal on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:068 2014 HP DEVM/4/BOARD_VOLTAGE_TOOLOW: Board voltage is too low on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:089 2014 HP DEVM/4/BOARD_VOLTAGE_TOOHIGH: Board voltage is too high on Chassis 0 Slot 1, type is OnlyTest. %Nov 9 22:34:38:109 2014 HP DEVM/3/LOAD_NOMEMORY: Chassis 0 Slot 1 has not enough memory to load file. %Nov 9 22:34:38:119 2014 HP DEVM/3/LOAD_REQUEST_ILLEGAL: The loading request of Chassis 0 Slot 1 is invalid, please check the bootrom version. %Nov 9 22:34:38:139 2014 HP DEVM/4/BOARD_LOADING: Board is loading file on Chassis 0 Slot 1. %Nov 9 22:34:38:150 2014 HP DEVM/3/LOAD_FAILED: Board failed to load file on Chassis 0 Slot 1. %Nov 9 22:34:38:160 2014 HP DEVM/5/LOAD_FINISHED: Board has finished loading file on Chassis 0 Slot 1. %Nov 9 22:34:38:170 2014 HP DEVM/3/LOAD_READ_FILE_FAILED: Driver failed to read file. %Nov 9 22:34:38:180 2014 HP DEVM/4/BOARD_START_FROM_SELF_SYSTEM: Chassis 0 Slot 1 starts from self file system. %Nov 9 22:34:38:200 2014 HP DEVM/3/LOAD_OPEN_FILE_FAILED: Cannot open the file, Chassis 0 Slot 1 will request load again! %Nov 9 22:34:38:221 2014 HP DEVM/4/LOAD_TOO_MANY_RESEND: Too many resent frames, Chassis 0 Slot 1 will request load again. %Nov 9 22:34:38:241 2014 HP DEVM/4/LOAD_TOO_MANY_INVALID: Too many invalid frames, Chassis 0 Slot 1 will request load again. %Nov 9 22:34:38:261 2014 HP DEVM/4/LOAD_CHECKSUM_ERROR: Checksum error, Chassis 0 Slot 1 will request load again. %Nov 9 22:34:38:281 2014 HP DEVM/5/CHASSIS_REBOOT: Chassis 0 is reboot now. [HP-hidecmd] [HP-hidecmd] [HP-hidecmd]quit [HP]
Até logo