Duansg commented on code in PR #4131:
URL: https://github.com/apache/hertzbeat/pull/4131#discussion_r3295789151


##########
hertzbeat-manager/src/main/resources/define/app-postgresql.yml:
##########
@@ -1076,3 +1076,95 @@ metrics:
         privateKey: ^_^sshPrivateKey^_^
         privateKeyPassphrase: ^_^sshPrivateKeyPassphrase^_^
         shareConnection: ^_^sshShareConnection^_^
+
+  - name: users
+    i18n:
+      zh-CN: 用户信息
+      en-US: Users
+      ja-JP: ユーザー情報
+    priority: 16
+    fields:
+      - field: usename
+        type: 1
+        label: true
+        i18n:
+          zh-CN: 用户名
+          en-US: User Name
+          ja-JP: ユーザー名
+      - field: usesysid
+        type: 0
+        i18n:
+          zh-CN: 用户ID
+          en-US: User ID
+          ja-JP: ユーザーID
+      - field: usecreatedb
+        type: 1
+        i18n:
+          zh-CN: 创建数据库权限
+          en-US: Create DB Privilege
+          ja-JP: データベース作成権限
+      - field: usesuper
+        type: 1
+        i18n:
+          zh-CN: 超级用户权限
+          en-US: Superuser Privilege
+          ja-JP: スーパーユーザー権限
+      - field: valuntil
+        type: 1
+        i18n:
+          zh-CN: 密码有效期
+          en-US: Password Valid Until
+          ja-JP: パスワード有効期限
+      - field: days_left
+        type: 0
+        i18n:
+          zh-CN: 剩余天数
+          en-US: Days Left
+          ja-JP: 残り日数
+      - field: account_status
+        type: 1
+        i18n:
+          zh-CN: 账号状态
+          en-US: Account Status
+          ja-JP: アカウントのステータス
+    protocol: jdbc
+    jdbc:
+      host: ^_^host^_^
+      port: ^_^port^_^
+      timeout: ^_^timeout^_^
+      platform: postgresql
+      username: ^_^username^_^
+      password: ^_^password^_^
+      database: ^_^database^_^
+      queryType: multiRow
+      sql: |
+        SELECT
+          rolname AS usename,
+          oid AS usesysid,
+          CASE WHEN rolcreatedb THEN 'Y' ELSE 'N' END as usecreatedb,
+          CASE WHEN rolsuper THEN 'Y' ELSE 'N' END as usesuper,
+          rolvaliduntil AS valuntil,
+          CASE
+            WHEN rolvaliduntil IS NULL THEN NULL

Review Comment:
   I have found that PostgreSQL's special time semantics, such as `infinity`, 
are not currently supported. If this configuration is present, it may cause an 
exception to be thrown.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to