shell prompt that shows coloured ceph status

kmonti

New Member
Aug 15, 2024
8
1
3
I created simple prompt that shows coloured ceph status and you can include in your ~/.bashrc:
Bash:
ceph_status() { ceph health | awk '/HEALTH_OK/ {print "\033[32m" $0 "\033[0m"}; /HEALTH_ERR/ {print "\033[31m" $0 "\033[0m"}; /HEALTH_WARN/ {print "\033[33m" $0 "\033[0m"}'; }
PS1='$(ceph_status)\n[\u@\h \W]\$ '


It will show status in:
green if HEALTH__OK
red if HEALTH_ERR
yellow if HEALTH_WARN

as shown on attachment.
 

Attachments

  • Zrzut ekranu z 2024-08-25 13-19-07.png
    Zrzut ekranu z 2024-08-25 13-19-07.png
    20.2 KB · Views: 9
  • Like
Reactions: waltar
Luckily this was just a shell prompt test in picture with 6 daemon recently crashed ... but nice idea :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!