Not so painless script: max of time-series


I have trouble finding documentation for paintless script.
I don't know java nor groovy. I just wanted to do a max of 3 values in a gauge.
So I will display 99% red color if one one of CPU, SWAP, DISK goes to 99%.

Anyone can help me find examples?

Thanks for your help!

I think this should work for you:

Math.max(params.swap, Math.max(params.cpu, params.disk))

Painless is a pass-through for a lot of basic java functions (like Math.max()), hence the syntax in this case :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.