Prechádzať zdrojové kódy

zabbix server/agent调试

zuypeng 11 mesiacov pred
rodič
commit
e413b6583e

+ 10 - 10
admin-web/src/views/admin/config/dialog.vue

@@ -22,7 +22,7 @@
           class="mt5">
         <el-form-item label="参数key" prop="key" class="wd300">
           <el-input
-              v-model="state.ruleForm.key"
+              v-model="state.ruleForm.configKey"
               placeholder="配置参数的key"
               clearable
               class="w100">
@@ -37,19 +37,19 @@
           </el-input>
         </el-form-item>
 
-        <el-form-item label="状态" prop="status" class="wd300">
+<!--        <el-form-item label="状态" prop="status" class="wd300">
           <ext-boolean v-model="state.ruleForm.status"></ext-boolean>
-          <!--          <el-input
+          &lt;!&ndash;          <el-input
                         v-model="state.ruleForm.status"
                         placeholder="状态:0-无效,1-有效"
                         clearable
                         class="w100">
-                    </el-input>-->
-        </el-form-item>
+                    </el-input>&ndash;&gt;
+        </el-form-item>-->
 
         <el-form-item label="配置值" prop="value" class="w100">
           <el-input
-              v-model="state.ruleForm.value"
+              v-model="state.ruleForm.configValue"
               placeholder="配置的参数值"
               clearable
               type="textarea"
@@ -86,7 +86,7 @@
 <script setup lang="ts" name="ConfigDialog">
 import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
 import {Msg} from "/@/utils/message";
-import {$body, $get} from "/@/utils/request";
+import {$body, $get, $post} from "/@/utils/request";
 import u from '/@/utils/u'
 import ExtBoolean from "/@/components/form/ExtBoolean.vue";
 
@@ -106,8 +106,8 @@ const initState = () => ({
     submitTxt: '',
   },
   rules: {
-    key:[u.validator.required],
-    value:[u.validator.required],
+    configKey:[u.validator.required],
+    configValue:[u.validator.required],
     valueType:[u.validator.required],
   },
 })
@@ -162,7 +162,7 @@ const handleFormChange = (formData: any) => {
 
 // 初始化数据
 const loadData = (id: number) => {
-  $get(`config/detail/${id}`).then((res: any) => {
+  $post(`config/detail/${id}`).then((res: any) => {
     state.ruleForm = res;
   })
 }

+ 18 - 13
admin-web/src/views/admin/config/index.vue

@@ -85,15 +85,16 @@
             <template v-else-if="['prepayMoney','amount','amountReceivable','amountReceived','cardBalance','coinMoney','discountAmount','discountMoney'].includes(field.prop)">
               {{ u.fmt.fmtMoney(row[field.prop]) }}
             </template>
-            <template v-else-if="field.prop==='idleRemainTime'||field.prop==='operationRemainTime'">
-              {{ u.fmt.fmtDuration(row[field.prop]) }}
+            <template v-else-if="field.prop==='delete'">
+              <ext-d-label type="Common.status" :model-value="row[field.prop]?2:1"></ext-d-label>
             </template>
             <template v-else-if="['createTime','updateTime'].includes(field.prop)">
               {{ u.fmt.fmtDateTime(row[field.prop]) }}
             </template>
             <template v-else-if="field.prop==='action'">
-              <el-button v-auth="'config.modify'" type="warning" size="small" text @click="handleRowClick('edit',row)"> 编辑</el-button>
-              <el-button v-auth="'config.remove'" type="danger" size="small" text @click="handleRowDelete(row)"> 禁用</el-button>
+              <el-button v-auth="'config.modify'" type="warning" size="default" text @click="handleRowClick('edit',row)"> 编辑</el-button>
+              <el-button v-auth="'config.remove'" v-if="row.delete" type="success" size="default" text @click="handleRowDelete(row)"> 启用</el-button>
+              <el-button v-auth="'config.remove'" v-if="!row.delete" type="danger" size="default" text @click="handleRowDelete(row)"> 禁用</el-button>
             </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
@@ -103,7 +104,7 @@
         </el-table-column>
       </el-table>
 
-<!--      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
+      <!--      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
     </el-card>
   </div>
   <ConfigDialog ref="configDialogRef" @refresh="loadData(true)"/>
@@ -111,18 +112,19 @@
 
 <script setup lang="ts" name="ConfigList">
 import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
-import {$body, $get} from "/@/utils/request";
+import {$body, $get, $post} from "/@/utils/request";
 import u from '/@/utils/u'
 import {Msg} from "/@/utils/message";
 import {Session} from "/@/utils/storage";
 
 
 import ExtPage from '/@/components/form/ExtPage.vue'
-import ExtQueryForm from "/@/components/form/ExtAdminQueryForm.vue";
+import ExtQueryForm from "/@/components/form/ExtQueryForm.vue";
 
 import mittBus from '/@/utils/mitt';
 
 import {ElButton} from 'element-plus'
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
 
 const ConfigDialog = defineAsyncComponent(() => import("/@/views/admin/config/dialog.vue"));
@@ -147,9 +149,10 @@ const state = reactive({
   importConfig: {},
   exportConfig: {},
   columns: [
-    {label: '配置key', width: 180, prop: 'key', query: true, type: 'text', resizable: true},
+    {label: '配置关键字', width: 180, prop: 'configKey', query: true, type: 'text', resizable: true},
+    {label: '配置值', width: 280, prop: 'configValue', query: true, type: 'text', resizable: true},
     {label: '值类型', width: 180, prop: 'valueType', query: true, type: 'text', resizable: true},
-    {label: '状态', prop: 'status', sortable: 'custom', align: 'center', query: true, type: 'dict', conf: {dict: 'Config.status'}},
+    {label: '是否禁用',width: 120, prop: 'delete', sortable: 'custom', align: 'center',type:'bool', query: true},
     {label: '备注', width: 180, prop: 'remark', query: true, type: 'text', resizable: true},
     {label: '创建时间', width: 180, prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
     {label: '更新时间', width: 180, prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
@@ -212,11 +215,13 @@ const handleRowClick = (type: string, row: any) => {
 };
 // 删除点击
 const handleRowDelete = (row: any) => {
-  Msg.confirm(`此操作将禁用配置项,是否继续?`).then(() => {
-    $get(`/config/remove/${row.id}`).then(() => {
-      Msg.message("操作成功", 'success')
+  let label = row.delete ? '启用' : '禁用'
+  Msg.confirm(`此操作将${label}配置项,是否继续?`).then(() => {
+    $body(`/config/status`,Object.assign({},row,{delete:!row.delete})).then(() => {
+      Msg.message(label + "成功", 'success')
+      loadData(true)
     }).catch(() => {
-      Msg.message("操作失败", 'error')
+      Msg.message(label + "失败", 'error')
     })
   });
 };

+ 6 - 0
car-wash-admin/pom.xml

@@ -37,6 +37,12 @@
             <version>3.1.1</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.2.16</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi-ooxml</artifactId>

+ 14 - 0
car-wash-admin/src/main/java/com/kym/admin/controller/ConfigController.java

@@ -57,6 +57,20 @@ public class ConfigController extends IController {
     }
 
 
+    /**
+     * 配置表编辑
+     *
+     * @return Res
+     */
+    @SysLog("配置表更新")
+    @SaCheckPermission("config.modify")
+    @PostMapping("status")
+    public R<?> status(@Valid @RequestBody Config config) {
+        return resp((t) -> configService.status(config));
+    }
+
+
+
     /**
      * 配置表查询接口
      *

+ 9 - 9
car-wash-common/src/main/java/com/kym/common/utils/ConfigUtil.java

@@ -21,7 +21,7 @@ public class ConfigUtil {
      */
     public static void initConfig(List<Config> configList) {
         configs.clear();
-        configList.removeIf(k -> !k.isStatus());
+        configList.removeIf(k -> !k.isDelete());
         configs.addAll(configList);
     }
 
@@ -32,9 +32,9 @@ public class ConfigUtil {
      * @return
      */
     public static <T> T getConfig(String key, Class<T> resultType, T defaultValue) {
-        Optional<Config> cfg = configs.stream().filter(k -> k.getKey().equals(key)).findFirst();
+        Optional<Config> cfg = configs.stream().filter(k -> k.getConfigKey().equals(key)).findFirst();
         if (cfg.isPresent()) {
-            return JSONUtil.toBean(cfg.get().getValue(), resultType);
+            return JSONUtil.toBean(cfg.get().getConfigValue(), resultType);
         } else {
             return defaultValue;
         }
@@ -47,8 +47,8 @@ public class ConfigUtil {
      * @return
      */
     public static <T> T getConfig(String key, Class<T> resultType) {
-        Optional<Config> cfg = configs.stream().filter(k -> k.getKey().equals(key)).findFirst();
-        return cfg.map(config -> JSONUtil.toBean(config.getValue(), resultType)).orElse(null);
+        Optional<Config> cfg = configs.stream().filter(k -> k.getConfigKey().equals(key)).findFirst();
+        return cfg.map(config -> JSONUtil.toBean(config.getConfigValue(), resultType)).orElse(null);
     }
 
     /**
@@ -58,8 +58,8 @@ public class ConfigUtil {
      * @return
      */
     public static String getConfig(String key) {
-        Config cfg = configs.stream().filter(k -> k.getKey().equals(key)).findFirst().orElse(new Config());
-        return cfg.getValue();
+        Config cfg = configs.stream().filter(k -> k.getConfigKey().equals(key)).findFirst().orElse(new Config());
+        return cfg.getConfigValue();
     }
 
     /**
@@ -68,8 +68,8 @@ public class ConfigUtil {
      * @param config
      */
     public static void updateConfig(Config config) {
-        configs.removeIf(k -> k.getKey().equals(config.getKey()));
-        if (config.isStatus()) {
+        configs.removeIf(k -> k.getConfigKey().equals(config.getConfigKey()));
+        if (config.isDelete()) {
             configs.add(config);
         }
     }

+ 4 - 8
car-wash-entity/src/main/java/com/kym/entity/Config.java

@@ -2,7 +2,6 @@ package com.kym.entity;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import jakarta.validation.constraints.Max;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.experimental.Accessors;
@@ -21,19 +20,16 @@ import java.io.Serializable;
 @TableName("t_config")
 @Accessors(chain = true)
 public class Config extends BaseEntity implements Serializable {
-    private long id;
-
-    private long companyId;
     /**
      * 配置key  唯一
      */
     @Length(max = 128)
-    private String key;
+    private String configKey;
     /**
      * 配置值
      */
     @Length(max = 512)
-    private String value;
+    private String configValue;
 
     /**
      * 值类型
@@ -43,11 +39,11 @@ public class Config extends BaseEntity implements Serializable {
     /**
      * 状态:0-无效,1-有效
      */
-    private boolean status;
+    private boolean isDelete;
     /**
      * 备注
      */
-    @Max(value = 512)
+    @Length(max = 512)
     private String remark;
 
 

+ 1 - 3
car-wash-entity/src/main/java/com/kym/entity/queryParams/ConfigQueryParam.java

@@ -1,9 +1,7 @@
 package com.kym.entity.queryParams;
 
 import com.kym.entity.common.PageParams;
-import jakarta.validation.constraints.Max;
 import lombok.Data;
-import org.hibernate.validator.constraints.Length;
 
 @Data
 public class ConfigQueryParam extends PageParams {
@@ -23,7 +21,7 @@ public class ConfigQueryParam extends PageParams {
     /**
      * 状态:0-无效,1-有效
      */
-    private Boolean status;
+    private Boolean delete;
     /**
      * 备注
      */

+ 2 - 2
car-wash-mapper/src/main/java/com/kym/mapper/ConfigMapper.java

@@ -1,13 +1,13 @@
 package com.kym.mapper;
 
+import com.github.yulichang.base.MPJBaseMapper;
 import com.kym.entity.Config;
-import com.kym.mapper.mybatisplus.MyBaseMapper;
 
 /**
  * <p>
  * 配置表 Mapper 接口
  * </p>
  */
-public interface ConfigMapper extends  MyBaseMapper<Config> {
+public interface ConfigMapper extends MPJBaseMapper<Config> {
 
 }

+ 4 - 2
car-wash-service/src/main/java/com/kym/service/ConfigService.java

@@ -1,11 +1,11 @@
 package com.kym.service;
 
+import com.github.yulichang.base.MPJBaseService;
 import com.kym.entity.Config;
 import com.kym.entity.common.PageBean;
 import com.kym.entity.queryParams.ConfigQueryParam;
-import com.kym.service.mybatisplus.MyBaseService;
 
-public interface ConfigService  extends MyBaseService<Config> {
+public interface ConfigService  extends MPJBaseService<Config> {
     Number add(Config config);
 
     void modify(Config config);
@@ -17,4 +17,6 @@ public interface ConfigService  extends MyBaseService<Config> {
     void remove(long id);
 
     void initConfig();
+
+    void status(Config config);
 }

+ 6 - 3
car-wash-service/src/main/java/com/kym/service/cache/PubSubService.java

@@ -1,6 +1,7 @@
 package com.kym.service.cache;
 
 
+import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.kym.common.utils.ConfigUtil;
@@ -10,6 +11,7 @@ import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.data.redis.connection.Message;
 import org.springframework.data.redis.connection.MessageListener;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
@@ -26,7 +28,7 @@ public class PubSubService {
     public static final String CHANNEL = "channel";
 
     @Resource
-    private StringRedisTemplate redisTemplate;
+    private RedisTemplate redisTemplate;
 
 
     /**
@@ -36,7 +38,8 @@ public class PubSubService {
      * @param message
      */
     public void publish(String channel, String message) {
-        redisTemplate.convertAndSend(channel, message);
+        log.warn("publish>>>>>>>>:{}", message);
+        SpringUtil.getBean(StringRedisTemplate.class).convertAndSend(channel, message);
     }
 
 
@@ -66,7 +69,7 @@ public class PubSubService {
             subscribe(CHANNEL, new BiConsumer<String, String>() {
                 @Override
                 public void accept(String channel, String jsonBody) {
-                    log.debug("deal with subscribe!!!");
+                    log.debug("deal with subscribe!!!:{}", jsonBody);
                     JSONObject entries = JSONUtil.parseObj(jsonBody);
                     String configNode = entries.getStr("node");
                     if (configNode.equals(ConfigUtil.getNode())) {

+ 31 - 14
car-wash-service/src/main/java/com/kym/service/impl/ConfigServiceImpl.java

@@ -3,6 +3,7 @@ package com.kym.service.impl;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.github.pagehelper.PageHelper;
+import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.kym.common.utils.CommUtil;
 import com.kym.common.utils.ConfigUtil;
 import com.kym.entity.Config;
@@ -11,7 +12,6 @@ import com.kym.entity.queryParams.ConfigQueryParam;
 import com.kym.mapper.ConfigMapper;
 import com.kym.service.ConfigService;
 import com.kym.service.cache.PubSubService;
-import com.kym.service.mybatisplus.MyBaseServiceImpl;
 import jakarta.annotation.PostConstruct;
 import jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
@@ -26,7 +26,7 @@ import java.util.Map;
  * @date 2025-06-15T19:17:14.374702500
  */
 @Service("configService")
-public class ConfigServiceImpl extends MyBaseServiceImpl<ConfigMapper, Config> implements ConfigService {
+public class ConfigServiceImpl extends MPJBaseServiceImpl<ConfigMapper, Config> implements ConfigService {
 
     @Resource
     private PubSubService pubSubService;
@@ -34,43 +34,47 @@ public class ConfigServiceImpl extends MyBaseServiceImpl<ConfigMapper, Config> i
     @Override
     public Number add(Config config) {
 //        config.setCompanyId(1)
-        config.setStatus(true);
-        var rows =  insertIgnore(config);
+        config.setDelete(false);
+        var rows =  save(config);
 
-        if(rows>0){
+        if(rows){
             pubSubService.publish(PubSubService.CHANNEL,
                     JSONUtil.toJsonStr(
                             Map.of("node", ConfigUtil.getNode(), "config", config)
                     ));
         }
 
-        return rows;
+        return config.getId();
     }
 
     @Override
     public void modify(Config config) {
         UpdateWrapper<Config> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.set("value", config.getValue());
+        updateWrapper.set("config_value", config.getConfigValue());
         updateWrapper.set("remark", config.getRemark());
-        updateWrapper.set("valueType", config.getValueType());
-        updateWrapper.eq("key", config.getKey());
+        updateWrapper.set("value_type", config.getValueType());
+        updateWrapper.eq("config_key", config.getConfigKey());
         update(updateWrapper);
 
         pubSubService.publish(PubSubService.CHANNEL,
                 JSONUtil.toJsonStr(
                         Map.of("node", ConfigUtil.getNode(), "config", config)
                 ));
+
+        log.debug(  JSONUtil.toJsonStr(
+                Map.of("node", ConfigUtil.getNode(), "config", config)
+        ));
     }
 
     @Override
     public PageBean<Config> list(ConfigQueryParam query) {
         PageHelper.startPage(query.getPageNum(), query.getPageSize());
         var list = lambdaQuery()
-                .like(CommUtil.isNotEmptyAndNull(query.getKey()), Config::getKey, query.getKey())
-                .like(CommUtil.isNotEmptyAndNull(query.getValue()), Config::getValue, query.getValue())
+                .like(CommUtil.isNotEmptyAndNull(query.getKey()), Config::getConfigKey, query.getKey())
+                .like(CommUtil.isNotEmptyAndNull(query.getValue()), Config::getConfigValue, query.getValue())
                 .like(CommUtil.isNotEmptyAndNull(query.getValueType()), Config::getValueType, query.getValueType())
                 .like(CommUtil.isNotEmptyAndNull(query.getRemark()), Config::getRemark, query.getRemark())
-                .like(CommUtil.isNotEmptyAndNull(query.getStatus()), Config::isStatus, query.getStatus())
+                .like(CommUtil.isNotEmptyAndNull(query.getDelete()), Config::isDelete, query.getDelete())
                 .list();
         return new PageBean<>(list);
     }
@@ -83,9 +87,9 @@ public class ConfigServiceImpl extends MyBaseServiceImpl<ConfigMapper, Config> i
     @Override
     public void remove(long id) {
         Config cfg = getById(id);
-        cfg.setStatus(false);
+        cfg.setDelete(true);
         UpdateWrapper<Config> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.set("status", false);
+        updateWrapper.set("is_delete", false);
         updateWrapper.eq("id", id);
         update(updateWrapper);
 
@@ -103,5 +107,18 @@ public class ConfigServiceImpl extends MyBaseServiceImpl<ConfigMapper, Config> i
         ConfigUtil.initConfig(list);
     }
 
+    @Override
+    public void status(Config config) {
+        UpdateWrapper<Config> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.set("is_delete", config.isDelete());
+        updateWrapper.eq("id", config.getId());
+        update(updateWrapper);
+
+        pubSubService.publish(PubSubService.CHANNEL,
+                JSONUtil.toJsonStr(
+                        Map.of("node", ConfigUtil.getNode(), "config", config)
+                ));
+    }
+
 
 }

+ 60 - 38
zabbix/docker-compose.yaml

@@ -1,48 +1,70 @@
-version: '3'
+# docker-compose zabbix-server镜像部署配置文件
+version: '3.3'
 services:
-  db:
-    image: mysql:latest  #也可复用已存在的mysql实例
-    container_name: zabbix-db
-    environment:
-      MYSQL_DATABASE: zabbix
-      MYSQL_USER: zabbix
-      MYSQL_PASSWORD: zabbix
-      MYSQL_ROOT_PASSWORD: root
+  zabbix_mysql:
+    container_name: "zabbix_mysql"
+    restart: "always"
+    image: mariadb:11.5.2
+    ports:
+      - "13306:3306"
     volumes:
-      - zabbix-db-data:/var/docker/zabbix/mysql
-    restart: unless-stopped
-
-  zabbix-server:
-    image: zabbix/zabbix-server-mysql:alpine-7.2.4
-    container_name: zabbix-server
+      - ./mysql-data:/var/lib/mysql
+    command:
+      --character-set-server=utf8mb4
+      --collation-server=utf8mb4_bin
     environment:
-      DB_SERVER_HOST: "db"
-      MYSQL_DATABASE: zabbix
-      MYSQL_USER: zabbix
-      MYSQL_PASSWORD: zabbix
-      MYSQL_ROOT_PASSWORD: root
+      LANG: "en_US.UTF-8"
+      LC_ALL: "en_US.UTF-8"
+      MYSQL_ROOT_PASSWORD: "mysqlpss123"
+      MYSQL_USER: "zabbix"
+      MYSQL_PASSWORD: "mysqlpss123"
+      MYSQL_DATABASE: "zabbix"
+      MYSQL_CHARSET: "utf8mb4"
+      MYSQL_COLLATION: "utf8mb4_bin"
+
+  zabbix_server:
+    container_name: "zabbix_server"
+    restart: "always"
+    image: zabbix/zabbix-server-mysql
     ports:
       - "10051:10051"
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
     depends_on:
-      - db
-    restart: unless-stopped
-
-  zabbix-web:
-    image: zabbix/zabbix-web-nginx-mysql:alpine-7.2.4
-    container_name: zabbix-web
+      - zabbix_mysql
+    links:
+      - zabbix_mysql:mysql
     environment:
-      ZBX_SERVER_HOST: "zabbix-server"
-      DB_SERVER_HOST: "db"
-      MYSQL_DATABASE: zabbix
-      MYSQL_USER: zabbix
-      MYSQL_PASSWORD: zabbix
-      MYSQL_ROOT_PASSWORD: root
-      PHP_TZ: Asia/Shanghai
+      LANG: "en_US.UTF-8"
+      LC_ALL: "en_US.UTF-8"
+      DB_SERVER_HOST: "mysql"
+      MYSQL_USER: "zabbix"
+      MYSQL_DATABASE: "zabbix"
+      MYSQL_PASSWORD: "mysqlpss123"
+      MYSQL_CHARSET: "utf8"
+      MYSQL_COLLATION: "utf8_bin"
+
+  zabbix_nginx_web:
+    container_name: "zabbix_nginx_web"
+    restart: "always"
+    image: zabbix/zabbix-web-nginx-mysql
     ports:
+      - "1443:443"
       - "80:8080"
     depends_on:
-      - zabbix-server
-    restart: unless-stopped
-
-volumes:
-  zabbix-db-data:
+      - zabbix_mysql
+      - zabbix_server
+    links:
+      - zabbix_mysql:mysql
+      - zabbix_server:zabbix_server
+    environment:
+      LANG: "en_US.UTF-8"
+      LC_ALL: "en_US.UTF-8"
+      DB_SERVER_HOST: "mysql"
+      MYSQL_USER: "zabbix"
+      MYSQL_PASSWORD: "mysqlpss123"
+      MYSQL_DATABASE: "zabbix"
+      ZBX_SERVER_HOST: "zabbix_server"
+      PHP_TZ: "Asia/Shanghai"
+      MYSQL_CHARSET: "utf8"
+      MYSQL_COLLATION: "utf8_bin"

+ 9 - 4
zabbix/readme.md

@@ -1,7 +1,3 @@
-# 待验证 
-
-
-
 zabbix 监控说明,服务端采用docker-compose服务模式安装,客户端采用yum工具安装。被监控目标主机通过zabbix-agent程序向
 zabbix-server提供采集的宿主机数据,落库到zabbix-db中,最终在zabbix-web展示
 
@@ -12,6 +8,9 @@ zabbix-server提供采集的宿主机数据,落库到zabbix-db中,最终在z
 #安装方法
 sudo curl -L "https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 sudo chmod +x /usr/local/bin/docker-compose
+
+或者
+apt-get install docker-compose-plugin
 ```    
 
 #### 1. zabbix-server
@@ -35,6 +34,12 @@ yum clean all
 
 yum install -y zabbix-agent
 
+#ubuntu 添加源
+ wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb
+  sudo dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb
+  
+  apt install zabbix-agent
+
 #zabbix-agent配置
 vim /etc/zabbix/zabbix_agentd.conf