Custom thresholds for progress bars


I’m new to LibreNMS, and I’ve recently been tasked with finding a way to set custom thresholds for the progress bars on the health and device pages. By default LibreNMS will use the get_percentage_colours($percentage) function in librenms/html/includes/ to determine what colors to give the progress bar on these pages.

I am trying to come up with a way to override these values depending on the device/configuration. For example, we monitor some devices with drives that are 2TB+ and automatically remove files after a certain point. We also have devices that can reach 80-90% memory utilization without using much swap space. I know it probably goes against rational, but reaching 90% full threshold on some of our components is common and not much reason for concern.

I am trying to find an elegant way to define a custom “red” progress bar thresholds. I found I can pull the ‘storage_perc_warn’ number from the ‘storage’ table for our storage devices. This was a small win, but I’ve found there isn’t a similar field for processors or mempools. Does anyone have a suggestion on how to design around this problem? Would this feature useful to anyone else?

Thanks in advance,

1 Like

Someone else asked for a similar thing and I think without putting a _perc_warn into mysql then anything else will be a hack. Is this something your going to tackle?

I was thinking the same thing, and I’d rather not have a hack on my hands. This is my first time touching LibreNMS code, but I’d be glad to implement this feature and contribute it, if it’s something the community feels could be useful.

1 Like

Definitely a good idea. I’ll help as I can, but you know I’m not the best at PHP.