Hey guys,
I know Turgut Kaplanogl provided similar script before. This one does provide some additional info as well.
Lab example:
[Expert@CP-GW:0]# ./hklm_registry_health_check.sh
Starting HKLM_registry.data checks (read-only). Report: /var/log/hklm_registry_health_CP-GW_20260204_103435.log
Temp dir: /tmp/hklm_registry_health_20260204_103435
============================================================
HKLM_registry.data Health Check
Host : CP-GW
Date : Wed Feb 4 10:34:35 EST 2026
File : /opt/CPshrd-R82/registry/HKLM_registry.data
============================================================
✔ Registry File Presence ............ OK
✔ Registry Directory Access ......... OK
INFO: ls -l: -rw-rw---- 1 admin root 161419 Feb 4 10:33 /opt/CPshrd-R82/registry/HKLM_registry.data
✔ Registry File Size (>1KB) ......... OK (161419 bytes)
INFO: owner=admin group=root perm=660
✔ Registry File Owner ............... OK (admin)
INFO: lsattr: ---------------- /opt/CPshrd-R82/registry/HKLM_registry.data
✔ Corrupt Backup Detection .......... OK (none found)
INFO: Detected backup-style files:
/opt/CPshrd-R82/registry/HKLM_registry.data.BeforeLastMinorVersionFix
/opt/CPshrd-R82/registry/HKLM_registry.data.old
✔ Registry File Integrity ........... OK (no NULL bytes)
✔ Registry File Header Sanity ....... OK
INFO: file(1): data
⚠ Registry Readability .............. Unusual (file type: data)
✔ Registry Content Heuristic ........ OK (found 'CPUpdates')
✔ Registry Lock Check ............... OK (no open handles detected)
✔ Registry Access Validation ........ OK (cpprod_util -dump succeeded)
INFO: RegDump saved to: /tmp/hklm_registry_health_20260204_103435/RegDump_20260204_103435
==================== SUMMARY ====================
✔ Overall Result: HEALTHY
=================================================
[Expert@CP-GW:0]#
Best,
Andy