Ad Widget

Collapse

MongoDB TLS - problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kenek
    Junior Member
    • Jul 2023
    • 4

    #1

    MongoDB TLS - problem

    Hi

    Unfortunately, I have problem with connection to mongodb which is configured with TLS. I use zabbix-agent2 6.4.19 and zabbix-agent2-plugin-mongodb 6.4.19. Below configuration:
    Plugins.MongoDB.Sessions.local.TLSConnect=required
    Plugins.MongoDB.Sessions.local.TLSCAFile=/cert/ca.pem
    Plugins.MongoDB.Sessions.local.TLSCertFile=/cert/priv.pem

    further I try do test on localhost where is installed zabbix-agent2 through command:
    sudo zabbix_agent2 -t 'mongodb.ping["tcp://localhost:27017/admin","USER","PASSWORD"]' -v
    sudo zabbix_agent2 -t 'mongodb.ping["tcp://localhost:27017/admin?tls=ture&tlsAllowInvalidCertificates=true"," USER","PASSWORD"]' -v
    sudo zabbix_agent2 -t 'mongodb.ping["tcp://localhost:27017/admin?tls=ture","USER","PASSWORD"]' -v

    all command above return error: timeout occurred

    Could you help me, maybe I do something wrong? What is correctly configuration?
  • Kenek
    Junior Member
    • Jul 2023
    • 4

    #2
    up, can anyone help me?

    Comment

    • Kenek
      Junior Member
      • Jul 2023
      • 4

      #3
      I have solution and I leave information for another people who maybe have or will have problem with TLS.

      First of all, We have to have zabbix-agent2 and zabbix-agent2-plugin-mongodb version greater than 6.0

      Next step is configuration in mongo plugin it is usually in zabbix directory, We have to set up several parameters which I show below:
      Plugins.MongoDB.Sessions.<sessionName>.TLSConnect= required
      Plugins.MongoDB.Sessions.<sessionName>.TLSCAFile=c ert_directory
      Plugins.MongoDB.Sessions.<sessionName>.TLSCertFile =cert_directory
      Plugins.MongoDB.Sessions.<sessionName>.TLSKeyFile= cert_directory

      sessionName We can set in zabbix dashboard in macros and it is {$MONGODB.CONNSTRING}. What else We have to set it separately for each server

      For example, if we set {$MONGODB.CONNSTRING} as connectionTLS, parameters in plugin will be looks as
      Plugins.MongoDB.Sessions.connectionTLS.TLSCAFile
      Plugins.MongoDB.Sessions.connectionTLS.TLSCertFile

      and so on

      For certification directory, We have remember about correctly privileges

      On the end - restart zabbix-agent2 and We can happy with working zabbix with connection thorught tls

      Comment

      Working...