Uptime threshold qu...
 
Notifications
Clear all

We had a major storm through here recently and we suffered damage to the house roof and ceilings. I just received the quote to repair. I’m hoping that a small fraction of the 80,000 odd people that download SDIO and/or Desktop Info every month won’t mind chipping in a few dollars to help out. Click on the big blue button at the bottom of the page to help us keep a roof over our heads, literally!

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.

Uptime threshold question

4 Posts
2 Users
0 Reactions
297 Views
(@lnick)
New Member Registered
Joined: 4 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?


   
Quote
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1501
 

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! 🙂


   
ReplyQuote
(@lnick)
New Member Registered
Joined: 4 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.


   
ReplyQuote
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1501
 

I'll have to check that one out.

There is a single style for the item.


   
ReplyQuote
Glenn's Page