Ad Widget

Collapse

snmptraps in docker

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • damasu
    Junior Member
    • Jun 2020
    • 11

    #16
    Originally posted by rajsolanki
    well in my case its not like what you have


    in my case when i attach to my container and go here

    /var/lib/zabbix $ ls -ltr
    total 0
    drwxr-xr-x 2 root root 6 Jun 4 18:34 snmptraps
    drwxrwxr-x 2 zabbix root 6 Jun 4 19:21 mibs

    snmptrap is owned by root.



    i m using compose yml which is on zabbix git hub https://github.com/zabbix/zabbix-doc...ql_latest.yaml
    if you are not mounting a volume then you need to add a chmod to that folder in the Dockerfile as zabbix-snmptraps runs as 1997 user = zabbix

    Comment

    • rajsolanki
      Member
      • Feb 2020
      • 46

      #17
      yes so i changed perms in Dockerfile https://github.com/zabbix/zabbix-doc...ine/Dockerfile and tried chmod chown .. nothing works. I even removed all containers , all images , reinstalled images after editing and still perms arr wrong. I just dont know how can i fix this ?

      Comment

      • damasu
        Junior Member
        • Jun 2020
        • 11

        #18
        paste your dockerfile

        Comment

        • rajsolanki
          Member
          • Feb 2020
          • 46

          #19
          attached is my docker file.
          Attached Files

          Comment

          • damasu
            Junior Member
            • Jun 2020
            • 11

            #20
            there is no chmod to adjust the folder permissions in that dockerfile! you need to add RUN chown -R zabbix:root /var/lib/zabbix/snmptraps or append to a RUN command.

            Comment

            • damasu
              Junior Member
              • Jun 2020
              • 11

              #21
              https://github.com/zabbix/zabbix-doc...ntu/Dockerfile

              as an example does it correctly. copy the two lines that are setting group and user permissions on that folder.

              Comment

              • damasu
                Junior Member
                • Jun 2020
                • 11

                #22
                nevermind

                i see chgrp -R zabbix /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
                chmod -R 775 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \

                strange that should be setting the folders correctly report it as a bug

                Comment

                • damasu
                  Junior Member
                  • Jun 2020
                  • 11

                  #23
                  amybe you need to recreate your volume as it is holding old structure

                  Comment

                  • rajsolanki
                    Member
                    • Feb 2020
                    • 46

                    #24
                    so for just trial i added

                    chmod -R 777 /var/lib/zabbix/
                    chmod -R 777 /var/lib/zabbix/snmptraps
                    chmod -R 777 /var/lib

                    did

                    docker stop $(docker ps -aq)
                    docker rm $(docker ps -aq)
                    docker rmi $(docker images -q)
                    and then docker-compose -f docker-compose_v3_alpine_mysql_latest.yaml up -d

                    you would think it will work right ? but nope.

                    after i do docker exec to container and do following ownership is still root:root

                    /var/lib/zabbix $ pwd
                    /var/lib/zabbix
                    /var/lib/zabbix $ ls -ltr
                    total 0
                    drwxr-xr-x 2 root root 6 Jun 4 18:34 snmptraps
                    drwxrwxr-x 2 zabbix root 6 Jun 4 19:57 mibs


                    Comment

                    • rajsolanki
                      Member
                      • Feb 2020
                      • 46

                      #25
                      ok i was able to fix this. So now traps show in snmptrap.log but not in zabbix UI. i even added snmp trap item. damasu does it show up for you in zabbix UI ?

                      Comment

                      • ankit.k.shrivastava
                        Junior Member
                        • Dec 2021
                        • 2

                        #26
                        Having similar issues with 5.0. Traps show in snmptrap.log and even docker logs but don't show up in the UI.

                        Comment

                        • ankit.k.shrivastava
                          Junior Member
                          • Dec 2021
                          • 2

                          #27
                          Ok it finally works now

                          Comment

                          Working...