<thead id="xjx1f"></thead>
      <sub id="xjx1f"></sub>

        <address id="xjx1f"></address>

            【Zabbix】zabora批量部署

            zabora简化批量部署

            目的:简化部署zabora,批量监控数据库的常用指标

            1 数据库用户赋权

            上传cre_arp_monitor.sh,并且部署用户。

            [[email protected] ~]# chown -R 777 /tmp/cre_arp_monitor.sh 
            [[email protected] ~]# su - oracle
            [[email protected] ~]$ /tmp/cre_arp_monitor.sh

            cre_arp_monitor.sh核心命令如下:

            #!/bin/ksh
            
            export ORACLE_BASE=/u01/app 
            export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
            export ORACLE_SID=oradb
            export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
            
            SQL_STATEMENT="
            show user;
            CREATE USER monitor IDENTIFIED BY newarpxxx DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK;
            GRANT CONNECT TO monitor;
            GRANT RESOURCE TO monitor;
            ALTER USER monitor DEFAULT ROLE ALL;
            GRANT SELECT ANY TABLE TO monitor;
            GRANT CREATE SESSION TO monitor;
            GRANT SELECT ANY DICTIONARY TO monitor;
            GRANT UNLIMITED TABLESPACE TO monitor;
            GRANT SELECT ANY DICTIONARY TO monitor;
            GRANT SELECT ON V_\$SESSION TO monitor;
            GRANT SELECT ON V_\$SYSTEM_EVENT TO monitor;
            GRANT SELECT ON V_\$EVENT_NAME TO monitor;
            GRANT SELECT ON V_\$RECOVERY_FILE_DEST TO monitor;
            "
            
            $ORACLE_HOME/bin/sqlplus / as sysdba << EOF
            $SQL_STATEMENT
            exit;
            EOF

            2 部署zabora的agent服务.

            上传ora_agent.sh/root目录下.直接运行

            [[email protected] ~]# ./ora_agent.sh

            ora_agent.sh核心命令如下:

            #!/bin/bash
            echo "---------getOraAgent----------"
            wget http://172.31.1.6/update/tools/zabora.tar.gz
            tar zxvf zabora.tar.gz
            
            echo "--------deployOraAgent--------"
            ./zabora/deploy_zabbix.sh "monitor" "newarp2019"
            
            echo "--------chmod 755 zabora.sh--------"
            chmod 755 /etc/zabbix/scripts/agentd/zabora/zabora.sh
            
            echo "-----restartZabbixAgent-------"
            service zabbix-agent restart

            3 验证部署效果

            去zabbix-server,执行如下命令:

            [[email protected] ~]# zabbix_get -s 172.31.xx.34 -k "zabora[oradb,db_active,1]"
            1
            [[email protected] ~]# zabbix_get -s 172.31.xx.34 -k "zabora[oradb,tb_size,SYSTEM]"
            2.88

            得到如上结果,说明数据库的agent监控安装成功。

            相关文章
            相关标签/搜索
            黄大仙精选资料一肖一码 嘉祥县| 房产| 营口市| 呈贡县| 格尔木市| 嘉兴市| 常德市| 中方县| 宜昌市| 濮阳县| 收藏| 临洮县| 祁东县| 宿迁市| 基隆市| 宜黄县| 太和县| 伊金霍洛旗| 故城县| 竹溪县| 攀枝花市| 惠水县| 平罗县| 阿克苏市| 乐都县| 毕节市| 平罗县| 聂拉木县| 西乡县| 姚安县| 东方市| 仙居县| 墨玉县| 文昌市| 陆良县| 镇远县| 元氏县| http://fa.hz0j1r1vo.fun http://fa.hz0j1r7vo.fun http://fa.hz0j1r3vo.fun http://fa.hz0j2r1vo.fun http://fa.hz0j2r0vo.fun