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

   ## What's changed?
   
   This PR adds database account expiry monitoring for MySQL as part of issue 
#2757.
   
   A new `account_expiry` metric is introduced in `app-mysql.yml` that exposes:
   
   - user
   - host
   - password_lifetime
   - password_last_changed
   - password_expired
   - days_left (remaining days before expiry)
   
   This enables HertzBeat users to alert on:
   - expired accounts
   - accounts expiring in N days
   - security & credential risks
   
   
   ## Verification
   
   I validated this using real MySQL users:
   
   ```sql
   SELECT
     user,
     host,
     password_lifetime,
     password_last_changed,
     password_expired,
     IF(password_lifetime IS NULL,
        NULL,
        password_lifetime - DATEDIFF(NOW(), password_last_changed)
     ) AS days_left
   FROM mysql.user;
   ``` 
   Test users:
   
   test_expire_5 → 4 days remaining
   test_expired → expired
   
   HertzBeat UI shows the same values for Days Left and Expired flag.
   
   Screenshots attached:
   <img width="828" height="712" alt="image" 
src="https://github.com/user-attachments/assets/e89ffaff-50e0-4b80-b615-86e9e8b269a1";
 />
   <img width="1611" height="712" alt="image" 
src="https://github.com/user-attachments/assets/932d7d57-a46a-4fce-a55a-1029af8e4a15";
 />
   
   
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   - [ ]  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.
   


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