This is an automated email from the ASF dual-hosted git repository.

liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c39b98eaa [feature] Add privateKey passphrase config for linux 
monitor (#2982)
5c39b98eaa is described below

commit 5c39b98eaa2f2d00842f0a91a3cf212ae7e1f195
Author: Sherlock Yin <sherlock.yin1...@gmail.com>
AuthorDate: Fri Jan 17 22:05:14 2025 +0800

    [feature] Add privateKey passphrase config for linux monitor (#2982)
    
    Co-authored-by: yinyijun <yinyij...@mgtv.com>
    Co-authored-by: tomsun28 <tomsu...@outlook.com>
    Co-authored-by: aias00 <rok...@163.com>
---
 .../collector/collect/ssh/SshCollectImpl.java      |  9 ++++++++-
 .../common/entity/job/protocol/SshProtocol.java    |  5 +++++
 .../src/main/resources/define/app-almalinux.yml    | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-centos.yml       | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-coreos.yml       | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-debian.yml       | 20 ++++++++++++++++++++
 .../src/main/resources/define/app-euleros.yml      | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-freebsd.yml      | 19 +++++++++++++++++++
 .../src/main/resources/define/app-linux.yml        | 20 ++++++++++++++++++++
 .../src/main/resources/define/app-opensuse.yml     | 20 ++++++++++++++++++++
 .../src/main/resources/define/app-redhat.yml       | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-rockylinux.yml   | 21 +++++++++++++++++++++
 .../src/main/resources/define/app-ubuntu.yml       | 22 ++++++++++++++++++++++
 13 files changed, 240 insertions(+), 1 deletion(-)

diff --git 
a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/ssh/SshCollectImpl.java
 
b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/ssh/SshCollectImpl.java
index 0cce85ddbc..7fef3762f6 100644
--- 
a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/ssh/SshCollectImpl.java
+++ 
b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/ssh/SshCollectImpl.java
@@ -56,6 +56,7 @@ import org.apache.sshd.client.channel.ClientChannelEvent;
 import org.apache.sshd.client.session.ClientSession;
 import org.apache.sshd.common.SshException;
 import org.apache.sshd.common.channel.exception.SshChannelOpenException;
+import org.apache.sshd.common.config.keys.FilePasswordProvider;
 import org.apache.sshd.common.util.io.output.NoCloseOutputStream;
 import org.apache.sshd.common.util.security.SecurityUtils;
 import org.springframework.util.StringUtils;
@@ -322,7 +323,13 @@ public class SshCollectImpl extends AbstractCollect {
             clientSession.addPasswordIdentity(sshProtocol.getPassword());
         } else if (StringUtils.hasText(sshProtocol.getPrivateKey())) {
             var resourceKey = 
PrivateKeyUtils.writePrivateKey(sshProtocol.getHost(), 
sshProtocol.getPrivateKey());
-            SecurityUtils.loadKeyPairIdentities(null, () -> resourceKey, new 
FileInputStream(resourceKey), null)
+            FilePasswordProvider passwordProvider = (session, resource, index) 
-> {
+                if 
(StringUtils.hasText(sshProtocol.getPrivateKeyPassphrase())) {
+                    return sshProtocol.getPrivateKeyPassphrase();
+                }
+                return null;
+            };
+            SecurityUtils.loadKeyPairIdentities(null, () -> resourceKey, new 
FileInputStream(resourceKey), passwordProvider)
                     .forEach(clientSession::addPublicKeyIdentity);
         }  // else auth with localhost private public key certificates
 
diff --git 
a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SshProtocol.java
 
b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SshProtocol.java
index 7ba4cf4cd0..5c2e9c3365 100644
--- 
a/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SshProtocol.java
+++ 
b/hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SshProtocol.java
@@ -60,6 +60,11 @@ public class SshProtocol implements CommonRequestProtocol, 
Protocol {
      * Private key (optional)
      */
     private String privateKey;
+
+    /**
+     * private key passphrase (optional)
+     */
+    private String privateKeyPassphrase;
     
     /**
      * reuse connection session
diff --git a/hertzbeat-manager/src/main/resources/define/app-almalinux.yml 
b/hertzbeat-manager/src/main/resources/define/app-almalinux.yml
index 53e167f780..b10d0ffdd0 100644
--- a/hertzbeat-manager/src/main/resources/define/app-almalinux.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-almalinux.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-centos.yml 
b/hertzbeat-manager/src/main/resources/define/app-centos.yml
index f9544b36c6..f374d6c515 100644
--- a/hertzbeat-manager/src/main/resources/define/app-centos.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-centos.yml
@@ -116,6 +116,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -159,6 +171,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -227,6 +241,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -294,6 +309,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -338,6 +354,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -377,6 +394,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {gsub(":", "", $1); print 
$1,$2,$10}'
@@ -424,6 +442,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -465,6 +484,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -506,6 +526,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-coreos.yml 
b/hertzbeat-manager/src/main/resources/define/app-coreos.yml
index 92b2d336b0..fb3f827fa6 100644
--- a/hertzbeat-manager/src/main/resources/define/app-coreos.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-coreos.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-debian.yml 
b/hertzbeat-manager/src/main/resources/define/app-debian.yml
index 678fe46ba1..0a84e1069d 100644
--- a/hertzbeat-manager/src/main/resources/define/app-debian.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-debian.yml
@@ -115,6 +115,17 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +169,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +239,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +307,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +352,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +392,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +440,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +482,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps --no-headers -eo pid,%cpu,%mem,cmd --sort=-%cpu | head -n 10 
| awk 'BEGIN {print "pid cpu_usage mem_usage command"} {print $1, $2, $3, $4}'
@@ -505,6 +524,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps --no-headers -eo pid,%cpu,%mem,cmd --sort=-%mem | head -n 10 
| awk 'BEGIN {print "pid cpu_usage mem_usage command"} {print $1, $2, $3, $4}'
diff --git a/hertzbeat-manager/src/main/resources/define/app-euleros.yml 
b/hertzbeat-manager/src/main/resources/define/app-euleros.yml
index 5f5d0163fc..b0993db733 100644
--- a/hertzbeat-manager/src/main/resources/define/app-euleros.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-euleros.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-freebsd.yml 
b/hertzbeat-manager/src/main/resources/define/app-freebsd.yml
index 9a32d11b20..16624bbbcf 100644
--- a/hertzbeat-manager/src/main/resources/define/app-freebsd.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-freebsd.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -227,6 +241,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "dmesg | grep -i cpu | awk 'NR==1';sysctl hw.ncpu | awk '{print 
$2}';uptime | sed 's/,/ /g' | awk '{for(i=NF-2;i<=NF;i++)print $i }' | 
xargs;vmstat 1 1 | awk 'NR==3{print $11}';vmstat 1 1 | awk 'NR==3{print 
$12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -291,6 +306,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: sysctl hw | egrep 'hw.(phys|user|real)' | awk '{print $2}';dmesg 
| grep memory | grep avail | awk '{print $4}';
@@ -338,6 +354,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -379,6 +396,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -420,6 +438,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-linux.yml 
b/hertzbeat-manager/src/main/resources/define/app-linux.yml
index 3c7f96033f..f92a5dbf22 100644
--- a/hertzbeat-manager/src/main/resources/define/app-linux.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-linux.yml
@@ -115,6 +115,17 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +169,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +239,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +307,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +352,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +392,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +440,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +482,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +524,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-opensuse.yml 
b/hertzbeat-manager/src/main/resources/define/app-opensuse.yml
index 4a885478e6..ec081d1904 100644
--- a/hertzbeat-manager/src/main/resources/define/app-opensuse.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-opensuse.yml
@@ -115,6 +115,17 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +169,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +239,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +307,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +352,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +392,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +440,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +482,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +524,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-redhat.yml 
b/hertzbeat-manager/src/main/resources/define/app-redhat.yml
index 0ac7fbc5f3..1b6749a67d 100644
--- a/hertzbeat-manager/src/main/resources/define/app-redhat.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-redhat.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-rockylinux.yml 
b/hertzbeat-manager/src/main/resources/define/app-rockylinux.yml
index eb52b1dd94..9ee2b37bd1 100644
--- a/hertzbeat-manager/src/main/resources/define/app-rockylinux.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-rockylinux.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '/Model name/ {print $2}' | awk 
'NR==1';awk '/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 
's/,/ /g' | awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 
'NR==3{print $11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 
'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
diff --git a/hertzbeat-manager/src/main/resources/define/app-ubuntu.yml 
b/hertzbeat-manager/src/main/resources/define/app-ubuntu.yml
index eee22cadb8..b3230779a9 100644
--- a/hertzbeat-manager/src/main/resources/define/app-ubuntu.yml
+++ b/hertzbeat-manager/src/main/resources/define/app-ubuntu.yml
@@ -115,6 +115,18 @@ params:
     required: false
     # hide param-true or false
     hide: true
+  # field-param field key
+  - field: privateKeyPassphrase
+    # name-param field display i18n name
+    name:
+      zh-CN: 密钥短语
+      en-US: PrivateKey PassPhrase
+    # type-param field type(most mapping the html input type)
+    type: password
+    # required-true or false
+    required: false
+    # hide param-true or false
+    hide: true
 # collect metrics config list
 metrics:
   # metrics - basic, inner monitoring metrics (responseTime - response time)
@@ -158,6 +170,8 @@ metrics:
       password: ^_^password^_^
       # ssh private key
       privateKey: ^_^privateKey^_^
+      # ssh private key passphrase
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       # ssh run collect script
@@ -226,6 +240,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: "LANG=C lscpu | awk -F: '$1==\"Model name\" {print $2}';awk 
'/processor/{core++} END{print core}' /proc/cpuinfo;uptime | sed 's/,/ /g' | 
awk '{for(i=NF-2;i<=NF;i++)print $i }' | xargs;vmstat 1 1 | awk 'NR==3{print 
$11}';vmstat 1 1 | awk 'NR==3{print $12}';vmstat 1 2 | awk 'NR==4{print $15}'"
@@ -293,6 +308,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: free -m | awk 'BEGIN{print "total used free buff_cache 
available"} NR==2{print $2,$3,$4,$6,$7}'
@@ -337,6 +353,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print 
$1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print 
$9}';vmstat 1 1 | awk 'NR==3{print $16}'
@@ -376,6 +393,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print 
"interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
@@ -423,6 +441,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used 
available usage mounted"} {print $1,$3,$4,$5,$6}'
@@ -464,6 +483,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -505,6 +525,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage 
command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf 
"%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
@@ -530,6 +551,7 @@ metrics:
       username: ^_^username^_^
       password: ^_^password^_^
       privateKey: ^_^privateKey^_^
+      privateKeyPassphrase: ^_^privateKeyPassphrase^_^
       timeout: ^_^timeout^_^
       reuseConnection: ^_^reuseConnection^_^
       script: sensors | grep "^Core\s[0-9\d+\:]" | awk  '{print $3}'  | sed 
"s/°C/\ /g" | awk '{ total += $1; count++ } END { print total/count }'


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org
For additional commands, e-mail: notifications-h...@hertzbeat.apache.org

Reply via email to