|
|
| Author |
Message |
Voiper99
Joined: 01 Mar 2007 Posts: 41 Location: Melbourne, Australia
|
Posted: Tue Jul 29, 2008 11:22 pm Post subject: Mapping CPU Utilization Properly |
|
|
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: 1989 Location: United Kingdom
|
Posted: Wed Jul 30, 2008 2:25 am Post subject: |
|
|
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: 41 Location: Melbourne, Australia
|
Posted: Wed Jul 30, 2008 6:23 pm Post subject: |
|
|
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: 1989 Location: United Kingdom
|
Posted: Thu Jul 31, 2008 3:12 am Post subject: |
|
|
| 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: 41 Location: Melbourne, Australia
|
Posted: Thu Jul 31, 2008 6:14 pm Post subject: |
|
|
| 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 |
|
 |
|