Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Mapping CPU Utilization Properly

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
Voiper99



Joined: 01 Mar 2007
Posts: 42
Location: Melbourne, Australia

PostPosted: Tue Jul 29, 2008 11:22 pm    Post subject: Mapping CPU Utilization Properly Reply with quote

Hi all, I have managed to get LABEL {node:this:bandwidth_in}% with a gauge, however, the figures I am getting are not whole integers, e.g instead of 3% I get 3.231523154%. Does anyone know how I would go about fixing this issue?

Thank you in advance.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2167
Location: United Kingdom

PostPosted: Wed Jul 30, 2008 2:25 am    Post subject: Reply with quote

First of all, why *should* they be whole integers? It's an abstract number...

Anyway, to force weathermap to display it as an integer, you do: {node:this:bandwidth_in:%d}% instead - the %d means integer, or you could have %.2f for 2 decimal places of floating point.
Back to top
Voiper99



Joined: 01 Mar 2007
Posts: 42
Location: Melbourne, Australia

PostPosted: Wed Jul 30, 2008 6:23 pm    Post subject: Reply with quote

Thanks a lot Howie, it is much appreciated. How is one to find this sort of information by themselves? I tried reading through the documentation and other threads but I couldn't see an explanation such as yours (above) anywhere.

The reason why I was wanting a whole integer is because it looks better than a massive number such as 3.231523154%

Last night I also found that %k works and gives the result to two decimal points, but I will replace the %k with %.2f as per your suggestion.

Thanks again.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2167
Location: United Kingdom

PostPosted: Thu Jul 31, 2008 3:12 am    Post subject: Reply with quote

Voiper99 wrote:
Thanks a lot Howie, it is much appreciated. How is one to find this sort of information by themselves? I tried reading through the documentation and other threads but I couldn't see an explanation such as yours (above) anywhere.

The reason why I was wanting a whole integer is because it looks better than a massive number such as 3.231523154%

Last night I also found that %k works and gives the result to two decimal points, but I will replace the %k with %.2f as per your suggestion.

Thanks again.


I found out the other day that it's not in the manual actually (it will be for 0.96), but it is discussed in quite a few threads here (although I can't find any right now ). There will be a nicer write-up of this stuff soon.

%k behaves the same as %.2f for values from 0 to 100, but it will add K,M,m,u etc to the end for larger and smaller numbers, which %.2f will not.
Back to top
Voiper99



Joined: 01 Mar 2007
Posts: 42
Location: Melbourne, Australia

PostPosted: Thu Jul 31, 2008 6:14 pm    Post subject: Reply with quote

ah ok, thanks for the info. I can't wait to see the updated documentation, I already find your application very useful so with more information on how to use it, it will only get better.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group