{"id":22039375,"url":"https://github.com/mpolinowski/nomad-zabbix-server","last_synced_at":"2026-03-01T22:41:16.286Z","repository":{"id":111484006,"uuid":"569555701","full_name":"mpolinowski/nomad-zabbix-server","owner":"mpolinowski","description":"Provisioning a Zabbix Server v7.0 with Docker and Hashicorp Nomad","archived":false,"fork":false,"pushed_at":"2024-07-10T07:57:54.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T23:05:08.843Z","etag":null,"topics":["docker","hashicorp-nomad","nginx","postgres","zabbix-server"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T04:57:28.000Z","updated_at":"2024-07-10T07:58:29.000Z","dependencies_parsed_at":"2025-02-27T17:58:17.348Z","dependency_job_id":"6d78b284-8c8d-4044-bfc1-bfb75b706521","html_url":"https://github.com/mpolinowski/nomad-zabbix-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/nomad-zabbix-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-zabbix-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-zabbix-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-zabbix-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-zabbix-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/nomad-zabbix-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fnomad-zabbix-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29987636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T21:06:37.093Z","status":"ssl_error","status_checked_at":"2026-03-01T21:05:45.052Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","hashicorp-nomad","nginx","postgres","zabbix-server"],"created_at":"2024-11-30T11:10:32.075Z","updated_at":"2026-03-01T22:41:16.266Z","avatar_url":"https://github.com/mpolinowski.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nomadic Zabbix Server v6.2\n\nI have been using [Docker-Compose to deploy the Zabbix Server environment](https://github.com/mpolinowski/zabbix-server-compose). But I would like to move this into my Nomad/Consul cluster. Following is the \"translation\" of the [docker-compose file](https://github.com/mpolinowski/zabbix-server-compose/blob/master/docker-compose.yml) into a Nomad job.\n\n\n\u003e There is still __one shortcut__ in here - I have not yet setup Consul to help me connecting all my service (_TODO_). So I am running this with `network_mode=host` and connect all components over _127.0.0.1_.\n\n\n\u003c!-- TOC --\u003e\n\n- [Nomadic Zabbix Server v6.2](#nomadic-zabbix-server-v62)\n  - [Images used](#images-used)\n  - [Run in Nomad](#run-in-nomad)\n    - [Ports used](#ports-used)\n    - [Environment Variables](#environment-variables)\n  - [Nomad Job](#nomad-job)\n\n\u003c!-- /TOC --\u003e\n\n\n\n## Images used\n\n* `zabbix/zabbix-server-pgsql:6.2-alpine-latest`\n* `zabbix/zabbix-web-nginx-pgsql:6.2-alpine-latest`\n* `postgres:15-alpine3.16`\n\n\n## Run in Nomad\n\nRun `nomad plan zabbix-server.tf` to provision the service to your data center `dc1` -\n\n\n### Ports used\n\n* `web_front = 8080` (Zabbix frontend - sign-in with default `Admin`/`zabbix`)\n* `server_active = 10051` (Port used for active checks)\n* `postgres_db = 5432` (Database port)\n\n\n### Environment Variables\n\n* `POSTGRES_USER = zabbix`\n* `POSTGRES_PASSWORD = mydbpassword`\n* `POSTGRES_DB = zabbix`\n* `DB_SERVER_HOST = 127.0.0.1`\n* `ZBX_JAVAGATEWAY_ENABLE = false`\n* `ZBX_ENABLE_SNMP_TRAPS = false`\n* `ZBX_CACHESIZE = 128M`\n* `ZBX_HISTORYCACHESIZE = 128M`\n* `ZBX_HISTORYINDEXCACHESIZE = 128M`\n* `ZBX_TRENDCACHESIZE = 128M`\n* `ZBX_VALUECACHESIZE = 128M`\n* `ZBX_SERVER_HOST = 127.0.0.1`\n* `ZBX_SERVER_PORT = 10051`\n* `PHP_TZ = Europe/Berlin`\n\n\n![Nomadic Zabbix Server v6.2](./Zabbix_Server_Nomad_01.png)\n\n\n![Nomadic Zabbix Server v6.2](./Zabbix_Server_Nomad_02.png)\n\n\n## Nomad Job\n\n```bash\njob \"zabbix_server\" {\n    type        = \"service\"\n    datacenters = [\"dc1\"]\n\n    update {\n        max_parallel     = 1\n        health_check     = \"checks\"\n        min_healthy_time = \"180s\"\n        healthy_deadline = \"5m\"\n        progress_deadline = \"10m\"\n        auto_revert = true\n        auto_promote = true\n        canary = 1\n    }\n\n    group \"zabbix-server\" {\n        count = 1\n\n        network {\n            mode = \"host\"\n            port \"server_active\" {\n                static = 10051\n            }\n            port \"postgres_db\" {\n                static = 5432\n            }\n            port \"web_front\" {\n                static = 8080\n            }\n        }\n\n        volume \"localtime\" {\n            type      = \"host\"\n            read_only = true\n            source    = \"localtime\"\n        }\n\n        volume \"timezone\" {\n            type      = \"host\"\n            read_only = true\n            source    = \"timezone\"\n        }\n\n        volume \"zabbix_db\" {\n            type      = \"host\"\n            read_only = false\n            source    = \"zabbix_db\"\n        }\n\n\n        task \"zabbix-server\" {\n            driver = \"docker\"\n            kill_timeout = \"600s\"\n            kill_signal = \"SIGTERM\"\n\n            config {\n                network_mode = \"host\"\n                image = \"zabbix/zabbix-server-pgsql:6.2-alpine-latest\"\n                force_pull = false\n                ports = [\"server_active\"]\n                volumes = [\n                    \"local/zabbix/zbx_env/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts\",\n                    \"local/zabbix/zbx_env/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts\",\n                    \"local/zabbix/zbx_env/var/lib/zabbix/export:/var/lib/zabbix/export\",\n                    \"local/zabbix/zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules\",\n                    \"local/zabbix/zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc\",\n                    \"local/zabbix/zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys\",\n                    \"local/zabbix/zbx_env/var/lib/zabbix/mibs:/var/lib/zabbix/mibs\",\n                ]\n\n            ulimit {\n                nofile = \"40000\"\n                nproc = \"65535\"\n                }\n            }\n            \n            env {\n                POSTGRES_USER = \"zabbix\"\n                POSTGRES_PASSWORD = \"mydbpassword\"\n                POSTGRES_DB = \"zabbix\"\n                DB_SERVER_HOST = \"127.0.0.1\"\n                ZBX_JAVAGATEWAY_ENABLE = \"false\"\n                ZBX_ENABLE_SNMP_TRAPS = \"false\"\n                ZBX_CACHESIZE = \"128M\"\n                ZBX_HISTORYCACHESIZE = \"128M\"\n                ZBX_HISTORYINDEXCACHESIZE = \"128M\"\n                ZBX_TRENDCACHESIZE = \"128M\"\n                ZBX_VALUECACHESIZE = \"128M\"\n            }\n\n            volume_mount {\n                volume      = \"localtime\"\n                destination = \"/etc/localtime\" #\u003c-- in the container\n                read_only   = false\n            }\n\n            volume_mount {\n                volume      = \"timezone\"\n                destination = \"/etc/timezone\" #\u003c-- in the container\n                read_only   = false\n            }\n\n            resources {\n                cpu    = 1024\n                memory = 1000\n            }\n        }\n\n        task \"zabbix-db\" {\n            driver = \"docker\"\n\n            config {\n                network_mode = \"host\"\n                image = \"postgres:15-alpine3.16\"\n                force_pull = false\n                ports = [\"postgres_db\"]\n\n                ulimit {\n                    nofile = \"40000\"\n                    nproc = \"65535\"\n                }\n            }\n\n            service {\n                name = \"zabbix-server-db\"\n                check {\n                    name     = \"postgres-tcp\"\n                    port     = \"postgres_db\"\n                    type     = \"tcp\"\n                    interval = \"30s\"\n                    timeout  = \"4s\"\n                }\n            }\n\n            env {\n                POSTGRES_USER = \"zabbix\"\n                POSTGRES_PASSWORD = \"mydbpassword\"\n                POSTGRES_DB = \"zabbix\"\n            }\n\n            volume_mount {\n                volume      = \"zabbix_db\"\n                destination = \"/var/lib/postgresql/data\" #\u003c-- in the container\n                read_only   = false\n            }\n\n            resources {\n                cpu    = 1024\n                memory = 1000\n            }\n        }\n\n        task \"zabbix-web\" {\n            driver = \"docker\"\n\n            config {\n                network_mode = \"host\"\n                image = \"zabbix/zabbix-web-nginx-pgsql:6.2-alpine-latest\"\n                force_pull = false\n                ports = [\"web_front\"]\n\n                ulimit {\n                    nofile = \"40000\"\n                    nproc = \"65535\"\n                }\n            }\n\n            service {\n                name = \"zabbix-server-http\"\n                port = \"web_front\"\n\n                check {\n                    name     = \"HTTP Health\"\n                    port = \"web_front\"\n                    path     = \"/\"\n                    type     = \"http\"\n                    protocol = \"http\"\n                    interval = \"10s\"\n                    timeout  = \"2s\"\n                }\n            }\n\n            env {\n                POSTGRES_USER = \"zabbix\"\n                POSTGRES_PASSWORD = \"mydbpassword\"\n                POSTGRES_DB = \"zabbix\"\n                PHP_TZ = \"Europe/Berlin\"\n                DB_SERVER_HOST = \"127.0.0.1\"\n                DB_SERVER_PORT = \"5432\"\n                ZBX_SERVER_HOST = \"127.0.0.1\"\n                ZBX_SERVER_PORT = \"10051\"\n            }\n\n            volume_mount {\n                volume      = \"localtime\"\n                destination = \"/etc/localtime\" #\u003c-- in the container\n                read_only   = false\n            }\n\n            volume_mount {\n                volume      = \"timezone\"\n                destination = \"/etc/timezone\" #\u003c-- in the container\n                read_only   = false\n            }\n\n            resources {\n                cpu    = 1024\n                memory = 1000\n            }\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fnomad-zabbix-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fnomad-zabbix-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fnomad-zabbix-server/lists"}