Uptime threshold question
5 February, 2021 at 12:47 pm #3790LNickParticipant
Windows 10 1909
Desktop Info Version 2.10.1
I’m trying to display the system uptime in various colors depending on how long the uptime is. I expect the color to change as the thresholds are reached.
UPTIME=interval:60,display:%1d:%2h:%3m:%4s %5,threshold1:5 1000 %Yellow%,threshold2:5 2000 %Orange%,threshold3:5 3000 %Red%
Reading the documentation I thought that thresholds worked by comparing an output (5 in this example corresponding to the 5th returned value from UPTIME, namely the total number of seconds) with the threshold value (I’m using very small values for testing purposes, I change these to test, and this example is from shortly after the test system was booted), and then finally the color variable. I have the colors set earlier in the config, and use them in other spots.
With this example I got uptime colored yellow at any time I tested. What is the proper way to accomplish this, or have I misunderstood the point of thresholds entirely?0
8 February, 2021 at 11:54 am #3795GlennKeymaster
I didn’t anticipate using three thresholds on the same value. The thresholds are evaluated in reverse order so the way to make this work is to reverse the threshold numbers but keep everything else the same.
threshold3:5 1000 %Yellow%,threshold2:5 2000 %Orange%,threshold1:5 3000 %Red%
You just taught me a new thing I didn’t know DTI could do! 🙂
- This reply was modified 2 weeks, 6 days ago by Glenn.
11 February, 2021 at 4:29 am #3797LNickParticipant
Thanks! It works exactly like I wanted!
Slight tangent (happy to make a new post if needed), do thresholds work on TEXT items? I was trying the following as a workaround for my Uptime issue, but the color never changes no matter what I set the value to.
SET=KEY:days,VALUE:3 TEXT=text:Days,display:%days%,threshold:%days% 1 %Red%
Larger tanget, can style options be set via variables, and can the style of the right hand text be adjusted independent of the left? Variables seemed to be ignored in my testing, but if they contained any of the style characters those would apply. I did not see anything in the manual that would allow adjusting the style of either side independently. If nothing like that exists, I would like to suggest it for a future enhancement.
I have to say DTI is impressive in the options available. It is really helping me out with displaying quick info on machines.0
- You must be logged in to reply to this topic.