The goal of this function is to add a colored text reflecting the status of a service.
This post is explaining how this new feature can be used.
Note: In version 2.10, a closing parenthesis ' ) ' is missing in the last line of service.conf .
If you want to use this file as a source of your customisation, remember to add to fix this issue. It is already fixed in github repositories (and future releases).
Label funtion overview
The function Label is designed to write a text highligted by a color.
Label(value, condition, text, level)This function determine if the label has to be displayed ot not base on a value (extracted by RPi-Monitor) and a condition. The label contains a text to be displayed and a level. 6 levels of labels are available with 6 differences colors:
How to use it?
The file /etc/rpimonitor/template/services.conf is showing an example of Label usage.
In this example, we monitor if the service ssh is listening on port 22 and display a label _OK_ if yes or a lable _KO_ if not.
We do the same for RPi-Monitor on port 8888 and for nginix on port 80 and 443.
No comments :
Post a Comment