You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for RH 10, libcrypt.so.1 is required and may need to install libxcrypt-compat:
69
+
70
+
```bash
71
+
dnf install libxcrypt-compat
72
+
```
73
+
68
74
If you have root access you can set path to DB2 dynamic library via ld.so.conf:
69
75
70
76
```bash
@@ -402,3 +408,4 @@ The entrypoint "/metrics" accepts the following argument:
402
408
* auth_name=<auth_name> the authentication parameters to use to connect with data_source_name
403
409
* auth_key=<auth_key> the shared key used to decipher encrypted password.
404
410
* health=<true> alter scraping behavior: only return the target connection status metrics; Use to determine if the connection to target is OK or not 1|0.
411
+
* collector=<collector_name>[&collector=<coll_name2>&...] alter scraping behavior; collect specific collectors list, instead of the default defined for the target; usefull to build a specific job with custom metrics with a different scraping interval by example.
help: 'db backup duration in seconds by backup id and session type. labeled by start and end time'
8
+
key_labels:
9
+
- session_key
10
+
- BACKUP_TYPE
11
+
- start_time
12
+
- end_time
13
+
values:
14
+
- backup_duration_seconds
15
+
query_ref: rman_backup
16
+
17
+
- metric_name: backup_size
18
+
type: gauge
19
+
help: 'db backup size in bytes by backup id and session type'
20
+
key_labels:
21
+
- session_key
22
+
- BACKUP_TYPE
23
+
values:
24
+
- out_size_bytes
25
+
query_ref: rman_backup
26
+
27
+
- metric_name: backup_status
28
+
type: gauge
29
+
help: 'db backup status by backup id and session type: 0:FAILED - 1:COMPLETED - 2:COMPLETED WITH WARNINGS - 3:COMPLETED WITH ERRORS - 4:RUNNING WITH WARNINGS - 5:RUNNING WITH ERRORS'
30
+
key_labels:
31
+
- session_key
32
+
- BACKUP_TYPE
33
+
values:
34
+
- status
35
+
query_ref: rman_backup
36
+
37
+
# *****************
38
+
- metric_name: backup_last_timestamp
39
+
type: gauge
40
+
help: 'unix timestamp in second of the last backup indexed by backup type'
41
+
key_labels:
42
+
- backup_type
43
+
values:
44
+
- last_start_ts
45
+
query_ref: last_backup
46
+
47
+
# - metric_name: backup_last_duration_seconds
48
+
# type: gauge
49
+
# help: 'number of second since last backup indexed by backup type'
50
+
# key_labels:
51
+
# - backup_type
52
+
# values:
53
+
# - last_backup_seconds
54
+
# query_ref: last_backup
55
+
# with cte as (
56
+
# select
57
+
# max(START_TIME) last_bckup,
58
+
# INPUT_TYPE as BACKUP_TYPE
59
+
# from V$RMAN_BACKUP_JOB_DETAILS
60
+
# group by INPUT_TYPE
61
+
# )
62
+
# select (sysdate - last_bckup) * 86400 as last_backup_seconds, BACKUP_TYPE
63
+
# from cte
64
+
65
+
- metric_name: backup_last_size_bytes
66
+
type: gauge
67
+
help: 'number of bytes output in last backup indexed by backup type'
68
+
key_labels:
69
+
- session_key
70
+
- backup_type
71
+
values:
72
+
- last_backup_bytes
73
+
query_ref:
74
+
last_backup
75
+
# query:
76
+
# with cte as (
77
+
# select
78
+
# SESSION_KEY,
79
+
# RANK () OVER( PARTITION by INPUT_TYPE order by START_TIME DESC) as R_NUM
80
+
# from V$RMAN_BACKUP_JOB_DETAILS
81
+
# )
82
+
# select OUTPUT_BYTES AS last_backup_bytes,
83
+
# cte.SESSION_KEY,
84
+
# INPUT_TYPE as BACKUP_TYPE
85
+
# from cte
86
+
# join V$RMAN_BACKUP_JOB_DETAILS bck on cte.SESSION_KEY = bck.SESSION_KEY
87
+
# where cte.R_NUM = 1
88
+
89
+
- metric_name: backup_last_status
90
+
type: gauge
91
+
help: 'db backup status by backup id and session type: 0:FAILED - 1:COMPLETED - 2:COMPLETED WITH WARNINGS - 3:COMPLETED WITH ERRORS - 4:RUNNING WITH WARNINGS - 5:RUNNING WITH ERRORS'
92
+
key_labels:
93
+
- session_key
94
+
- BACKUP_TYPE
95
+
values:
96
+
- last_status
97
+
query_ref:
98
+
last_backup
99
+
100
+
101
+
102
+
103
+
104
+
# backup status
105
+
# 0 FAILED
106
+
# 1 COMPLETED
107
+
# 2 COMPLETED WITH WARNINGS
108
+
# 3 COMPLETED WITH ERRORS
109
+
# 4 RUNNING WITH WARNINGS
110
+
# 5 RUNNING WITH ERRORS
111
+
queries:
112
+
# Populates rman_backup: last 10 backup from each type
113
+
- query_name: rman_backup
114
+
query: |
115
+
with backups as (
116
+
select
117
+
SESSION_KEY,
118
+
RANK () OVER( PARTITION by INPUT_TYPE order by START_TIME DESC) as R_NUM
119
+
from V$RMAN_BACKUP_JOB_DETAILS
120
+
)
121
+
SELECT bck.session_key,
122
+
input_type as BACKUP_TYPE,
123
+
CASE status
124
+
WHEN 'COMPLETED' THEN 1
125
+
WHEN 'COMPLETED WITH WARNINGS' THEN 2
126
+
WHEN 'COMPLETED WITH ERRORS' THEN 3
127
+
WHEN 'FAILED' THEN 0
128
+
WHEN 'RUNNING WITH WARNINGS' THEN 4
129
+
WHEN 'RUNNING WITH ERRORS' THEN 5
130
+
END AS status,
131
+
TO_CHAR(start_time,'YYYY/MM/DD hh24:mi') AS start_time,
132
+
TO_CHAR(end_time, 'YYYY/MM/DD hh24:mi') AS end_time,
133
+
-- output_device_type,
134
+
elapsed_seconds AS backup_duration_seconds,
135
+
-- input_bytes AS in_size_bytes,
136
+
output_bytes AS out_size_bytes
137
+
from backups bck
138
+
join V$RMAN_BACKUP_JOB_DETAILS rawb on bck.session_key = rawb.session_key
139
+
where bck.R_NUM <= 10
140
+
141
+
# with bck_type as (
142
+
# select distinct input_type as BACKUP_TYPE
143
+
# from v$rman_backup_job_details
144
+
# ),
145
+
# backups as (
146
+
# SELECT session_key,
147
+
# input_type as BACKUP_TYPE,
148
+
# CASE status
149
+
# WHEN 'COMPLETED' THEN 1
150
+
# WHEN 'COMPLETED WITH WARNINGS' THEN 2
151
+
# WHEN 'COMPLETED WITH ERRORS' THEN 3
152
+
# WHEN 'FAILED' THEN 0
153
+
# WHEN 'RUNNING WITH WARNINGS' THEN 4
154
+
# WHEN 'RUNNING WITH ERRORS' THEN 5
155
+
# END AS status,
156
+
# TO_CHAR(start_time,'YYYY/MM/DD hh24:mi') AS start_time,
157
+
# TO_CHAR(end_time, 'YYYY/MM/DD hh24:mi') AS end_time,
158
+
# output_device_type,
159
+
# elapsed_seconds AS backup_duration_seconds,
160
+
# input_bytes AS in_size_bytes,
161
+
# output_bytes AS out_size_bytes
162
+
# FROM v$rman_backup_job_details
163
+
# WHERE
164
+
# rownum <= 10
165
+
# ORDER BY start_time desc
166
+
# )
167
+
# SELECT *
168
+
# FROM bck_type bt
169
+
# JOIN backups b on bt.backup_type = b.backup_type
170
+
171
+
# WHERE
172
+
173
+
- query_name: last_backup
174
+
query: |
175
+
with cte as (
176
+
select
177
+
SESSION_KEY,
178
+
RANK () OVER( PARTITION by INPUT_TYPE order by START_TIME DESC) as R_NUM
179
+
from V$RMAN_BACKUP_JOB_DETAILS
180
+
)
181
+
select
182
+
cte.SESSION_KEY,
183
+
INPUT_TYPE as BACKUP_TYPE,
184
+
(cast( (cast(start_time as timestamp with time zone) at time zone 'UTC') as date)
185
+
- date '1970-01-01') * 86400 as last_start_ts,
186
+
-- (sysdate - start_time) * 86400 as last_backup_seconds
187
+
OUTPUT_BYTES AS last_backup_bytes,
188
+
CASE status
189
+
WHEN 'COMPLETED' THEN 1
190
+
WHEN 'COMPLETED WITH WARNINGS' THEN 2
191
+
WHEN 'COMPLETED WITH ERRORS' THEN 3
192
+
WHEN 'FAILED' THEN 0
193
+
WHEN 'RUNNING WITH WARNINGS' THEN 4
194
+
WHEN 'RUNNING WITH ERRORS' THEN 5
195
+
END AS last_status
196
+
from cte
197
+
join V$RMAN_BACKUP_JOB_DETAILS bck on cte.SESSION_KEY = bck.SESSION_KEY
198
+
where cte.R_NUM = 1
199
+
200
+
201
+
# (cast( SYS_EXTRACT_UTC(FROM_TZ( cast(start_time as timestamp), 'Europe/Paris')) at time zone 'UTC' as dat
202
+
# e) - date '1970-01-01') * 86400 as utc_ts,
203
+
204
+
205
+
# select
206
+
# ((cast(start_time as timestamp with time zone) at time zone 'UTC') - date '1970-01-01') * 86400 as utc_ts,
0 commit comments