Ad Widget

Collapse

Discussion thread for official Zabbix Template DB MongoDB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlexL
    Zabbix Certified Specialist
    Zabbix Certified Specialist
    • Aug 2019
    • 55

    #1

    Discussion thread for official Zabbix Template DB MongoDB


    This thread is designed to provide grounds for discussion of the official Zabbix Template for MongoDB .
    The template and details of the template will soon be available in GIT repository.

    Zabbix is always looking for ways to improve our services and to make our users happier.
    We pride ourselves on doing our best each and every day, but we know that there is always something more to learn.
    We would like to hear back from you to know what have you liked and what would you improve in the template.
  • Alain Ganuchaud
    Member
    Zabbix Certified Trainer

    • Mar 2009
    • 49

    #2
    Hi Alex,

    Do you think you will code the SSL encryption for MongoDB ?
    Even with current MongoDB version (5.0.2), it is not possible to disable encryption for loopback ... as the requests come from Agent2 locally installed on the MongoDB Server.

    Thanks, Alain

    Comment

    • Madgeburgio
      Junior Member
      • Nov 2021
      • 1

      #3
      Hi

      Is there any way to use a database other than 'admin' for authentication?

      Mario

      Comment

      • Georgi
        Junior Member
        • Apr 2022
        • 2

        #4
        Hello,

        What can be done to make it works for MongoDB version 5 ?
        I suppose the first step will be to update the Mongo driver and recompile the agent ?

        Best regards,
        Georgi

        Comment

        • Leachman85
          Junior Member
          • May 2022
          • 2

          #5
          See this https://git.zabbix.com/projects/ZBX/...b_cluster.yaml

          Comment


          • Georgi
            Georgi commented
            Editing a comment
            Hi,
            This is the classical template. I'm asking about the Go driver used in the Agent2
        • PetrM
          Junior Member
          • Jun 2022
          • 2

          #6
          Hi,
          is it possible remove authentication from key names (Zabbix raw items - i.e. mongodb.oplog.stats["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGO DB.PASSWORD}"] )?

          Comment


          • PetrM
            PetrM commented
            Editing a comment
            Change Macro Value to "Secret text"
        • gelowe
          Member
          • Jun 2008
          • 30

          #7
          What rights are needed to use MongoDB plugin?

          There should be a document stating the exact rights the mongodb plugin needs to operate. For an example look at the mysql plugin.

          Comment


          • Georgi
            Georgi commented
            Editing a comment
            Hi,
            the used Mongo commands are in the Go plugin folder (zabbix-6.0.4.tar\zabbix-6.0.4\src\go\plugins\mongodb) in Agent2 ( Zabbix source file)
            Doing a quick search the commands are
            collStats, top, connPoolStats, dbStats ,replSetGetConfig, and serverStatus
            Your monitoring user should be able to execute them .

          • gelowe
            gelowe commented
            Editing a comment
            Doing more research it seems the Role clusterMonitor has all the rights needed

            So ppl just need to add a user with these rights , example creating account zabbix_mon with password of bad-paasword

            use admin
            db.createUser(
            {
            user: "zabbix_mon",
            pwd: "bad-password",
            roles: [ { role: "clusterMonitor", db: "admin" } ]
            }
            )
            Last edited by gelowe; 16-08-2022, 21:09.
        • arthurm_a
          Junior Member
          • Sep 2022
          • 1

          #8
          • I'm getting
            "Unknown metric mongodb.server.status"

            What should I do?

          Comment

          • bugrakeskin
            Junior Member
            • Nov 2022
            • 5

            #9
            Hi,

            If you struggle with scram-sha-256 ;

            Code:
            db.createUser(
            {
            user: "zabbix",
            pwd: "password",
            roles: [ { role: "monitor", db: "admin" } ],
            mechanisms : ["SCRAM-SHA-1","SCRAM-SHA-256"]
            }
            )​

            Comment

            • bugrakeskin
              Junior Member
              • Nov 2022
              • 5

              #10
              ::: Zabbix 6.0 LTS - i have a mongo cluster , 1 primary and 2 slaves.

              Problem : I can get data only i restart the agent2 on mongodb.

              What i did:

              MongoDB side ;

              User created with root priviledges(for testing)
              ​agent2 is installed.
              agent2 is active&passive working without errors.

              Zabbix side;

              MongoDB server is created in the GUI. >> Mongodb Temp. for agent2 is added. >> The Macros is filled with | user name , password and tcp:\\xxx-port

              When i restart the agent2 i can see the data is coming but only one time. No refreshing.

              Am i doing something wrong?

              Thank you.

              Comment

              • bugrakeskin
                Junior Member
                • Nov 2022
                • 5

                #11
                Hi Friends,

                I am a newbie in forums.. can you help me

                ::: Zabbix 6.0 LTS - i have a mongo cluster , 1 primary and 2 slaves.

                Problem : I can get data only i restart the agent2 on mongodb.

                What i did:

                MongoDB side ;

                User created with root priviledges(for testing)
                ​agent2 is installed.
                agent2 is active&passive working without errors.

                Zabbix side;

                MongoDB server is created in the GUI. >> Mongodb Temp. for agent2 is added. >> The Macros is filled with | user name , password and tcp:\\xxx-port

                When i restart the agent2 i can see the data is coming but only one time. No refreshing.

                Am i doing something wrong?

                Thank you.​​​​

                Comment

                • PetrM
                  Junior Member
                  • Jun 2022
                  • 2

                  #12
                  Zabbix 6.0 LTS
                  MongoDB 6 - 3 node cluster

                  Problem : items do not work (Items are disabled by default, I enabled them)
                  Unhealthy replicas
                  Number of unhealthy replicas

                  Reported error example on SECONDARY node:
                  "Preprocessing failed for: {"$clusterTime":{"clusterTime":{"T":1689660301, "I" :20},"signature":{"hash":{"Subtype":0,"Data":"2...
                  1. Failed: cannot extract value from json by path "$.members[?(@.self == "true")].unhealthyNodes.first()": no data matches the specified path​"​​

                  Posible fix for Unhealthy replicas:
                  "$.members[?(@.health == 0)].name" code is working for me.

                  Feel free to check templates
                  Thank you.​

                  Comment

                  • guiguir68
                    Junior Member
                    • Jul 2023
                    • 1

                    #13
                    Originally posted by PetrM
                    Zabbix 6.0 LTS
                    MongoDB 6 - 3 node cluster

                    Problem : items do not work (Items are disabled by default, I enabled them)
                    Unhealthy replicas
                    Number of unhealthy replicas

                    Reported error example on SECONDARY node:
                    "Preprocessing failed for: {"$clusterTime":{"clusterTime":{"T":1689660301, "I" :20},"signature":{"hash":{"Subtype":0,"Data":"2...
                    1. Failed: cannot extract value from json by path "$.members[?(@.self == "true")].unhealthyNodes.first()": no data matches the specified path​"​​

                    Posible fix for Unhealthy replicas:
                    "$.members[?(@.health == 0)].name" code is working for me.

                    Feel free to check templates
                    Thank you.​
                    Yup, same error here!
                    I've just made theses fixes in my "MongoDB node by Zabbix agent 2" template:
                    • Item "MongoDB: Unhealthy replicas"
                      Preprocessing > JSONPath :
                      Code:
                      $.members[?(@.health == 0)].name
                    • Item "MongoDB: Number of unhealthy replicas"
                      Preprocessing > JSONPath :
                      Code:
                      $.members[?(@.health == 0)].length()

                    Comment

                    • cheneric
                      Junior Member
                      • Aug 2023
                      • 11

                      #14
                      MongoDB node by Zabbix agent 2
                      https://git.zabbix.com/projects/ZBX/...tes/db/mongodb

                      MongoDB cluster by Zabbix agent 2
                      https://git.zabbix.com/projects/ZBX/...ongodb_cluster

                      Comment

                      • harry16
                        Junior Member
                        • May 2023
                        • 1

                        #15
                        Hi, I'm trying to monitor my mongo db from scratch.

                        First apply the MongoDB node by Zabbix agent 2 template, then Install and configure zabbix-agent2 compiled with the MongoDB monitoring plugin. creating a file called mongo.conf and there indicating the variable Plugins.MongoDB.System.Pat with the path of the mongo executable, then perform the include in the zabbix.conf indicating the path of the mongo.conf, following everything from this resource: Monitorización e integración de Mongodb con Zabbix

                        Also create the zabbix monitor user in mongo with its readAnyDatabase and clusterMonitor role. to validate that everything is in order, I execute this instruction mongodb.ping[tcp://127.0.0.1,user,password] on my host mongodb receiving the following:
                        zabbix_get [25684]: Get value error: cannot resolve [mongodb.node]

                        Could someone help me with the installation, if I'm correct.





                        Comment

                      Working...