mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[monitoring-template] feat(mysql): add database account expiry metrics (#3969)
Co-authored-by: Logic <zqr10159@dromara.org> Co-authored-by: Duansg <siguoduan@gmail.com>
This commit is contained in:
co-authored by
Logic
Duansg
parent
8962253dd2
commit
4b010e6523
@@ -1178,3 +1178,69 @@ metrics:
|
||||
privateKey: ^_^sshPrivateKey^_^
|
||||
privateKeyPassphrase: ^_^sshPrivateKeyPassphrase^_^
|
||||
shareConnection: ^_^sshShareConnection^_^
|
||||
- name: account_expiry
|
||||
priority: 100
|
||||
i18n:
|
||||
zh-CN: 数据库账号有效期
|
||||
en-US: Account Expiry
|
||||
ja-JP: アカウント有効期限
|
||||
fields:
|
||||
- field: user
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 用户
|
||||
en-US: User
|
||||
ja-JP: ユーザー
|
||||
- field: host
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 主机
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: days_left
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 剩余天数
|
||||
en-US: Days Left
|
||||
ja-JP: 残り日数
|
||||
- field: password_expired
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 是否已过期
|
||||
en-US: Password Expired
|
||||
ja-JP: 期限切れ
|
||||
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
platform: mysql
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
database: mysql
|
||||
timeout: ^_^timeout^_^
|
||||
queryType: multiRow
|
||||
sql: |
|
||||
SELECT
|
||||
user,
|
||||
host,
|
||||
IF(password_lifetime IS NULL,
|
||||
NULL,
|
||||
password_lifetime - DATEDIFF(NOW(), password_last_changed)
|
||||
) AS days_left,
|
||||
password_expired
|
||||
FROM mysql.user;
|
||||
url: ^_^url^_^
|
||||
sshTunnel:
|
||||
enable: ^_^enableSshTunnel^_^
|
||||
host: ^_^sshHost^_^
|
||||
port: ^_^sshPort^_^
|
||||
timeout: ^_^sshTimeout^_^
|
||||
username: ^_^sshUsername^_^
|
||||
password: ^_^sshPassword^_^
|
||||
privateKey: ^_^sshPrivateKey^_^
|
||||
privateKeyPassphrase: ^_^sshPrivateKeyPassphrase^_^
|
||||
shareConnection: ^_^sshShareConnection^_^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user