To get 2 decimal places:
LABEL {node:this:name} {node:this:bandwidth_in:%.2f}%
To get an integer:
LABEL {node:this:name} {node:this:bandwidth_in:%d}%
The %d/%f stuff is standard C/php/perl printf codes, if you happen to be familiar with those.
Different CPU's Utilization in a single web page
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Different CPU's Utilization in a single web page
Can it be rounded somehow?
For example if RRD returns 0.9 -> Can it be displayed as 1 on the weathermap?
For example if RRD returns 0.9 -> Can it be displayed as 1 on the weathermap?
Manas
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re:
Howie wrote: To get an integer:
LABEL {node:this:name} {node:this:bandwidth_in:%d}%
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Different CPU's Utilization in a single web page
Agreed. I should have been clearer.
If 1.9 is returned from RRD - and %d is used -> you get 1
with 0.9 -> you get 0.
I'd like to have 1 when its 0.9 from RRD and 2 when its 1.9
If 1.9 is returned from RRD - and %d is used -> you get 1
with 0.9 -> you get 0.
I'd like to have 1 when its 0.9 from RRD and 2 when its 1.9
Manas
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Different CPU's Utilization in a single web page
Ah, gotcha.mgupta wrote:Agreed. I should have been clearer.
If 1.9 is returned from RRD - and %d is used -> you get 1
with 0.9 -> you get 0.
I'd like to have 1 when its 0.9 from RRD and 2 when its 1.9
It's a bit hacky, but this should work: %.0f
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Different CPU's Utilization in a single web page
It worked. Thanks mate!
Although I dont understand how
Looking at this - http://www.php.net/manual/en/function.sprintf.php
:%.0f
-> Treated as floating point
-> Zero decimal places
Although I dont understand how
Looking at this - http://www.php.net/manual/en/function.sprintf.php
:%.0f
-> Treated as floating point
-> Zero decimal places
Manas
Who is online
Users browsing this forum: No registered users and 2 guests