Ad Widget

Collapse

Unable to get SNMP traps into zabbix-server-mysql using containers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dataspot
    Junior Member
    • Dec 2023
    • 5

    #1

    Unable to get SNMP traps into zabbix-server-mysql using containers

    First time user and poster here, I have searched the forum but not able to find any solution to my issue so hoping someone can help. I have been at this for a couple of days now but I feel I am nearly there with my setup but really need SNMP traps to work.

    In zabbix/zabbix-snmptraps container I can see snmptraps.log is populated with snmptraps sent by the devices
    However, I am not able to see them in web-gui. I am a little stuck with how to troubleshoot or verify link between zabbix/zabbix-snmptraps container and zabbix/zabbix-server-mysql container

    I have the following containers in QNAP Container Station 3:​
    1. mysql 8.1.0
    2. zabbix/zabbix-server-mysql
    3. zabbix/zabbix-web-nginx-mysql
    4. zabbix/zabbix-snmptraps
    5. zabbix/zabbix-agent2
    ​I have a manually added a host (LAPTOP) in GUI with SNMPv2 as per screenshot below but the SNMP (availability) is greyed out.

    Click image for larger version

Name:	zabbix-hosts.png
Views:	1163
Size:	9.1 KB
ID:	475588

    Sample output from /var/lib/zabbix/snmptraps/snmptraps.log

    Code:
    20231210.053847 ZBXTRAP <device IP removed>
    UDP: [<device IP removed>]:59876->[snmptrap container IP removed]:1162
    DISMAN-EVENT-MIB::sysUpTimeInstance = 0
    SNMPv2-MIB::snmpTrapOID.0 = SNMPv2-MIB::coldStart
    SNMP-COMMUNITY-MIB::snmpTrapAddress.0 = <device IP removed>
    SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 = "<string removed>"
    SNMPv2-MIB::snmpTrapEnterprise.0 = SNMPv2-SMI::enterprises.311.1.1.3.1.1


    I can see the following in the command line after booting up zabbix-snmptraps container. Not sure if this is related to the issue I am having above.

    Code:
    Cannot rename /var/lib/net-snmp/snmptrapd.conf to /var/lib/net-snmp/snmptrapd.0.conf
    Cannot unlink /var/lib/net-snmp/snmptrapd.conf
    read_config_store open failure on /var/lib/net-snmp/snmptrapd.conf
    read_config_store open failure on /var/lib/net-snmp/snmptrapd.conf
    read_config_store open failure on /var/lib/net-snmp/snmptrapd.conf
    NET-SNMP version 5.9.3
    ​Thanks
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Any SNMP trap items added to hosts? https://www.zabbix.com/documentation...ing-snmp-traps
    SNMP trapper process also running? https://www.zabbix.com/documentation...rap-monitoring

    Comment

    • dataspot
      Junior Member
      • Dec 2023
      • 5

      #3
      cyber Thank you for your prompt response. I forgot to add in my original post that I have followed the official guide from https://hub.docker.com/r/zabbix/zabbix-snmptraps/, but I don't quite understand how the link works and where to enter the command in section "Linking Zabbix server or Zabbix proxy with the container".

      From the link you have provided above I can confirm that
      1). SNMP trap item is added to the hosts with SNMPv2 (just to keep things simple and get started for now).
      2). SNMP trapper process is running on the zabbix-snmptraps container, because I am getting the expected out put in the /var/lib/zabbix/snmptraps/snmptraps.log as shown in the verification at the bottom of the page.
      4). SNMP trapper process on zabbix/zabbix-server-mysql container is also enabled
      Code:
      StartSNMPTrapper=1
      but since the zabbix/SNMPtraps is in another container, I am not sure what to put in the
      Code:
      SNMPTrapperFile=[TRAP FILE]
      .​

      As mentioned earlier, am I just missing the link between the two containers to point to the correct trapper file?

      Comment

      • dataspot
        Junior Member
        • Dec 2023
        • 5

        #4

        I've managed to link the two containers now so that I can see the /var/lib/zabbix/snmptraps/snmptraps.log file within zabbix-server-mysql.

        Now I guess I need to install either bash/perl trap receiver.

        Comment

        • dataspot
          Junior Member
          • Dec 2023
          • 5

          #5
          OK Finally got it working. I had to use "ZBX_ENABLE_SNMP_TRAPS=true" when starting zabbix-server-mysql. I found the solution in the link below. I think the official guide https://hub.docker.com/r/zabbix/zabbix-snmptraps/ needs to be a little clearer. Anyone know how to get zabbix to update this?


          running shell into container check variables $ docker exec -it 3f6f7cae3fe1 bash bash-4.3# env ... ZBX_SNMPTRAPPERFILE=/tmp/zabbix_traps.tmp ZBX_STARTSNMPTRAPPER=1 ... cat server config file ### Op...

          Comment

          Working...