Ad Widget

Collapse

Docker-Zabbix - How I shold add the variable ValueCacheSize

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hernan
    Member
    • Sep 2016
    • 67

    #1

    Docker-Zabbix - How I shold add the variable ValueCacheSize

    Hello Guys,

    I received the following error message on Zabbix:

    ************
    zabbix_1 | 405:20171201:125350.569 value cache is fully used: please increase ValueCacheSize configuration parameter
    ************

    The problem that I have is that I added the variable on the docker.yml files but I think is not working. This is the file:

    *****************************
    services:
    zabbix:
    image: monitoringartist/dockbix-xxl:3.4.2
    ports:
    - "10051:10051"
    volumes:
    - /etc/localtime:/etc/localtime:ro
    - /data/docker_volumes/zabbix/alertscripts:/usr/local/share/zabbix/alertscripts
    - /data/docker_volumes/zabbix/externalscripts:/usr/local/share/zabbix/externalscripts
    environment:
    - ZS_DBHost=x.x.x.x
    - ZS_DBName=zabbix
    - ZS_DBUser=b0f491f9fc3e8c
    - ZS_DBPassword=d450240f
    - ZS_ValueCacheSize=1000M <<<<< this is the value
    - PHP_date_timezone=America/Argentina/Buenos_Aires
    - ZS_CacheSize=2500M
    - ZS_HISTORYCACHESIZE=160M
    labels:
    - traefik.frontend.rule=Host:xxxxx.xxxx.com
    restart: always
    **********************
    Can you help me with this problem???

    How should I add a variable on a container (Docker version is monitoringartist/dockbix-xxl)

    Thanks in advance.
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    ZS_ValueCacheSize=1000M is correct syntax.

    Pls verify that config file contains config ValueCacheSize=1000M:

    docker exec -ti <dockbix container id> cat /usr/local/etc/zabbix_server.conf

    I guess your problem will be container shared memory used by value cache. You need to define explicitly, that you want more for your container. Otherwise, default 64MB is allocated.

    Ref: https://docs.docker.com/engine/reference/run/ and --shm-size parameter
    Last edited by jan.garaj; 01-02-2018, 14:46.
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • hernan
      Member
      • Sep 2016
      • 67

      #3
      Originally posted by jan.garaj
      ZS_ValueCacheSize=1000M is correct syntax.

      Pls verify that config file contains config ValueCacheSize=1000M:

      docker exec -ti <dockbix container id> cat /usr/local/etc/zabbix_server.conf

      I guess your problem will be container shared memory used by value cache. You need to define explicitly, that you want more for your container. Otherwise, default 64MB is allocated.

      Ref: https://docs.docker.com/engine/reference/run/ and --shm-size parameter
      Hello Jan,

      I don't have the ValueCacheSize=1000M eon the conf file.
      **********************
      ~$ docker exec -ti adminuser_zabbix_1 cat /usr/local/etc/zabbix_server.conf
      User=zabbix
      SSLKeyLocation=/usr/local/share/zabbix/ssl/keys
      SSLCertLocation=/usr/local/share/zabbix/ssl/certs
      PidFile=/tmp/zabbix_server.pid
      LogType=console
      LoadModulePath=/usr/lib/zabbix/modules
      JavaGatewayPort=10052
      JavaGateway=127.0.0.1
      ExternalScripts=/usr/local/share/zabbix/externalscripts
      DBUser=b0f491f9fc3e8c
      DBPort=3306
      DBPassword=zabbix
      DBName=zabbix
      DBHost=x.x.x.x
      AlertScriptsPath=/usr/local/share/zabbix/alertscripts
      **************
      What do you think?

      Thanks in advance.

      Regards.

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        Destroy and recreate adminuser_zabbix_1 container. Env variable must be available for that container.

        Code:
        docker inspect adminuser_zabbix_1 | grep "ZS_"
        It works on my machine:

        Code:
        [root@dockerhost ~]# docker run \
        >     -d \
        >     --name dockbix \
        >     -p 80:80 \
        >     -p 10051:10051 \
        >     -v /etc/localtime:/etc/localtime:ro \
        >     --link dockbix-db:dockbix.db \
        >     --env="ZS_DBHost=dockbix.db" \
        >     --env="ZS_DBUser=zabbix" \
        >     --env="ZS_DBPassword=my_password" \
        >     --env="XXL_zapix=true" \
        >     --env="XXL_grapher=true" \
        >     --env="ZS_ValueCacheSize=1000M" \
        >     monitoringartist/dockbix-xxl:latest
        43f5cd099056b2bbdff9154372e3afd69e42cbad5801e318a94c7b65999c3e05
        [root@dockerhost ~]# docker exec -ti dockbix cat /usr/local/etc/zabbix_server.conf
        ValueCacheSize=1000M
        User=zabbix
        SSLKeyLocation=/usr/local/share/zabbix/ssl/keys
        SSLCertLocation=/usr/local/share/zabbix/ssl/certs
        PidFile=/tmp/zabbix_server.pid
        LogType=console
        LoadModulePath=/usr/lib/zabbix/modules
        JavaGatewayPort=10052
        JavaGateway=127.0.0.1
        ExternalScripts=/usr/local/share/zabbix/externalscripts
        DBUser=zabbix
        DBPort=3306
        DBPassword=my_password
        DBName=zabbix
        DBHost=dockbix.db
        AlertScriptsPath=/usr/local/share/zabbix/alertscripts
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        • hernan
          Member
          • Sep 2016
          • 67

          #5
          Originally posted by jan.garaj
          Destroy and recreate adminuser_zabbix_1 container. Env variable must be available for that container.

          Code:
          docker inspect adminuser_zabbix_1 | grep "ZS_"
          It works on my machine:

          Code:
          [root@dockerhost ~]# docker run \
          >     -d \
          >     --name dockbix \
          >     -p 80:80 \
          >     -p 10051:10051 \
          >     -v /etc/localtime:/etc/localtime:ro \
          >     --link dockbix-db:dockbix.db \
          >     --env="ZS_DBHost=dockbix.db" \
          >     --env="ZS_DBUser=zabbix" \
          >     --env="ZS_DBPassword=my_password" \
          >     --env="XXL_zapix=true" \
          >     --env="XXL_grapher=true" \
          >     --env="ZS_ValueCacheSize=1000M" \
          >     monitoringartist/dockbix-xxl:latest
          43f5cd099056b2bbdff9154372e3afd69e42cbad5801e318a94c7b65999c3e05
          [root@dockerhost ~]# docker exec -ti dockbix cat /usr/local/etc/zabbix_server.conf
          ValueCacheSize=1000M
          User=zabbix
          SSLKeyLocation=/usr/local/share/zabbix/ssl/keys
          SSLCertLocation=/usr/local/share/zabbix/ssl/certs
          PidFile=/tmp/zabbix_server.pid
          LogType=console
          LoadModulePath=/usr/lib/zabbix/modules
          JavaGatewayPort=10052
          JavaGateway=127.0.0.1
          ExternalScripts=/usr/local/share/zabbix/externalscripts
          DBUser=zabbix
          DBPort=3306
          DBPassword=my_password
          DBName=zabbix
          DBHost=dockbix.db
          AlertScriptsPath=/usr/local/share/zabbix/alertscripts
          I don't have it .

          ************
          ~$ docker inspect adminuser_zabbix_1 | grep "ZS_"
          "ZS_DBPassword=zabbix",
          "ZS_DBName=zabbix",
          "ZS_DBUser=b0f491f9fc3e8c",
          "ZS_DBHost=10.2.1.4",
          "ZS_enabled=true",
          "ZS_LogType=console",
          "ZS_PidFile=/tmp/zabbix_server.pid",
          "ZS_User=zabbix",
          "ZS_DBPort=3306",
          "ZS_AlertScriptsPath=/usr/local/share/zabbix/alertscripts",
          "ZS_ExternalScripts=/usr/local/share/zabbix/externalscripts",
          "ZS_SSLCertLocation=/usr/local/share/zabbix/ssl/certs",
          "ZS_SSLKeyLocation=/usr/local/share/zabbix/ssl/keys",
          "ZS_LoadModulePath=/usr/lib/zabbix/modules",
          "ZS_JavaGateway=127.0.0.1",
          "ZS_JavaGatewayPort=10052",
          $
          *********************


          Sorry but bother you but what is the correct procedure to destroy the adminuser_zabbix_1 container?

          Another Question : How I should regenerate the new container? (sorry I'm new with docker)

          Thanks in advance.

          Regards.

          Comment

          • jan.garaj
            Senior Member
            Zabbix Certified Specialist
            • Jan 2010
            • 506

            #6
            That depends on your orchestration. It seems like you are using docker-compose - https://docs.docker.com/compose/reference/

            So it can be: docker-compose kill; docker-compose rm;
            Be careful and be familiar with your tool - you may lose your DB data!
            Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
            My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

            Comment

            • hernan
              Member
              • Sep 2016
              • 67

              #7
              Originally posted by jan.garaj
              That depends on your orchestration. It seems like you are using docker-compose - https://docs.docker.com/compose/reference/

              So it can be: docker-compose kill; docker-compose rm;
              Be careful and be familiar with your tool - you may lose your DB data!
              I checked the docker-compose doc and I should run:

              1) Edit the docker-compose.yml with the new variable
              2) Then only "docker-compose up" :
              *********************************
              The docker-compose up command aggregates the output of each container (essentially running docker-compose logs -f). When the command exits, all containers are stopped. Running docker-compose up -d starts the containers in the background and leaves them running.

              If there are existing containers for a service, and the service’s configuration or image was changed after the container’s creation, docker-compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes). To prevent Compose from picking up changes, use the --no-recreate flag.

              If you want to force Compose to stop and recreate all containers, use the --force-recreate flag.

              If the process encounters an error, the exit code for this command is 1.
              If the process is interrupted using SIGINT (ctrl + C) or SIGTERM, the containers are stopped, and the exit code is 0.
              If SIGINT or SIGTERM is sent again during this shutdown phase, the running containers are killed, and the exit code is 2.
              **************************************
              What do you think?

              Thanks for your help.

              Regards.

              Comment

              • jan.garaj
                Senior Member
                Zabbix Certified Specialist
                • Jan 2010
                • 506

                #8
                I'm sorry. I can't give you any advice regarding docker-compose. That's really not my favourite tool.
                Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
                My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

                Comment

                • hernan
                  Member
                  • Sep 2016
                  • 67

                  #9
                  Originally posted by jan.garaj
                  I'm sorry. I can't give you any advice regarding docker-compose. That's really not my favourite tool.
                  I have a good new. I ran "docker-compose up" and I recreate the container including the ValueCacheSize on the zabbix config file:

                  ***************************
                  ~$ docker inspect adminuser_zabbix_1 | grep "ZS_" "ZS_DBPassword=zabbix",
                  "ZS_ValueCacheSize=1000M",
                  "ZS_DBName=zabbix",
                  "ZS_DBHost=x.x.x.x",
                  "ZS_DBUser=zabbix",
                  "ZS_enabled=true",
                  "ZS_LogType=console",
                  "ZS_PidFile=/tmp/zabbix_server.pid",
                  "ZS_User=zabbix",
                  "ZS_DBPort=3306",
                  "ZS_AlertScriptsPath=/usr/local/share/zabbix/alertscripts",
                  "ZS_ExternalScripts=/usr/local/share/zabbix/externalscripts",
                  "ZS_SSLCertLocation=/usr/local/share/zabbix/ssl/certs",
                  "ZS_SSLKeyLocation=/usr/local/share/zabbix/ssl/keys",
                  "ZS_LoadModulePath=/usr/lib/zabbix/modules",
                  "ZS_JavaGateway=127.0.0.1",
                  "ZS_JavaGatewayPort=10052",
                  ~$
                  ****************************************

                  Now my Zabbix Server is working without problem !!!

                  Thank you Jan for your help !

                  Regards.

                  Comment

                  Working...