Duansg opened a new pull request, #4166:
URL: https://github.com/apache/hertzbeat/pull/4166

   ## What's changed?
   
   1. After investigating, issue #4165 does not exist.
   2. However, other issues have arisen during the investigation: When 
exporting and reimporting monitoring items, `annotations`, `scheduleType`, and 
the `cronExpression` field is missing. The absence of these fields will result 
in missing task identifiers and incorrect task execution.
    
    ## Modification details
   - Add `annotations` / `scheduleType` / `cronExpression` to `MonitorDTO`. 
JSON and YAML pick them up automatically via bean reflection.
   - Add the matching columns to the Excel im/export.
      
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [ ]  I have written the necessary doc or comment.
   - [x]  I have added the necessary unit tests and all cases have passed.
   
   ## Add or update API
   
   - [ ] I have added the necessary [e2e 
tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have 
passed.
   
   > Export effect
   
   ```json
   [
     {
       "monitor": {
         "annotations": {
           "a1": "v1"
         },
         "app": "postgresql",
         "cronExpression": "0 */5 * * * ?",
         "intervals": 10,
         "labels": {
           "env": "prod",
           "key1": "val1"
         },
         "name": "test_input",
         "scheduleType": "cron",
         "status": 1
       },
       "params": [
         {
           "field": "host",
           "type": 1,
           "value": "127.0.0.1"
         },
         {
           "field": "port",
           "type": 0,
           "value": "5432"
         },
         {
           "field": "database",
           "type": 1,
           "value": "postgres"
         },
         {
           "field": "username",
           "type": 1,
           "value": "hb_expire_test"
         },
         {
           "field": "password",
           "type": 2,
           "value": "eFfcwxnlYE6y1f8QpJDjWw=="
         },
         {
           "field": "timeout",
           "type": 0,
           "value": "6000"
         },
         {
           "field": "url",
           "type": 1
         },
         {
           "field": "enableSshTunnel",
           "type": 1,
           "value": "false"
         },
         {
           "field": "sshHost",
           "type": 1
         },
         {
           "field": "sshPort",
           "type": 0,
           "value": "22"
         },
         {
           "field": "sshTimeout",
           "type": 0,
           "value": "6000"
         },
         {
           "field": "sshUsername",
           "type": 1
         },
         {
           "field": "sshPassword",
           "type": 1
         },
         {
           "field": "sshShareConnection",
           "type": 1,
           "value": "true"
         },
         {
           "field": "sshPrivateKey",
           "type": 1
         },
         {
           "field": "sshPrivateKeyPassphrase",
           "type": 1
         }
       ]
     }
   ]
   ```
   
   
   > Import effect
   
   <img width="699" height="374" alt="capcap-260620-175927" 
src="https://github.com/user-attachments/assets/cbc12a42-10c5-4273-a71a-9f6ed197047d";
 />


-- 
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