feat:添加zabbix-postgresql版本

This commit is contained in:
okxlin 2024-04-03 13:30:09 +08:00
parent 2ffdf37a39
commit ca3deefe77
11 changed files with 253 additions and 1 deletions

View File

@ -0,0 +1,8 @@
CONTAINER_NAME="zabbix-server"
PANEL_APP_PORT_COMM="10051"
PANEL_APP_PORT_HTTP="40047"
PANEL_APP_PORT_SNMP="1162"
PANEL_DB_HOST="127.0.0.1"
PANEL_DB_NAME="zabbix"
PANEL_DB_USER="zabbix"
PANEL_DB_USER_PASSWORD="MyDBPWD_brls9UwcRasl"

View File

@ -0,0 +1,58 @@
additionalProperties:
formFields:
- default: ""
edit: true
envKey: PANEL_DB_HOST
key: postgresql
labelEn: Database Service
labelZh: 数据库服务
required: true
type: service
- default: zabbix
envKey: PANEL_DB_NAME
labelEn: Database
labelZh: 数据库名
random: true
required: true
rule: paramCommon
type: text
- default: zabbix
envKey: PANEL_DB_USER
labelEn: User
labelZh: 数据库用户
random: true
required: true
rule: paramCommon
type: text
- default: zabbix
envKey: PANEL_DB_USER_PASSWORD
labelEn: Password
labelZh: 数据库用户密码
random: true
required: true
rule: paramComplexity
type: password
- default: 10051
edit: true
envKey: PANEL_APP_PORT_COMM
labelEn: Gateway port
labelZh: 网关端口
required: true
rule: paramPort
type: number
- default: 40047
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: 1162
edit: true
envKey: PANEL_APP_PORT_SNMP
labelEn: Snmptraps Port
labelZh: Snmptraps 端口
required: true
rule: paramPort
type: number

View File

@ -0,0 +1,56 @@
version: '3.7'
services:
zabbix-snmptraps:
container_name: ${CONTAINER_NAME}-snmptraps
image: zabbix/zabbix-snmptraps:alpine-6.4.13
volumes:
- ./data/snmptraps:/var/lib/zabbix/snmptraps:rw
- ./data/mibs:/usr/share/snmp/mibs:ro
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_SNMP}:1162/udp"
restart: always
labels:
createdBy: Apps
zabbix-server-pgsql:
container_name: ${CONTAINER_NAME}
image: zabbix/zabbix-server-pgsql:alpine-6.4.13
environment:
- DB_SERVER_HOST=${PANEL_DB_HOST}
- POSTGRES_USER=${PANEL_DB_USER}
- POSTGRES_PASSWORD=${PANEL_DB_USER_PASSWORD}
- POSTGRES_DB=${PANEL_DB_NAME}
- ZBX_ENABLE_SNMP_TRAPS=true
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_COMM}:10051"
volumes:
- ./data/snmptraps:/var/lib/zabbix/snmptraps:rw
- ./data/mibs:/usr/share/snmp/mibs:ro
restart: always
labels:
createdBy: Apps
zabbix-web-nginx-pgsql:
container_name: ${CONTAINER_NAME}-nginx
image: zabbix/zabbix-web-nginx-pgsql:alpine-6.4.13
environment:
- ZBX_SERVER_HOST=zabbix-server-pgsql
- DB_SERVER_HOST=${PANEL_DB_HOST}
- POSTGRES_USER=${PANEL_DB_USER}
- POSTGRES_PASSWORD=${PANEL_DB_USER_PASSWORD}
- POSTGRES_DB=${PANEL_DB_NAME}
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:8080"
restart: always
labels:
createdBy: Apps
networks:
1panel-network:
external: true

View File

@ -0,0 +1,3 @@
#!/bin/bash
chown -R 1000:1000 data

View File

@ -9,7 +9,9 @@ password:zabbix
## 注意事项
**注意这是Zabbix-MySQL版本的Zabbix 6.X的需求环境MySQL8**
**注意默认版本是Zabbix-MySQL版本的Zabbix 6.X的需求环境MySQL8**
**`postgresql`的版本,资源占用会小很多。**
商店自带的`MySQL 8`的数据库格式设置与`Zabbix`需求有所不同,`zabbix-server-mysql`容器会提示存在错误。

View File

@ -0,0 +1,8 @@
CONTAINER_NAME="zabbix-server"
PANEL_APP_PORT_COMM="10051"
PANEL_APP_PORT_HTTP="40047"
PANEL_APP_PORT_SNMP="1162"
PANEL_DB_HOST="127.0.0.1"
PANEL_DB_NAME="zabbix"
PANEL_DB_USER="zabbix"
PANEL_DB_USER_PASSWORD="MyDBPWD_brls9UwcRasl"

View File

@ -0,0 +1,58 @@
additionalProperties:
formFields:
- default: ""
edit: true
envKey: PANEL_DB_HOST
key: postgresql
labelEn: Database Service
labelZh: 数据库服务
required: true
type: service
- default: zabbix
envKey: PANEL_DB_NAME
labelEn: Database
labelZh: 数据库名
random: true
required: true
rule: paramCommon
type: text
- default: zabbix
envKey: PANEL_DB_USER
labelEn: User
labelZh: 数据库用户
random: true
required: true
rule: paramCommon
type: text
- default: zabbix
envKey: PANEL_DB_USER_PASSWORD
labelEn: Password
labelZh: 数据库用户密码
random: true
required: true
rule: paramComplexity
type: password
- default: 10051
edit: true
envKey: PANEL_APP_PORT_COMM
labelEn: Gateway port
labelZh: 网关端口
required: true
rule: paramPort
type: number
- default: 40047
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: 1162
edit: true
envKey: PANEL_APP_PORT_SNMP
labelEn: Snmptraps Port
labelZh: Snmptraps 端口
required: true
rule: paramPort
type: number

View File

@ -0,0 +1,56 @@
version: '3.7'
services:
zabbix-snmptraps:
container_name: ${CONTAINER_NAME}-snmptraps
image: zabbix/zabbix-snmptraps:latest
volumes:
- ./data/snmptraps:/var/lib/zabbix/snmptraps:rw
- ./data/mibs:/usr/share/snmp/mibs:ro
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_SNMP}:1162/udp"
restart: always
labels:
createdBy: Apps
zabbix-server-pgsql:
container_name: ${CONTAINER_NAME}
image: zabbix/zabbix-server-pgsql:latest
environment:
- DB_SERVER_HOST=${PANEL_DB_HOST}
- POSTGRES_USER=${PANEL_DB_USER}
- POSTGRES_PASSWORD=${PANEL_DB_USER_PASSWORD}
- POSTGRES_DB=${PANEL_DB_NAME}
- ZBX_ENABLE_SNMP_TRAPS=true
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_COMM}:10051"
volumes:
- ./data/snmptraps:/var/lib/zabbix/snmptraps:rw
- ./data/mibs:/usr/share/snmp/mibs:ro
restart: always
labels:
createdBy: Apps
zabbix-web-nginx-pgsql:
container_name: ${CONTAINER_NAME}-nginx
image: zabbix/zabbix-web-nginx-pgsql:latest
environment:
- ZBX_SERVER_HOST=zabbix-server-pgsql
- DB_SERVER_HOST=${PANEL_DB_HOST}
- POSTGRES_USER=${PANEL_DB_USER}
- POSTGRES_PASSWORD=${PANEL_DB_USER_PASSWORD}
- POSTGRES_DB=${PANEL_DB_NAME}
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:8080"
restart: always
labels:
createdBy: Apps
networks:
1panel-network:
external: true

View File

@ -0,0 +1,3 @@
#!/bin/bash
chown -R 1000:1000 data