Forum Discussion

Janek_42109's avatar
Janek_42109
Icon for Nimbostratus rankNimbostratus
Nov 05, 2014

SNMP Traps on specific server

Hi all,

I would like to send custom snmp trap on a specific snmp server.

I found the article from Deb Allen : https://devcentral.f5.com/articles/custom-snmp-traps

Is possible to implement something like this in alert.conf

    alert BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_STATUS {
        snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.10"
}

and specify a specific snmp server for this event ?

I hope that i'm clear enough

Thank you

Regards

4 Replies

  • i understand trap is enabled by default (because it is in /etc/alertd/alert.conf). trap destination is configured under snmp menu in gui or sys snmp traps in tmsh.

     configuration
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list sys snmp traps
    sys snmp {
        traps {
            i192_168_207_28_1 {
                community public
                host 192.168.207.28
            }
        }
    }
    
     trace
    
    [root@ve11a:Active:In Sync] config  tcpdump -nni 0.0 -s0 -X port 162
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on 0.0, link-type EN10MB (Ethernet), capture size 65535 bytes
    05:58:55.048979 IP 172.28.24.11.34285 > 192.168.207.28.162:  V2Trap(292)  .1.3.6.1.2.1.1.3.0=17381040 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.3375.2.4.0.11 .1.3.6.1.4.1.3375.2.4.1.1="Pool /Common/foo member /Common/200.200.200.101:80 monitor status up. [ /Common/http: up ]  [ was unchecked for 0hr:0min:11sec ]" .1.3.6.1.4.1.3375.2.4.1.2="/Common/200.200.200.101" .1.3.6.1.4.1.3375.2.4.1.3="80" .1.3.6.1.6.3.1.1.4.3.0=.1.3.6.1.4.1.3375.2.4 out slot1/tmm1 lis=
            0x0000:  0ffd 0800 4500 0153 0000 4000 4011 e5ad  ....E..S..@.@...
            0x0010:  ac1c 180b c0a8 cf1c 85ed 00a2 013f 553d  .............?U=
            0x0020:  3082 0133 0201 0104 0670 7562 6c69 63a7  0..3.....public.
            0x0030:  8201 2402 0406 5258 1702 0100 0201 0030  ..$...RX.......0
            0x0040:  8201 1430 1006 082b 0601 0201 0103 0043  ...0...+.......C
            0x0050:  0401 0936 b030 1906 0a2b 0601 0603 0101  ...6.0...+......
            0x0060:  0401 0006 0b2b 0601 0401 9a2f 0204 000b  .....+...../....
            0x0070:  3081 9006 0b2b 0601 0401 9a2f 0204 0101  0....+...../....
            0x0080:  0481 8050 6f6f 6c20 2f43 6f6d 6d6f 6e2f  ...Pool./Common/
            0x0090:  666f 6f20 6d65 6d62 6572 202f 436f 6d6d  foo.member./Comm
            0x00a0:  6f6e 2f32 3030 2e32 3030 2e32 3030 2e31  on/200.200.200.1
            0x00b0:  3031 3a38 3020 6d6f 6e69 746f 7220 7374  01:80.monitor.st
            0x00c0:  6174 7573 2075 702e 205b 202f 436f 6d6d  atus.up..[./Comm
            0x00d0:  6f6e 2f68 7474 703a 2075 7020 5d20 205b  on/http:.up.]..[
            0x00e0:  2077 6173 2075 6e63 6865 636b 6564 2066  .was.unchecked.f
            0x00f0:  6f72 2030 6872 3a30 6d69 6e3a 3131 7365  or.0hr:0min:11se
            0x0100:  6320 5d30 2606 0b2b 0601 0401 9a2f 0204  c.]0&..+...../..
            0x0110:  0102 0417 2f43 6f6d 6d6f 6e2f 3230 302e  ..../Common/200.
            0x0120:  3230 302e 3230 302e 3130 3130 1106 0b2b  200.200.1010...+
            0x0130:  0601 0401 9a2f 0204 0103 0402 3830 3017  ...../......800.
            0x0140:  060a 2b06 0106 0301 0104 0300 0609 2b06  ..+...........+.
            0x0150:  0104 019a 2f02 0401 0501 0000 0100       ..../.........
    05:58:55.050190 IP 172.28.24.11.34285 > 192.168.207.28.162:  V2Trap(154)  .1.3.6.1.2.1.1.3.0=17381040 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.3375.2.4.0.135 .1.3.6.1.4.1.3375.2.4.1.1="SNMP_TRAP: Virtual /Common/bar has become available" .1.3.6.1.6.3.1.1.4.3.0=.1.3.6.1.4.1.3375.2.4 out slot1/tmm1 lis=
            0x0000:  0ffd 0800 4500 00c7 0000 4000 4011 e639  ....E.....@.@..9
            0x0010:  ac1c 180b c0a8 cf1c 85ed 00a2 00b3 54b1  ..............T.
            0x0020:  3081 a802 0101 0406 7075 626c 6963 a781  0.......public..
            0x0030:  9a02 0406 5258 1802 0100 0201 0030 818b  ....RX.......0..
            0x0040:  3010 0608 2b06 0102 0101 0300 4304 0109  0...+.......C...
            0x0050:  36b0 301a 060a 2b06 0106 0301 0104 0100  6.0...+.........
            0x0060:  060c 2b06 0104 019a 2f02 0400 8107 3042  ..+...../.....0B
            0x0070:  060b 2b06 0104 019a 2f02 0401 0104 3353  ..+...../.....3S
            0x0080:  4e4d 505f 5452 4150 3a20 5669 7274 7561  NMP_TRAP:.Virtua
            0x0090:  6c20 2f43 6f6d 6d6f 6e2f 6261 7220 6861  l./Common/bar.ha
            0x00a0:  7320 6265 636f 6d65 2061 7661 696c 6162  s.become.availab
            0x00b0:  6c65 3017 060a 2b06 0106 0301 0104 0300  le0...+.........
            0x00c0:  0609 2b06 0104 019a 2f02 0401 0501 0000  ..+...../.......
            0x00d0:  0100                                     ..
    
  • Hello Nitass,

     

    Thank you for your answer, actually in my case i do not want to use the snmp server by configured by default but send specific trap to a specific server

     

    • nitass's avatar
      nitass
      Icon for Employee rankEmployee
      what about executing snmptrap command using alertd or icall? sol14397: Executing a command or custom script based on a syslog message https://support.f5.com/kb/en-us/solutions/public/14000/300/sol14397.html