Uptime threshold qu...
 
Notifications
Clear all

We appreciate the contributions many of you have been able to make towards repairing the storm damage and keeping a roof over our heads. With your help weโ€™ve been able to complete much of the critical work. There is still work to be done to secure the house and your continued support will be a huge help.

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Closed] Uptime threshold question

4 Posts
2 Users
0 Reactions
1,487 Views
(@lnick)
New Member Registered
Joined: 5 years ago
Posts: 2
Topic starter  

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?


   
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1899
 

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! ๐Ÿ™‚


   
(@lnick)
New Member Registered
Joined: 5 years ago
Posts: 2
Topic starter  

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.


   
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1899
 

I'll have to check that one out.

There is a single style for the item.


   
Glenn's Page