1.下载oracle客户端安装包(linux版)到 /opt/minitor/oracleDb 。
下载地址:https://download.csdn.net/download/a15565772151/11111941
可以私聊我一下我发你资源
1
2
3
4
5
6
7
8
|
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *IP*)(PORT =
1521
))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = *SID*)
)
)
|
1
2
3
4
5
|
export ORACLE_HOME=/usr/lib/oracle/
11.2
/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=
'simplified chinese_china'
.ZHS16GBK
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
|
6. 使配置完的环境变量生效 source ~/.bashrc
7.进入/opt/minitor/oracleDb,执行以下命令为oracledb_exporter.linux-amd64赋权。
下载地址:https://download.csdn.net/download/a15565772151/11111977
可以私聊我一下我发你资源
1
|
chmod +x oracledb_exporter.linux-amd64
|
8. 再设置执行的环境变量,命令行直接执行如下命令export:
export DATA_SOURCE_NAME=用户名/密码@ 数据库服务名 注意:某些字符在xshell中执行需要转义
如:我这里的用户名密码是 system/root12#$
export DATA_SOURCE_NAME="system/oracle12#\$@ORCL"
9.执行 vim /opt/minitor/prometheus/prometheus.yml,添加以下配置文件(红色部分):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from
this
config.
- job_name:
'prometheus'
# metrics_path defaults to
'/metrics'
# scheme defaults to
'http'
.
static_configs:
- targets: [
'ip:9090'
]
labels:
instance: prometheus
- job_name: oracle
static_configs:
- targets: [
'ip:9161'
]
labels:
instance: oracle
|
10.启动oracle_exporter
1
|
nohup ./oracledb_exporter.linux-amd64 &
|
11.去prometheus自带的web页面上查看
12.在grafana中查看配置状态(推荐使用3333)
13.效果图如下:
所有评论(0)