Incorrect values when graphing CPU % Usage in Weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Incorrect values when graphing CPU % Usage in Weathermap

Post by ikorzha758 »

Howie, I have noticed for a long time that when I graph CPU usage in Weathermap my values are about 10.5-11% off of what Cacti reporting on the graph.
I'm not sure is the problem with the way I "plot" the CPU usage on the map or is it a bug? I use Weathermap .98DEV

Here is Graph debug:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1354703342 \
--end=1354717742 \
--title='JC VPN 3060 - CPU Usage' \
--rigid \
--base=1000 \
--height=300 \
--width=600 \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 2012/12/05 05\:29\:02 To 2012/12/05 09\:29\:02\c" \
COMMENT:" \n" \
--vertical-label='percent' \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd":'vpn5min_cpu':AVERAGE \
AREA:a#ED5394FF:"CPU Usage" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf"



Here is Weathermap Config for CPU node:
NODE JC_VPN_3060_CPU
LABEL CPU {node:this:inpercent:%.1f}%
LABELFONT 110
INFOURL /graph.php?rra_id=all&local_graph_id=10749
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=10749
TARGET gauge:/var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd:vpn5min_cpu:-
USESCALE ping in percent
POSITION JC_VPN_3060_PRI 0 43

______________________________________________________________________________________________________________

If I'm plotting it incorrectly can you give an example what the weathermap config for that node should look like?
Thank you in advance for your input.
Attachments
Same Cacti CPU graph
Same Cacti CPU graph
graph.jpg (196.02 KiB) Viewed 3286 times
Weathermap CPU PLOT
Weathermap CPU PLOT
CPU.jpg (13.38 KiB) Viewed 3286 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Incorrect values when graphing CPU % Usage in Weathermap

Post by Howie »

Can you run with debug logging for a poller cycle? You'll get a lot of information about what Weathermap is getting from the rrd file (look for lines with ReadData in them)

The config looks OK to me, as long as the default node doesn't have a MAXVALUE line in it... (you are using percentages, so they are based on the maxvalue. The default maxvalue is 100, so that'll work, but if it's not still 100, things will go strange)
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!)
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Re: Incorrect values when graphing CPU % Usage in Weathermap

Post by ikorzha758 »

Here is what I found so far using debug mode as you suggested as it pertains to this node hoping you can make sense of what has been posted below :lol: :
I want to point out that this error in calculation is not exclusive to this node, I saw same problem when I try to plot CISCO switches and routers CPU usage. Which would suggest others might experience the same problem, just they are not careful enough to notice error in calculation.



12/05/2012 11:49:18 AM - WEATHERMAP: Poller[0] DEBUG: [CopyFrom@WeatherMapNode.class.php:736][Map 38] iso-segments-fw-map.conf: Initialising NODE JC_VPN_3060_CPU from DEFAULT
12/05/2012 11:49:18 AM - WEATHERMAP: Poller[0] DEBUG: [ReadConfig_Handle_TARGET@Weathermap.class.php:3491][Map 38] iso-segments-fw-map.conf: TARGET: gauge:/var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd:vpn5min_cpu:-

12/05/2012 11:49:18 AM - WEATHERMAP: Poller[0] DEBUG: [ReadConfig@Weathermap.class.php:4165][Map 38] iso-segments-fw-map.conf: Setting bandwidth on NODE JC_VPN_3060_CPU (110 -> 110 bps, 110 -> 110 bps, KILO = 1000)


12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2113][Map 38] iso-segments-fw-map.conf: ReadData for NODE JC_VPN_3060_CPU:
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2121][Map 38] iso-segments-fw-map.conf: ReadData: New Target: gauge:/var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd:vpn5min_cpu:-
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@WeatherMapDataSource_rrd.php:532][Map 38] iso-segments-fw-map.conf: Special DS names seen (vpn5min_cpu and -).
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@WeatherMapDataSource_rrd.php:549][Map 38] iso-segments-fw-map.conf: SCALING result by 1
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@WeatherMapDataSource_rrd.php:595][Map 38] iso-segments-fw-map.conf: Going to try poller_output, as requested.
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:64][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output style
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:73][Map 38] iso-segments-fw-map.conf: ******************************************************************
Checking weathermap_data
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:79][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - looking for 0 value
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:83][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - DS name is vpn5min_cpu
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:141][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - found weathermap_data row
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:148][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - data looks valid
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [UpdateCactiData@ds-common.php:8][Map 38] iso-segments-fw-map.conf: fetching for 10867
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note cacti_graph_id='10749' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:79][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - looking for 1 value
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:181][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - DS name is '-'
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:193][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output: Returning (52, NULL, 1354726143)
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [wmrrd_read_from_poller_output@WeatherMapDataSource_rrd.php:194][Map 38] iso-segments-fw-map.conf: RRD ReadData: poller_output - ended
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@WeatherMapDataSource_rrd.php:656][Map 38] iso-segments-fw-map.conf: RRDTool ReadData: Returning (52, NULL, 1354726143)
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2178][Map 38] iso-segments-fw-map.conf: Aggregate so far: 52 0
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2193][Map 38] iso-segments-fw-map.conf: DataTime MINMAX: 1354726142 -> 1354726149
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2200][Map 38] iso-segments-fw-map.conf: ReadData complete for NODE JC_VPN_3060_CPU: 52 0
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ColourFromValue@Weathermap.class.php:2579][Map 38] iso-segments-fw-map.conf: CFV JC_VPN_3060_CPU ping 47.272727272727 '' 40_50 0 192 255
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ColourFromValue@Weathermap.class.php:2579][Map 38] iso-segments-fw-map.conf: CFV JC_VPN_3060_CPU ping 0 '' 0_0 190 190 190
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note inscalekey='40_50' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note outscalekey='0_0' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note inscaletag='' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note outscaletag='' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note inscalecolor='#00c0ff' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [add_note@Weathermap.class.php:1254][Map 38] iso-segments-fw-map.conf: Adding note outscalecolor='#bebebe' to JC_VPN_3060_CPU
12/05/2012 11:49:21 AM - WEATHERMAP: Poller[0] DEBUG: [ReadData@Weathermap.class.php:2273][Map 38] iso-segments-fw-map.conf: ReadData: Setting 52,0


12/05/2012 11:50:02 AM - WEATHERMAP: Poller[0] WM poller_output: Looking for /var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd (10867) (<path_rra>/jc_vpn_3060_test_vpn5min_cpu_10867.rrd)

12/05/2012 11:50:02 AM - WEATHERMAP: Poller[0] WM poller_output: Got one! /var/www/html/rra/jc_vpn_3060_test_vpn5min_cpu_10867.rrd:vpn5min_cpu -> 1354726202 37
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Incorrect values when graphing CPU % Usage in Weathermap

Post by Howie »

12/05/2012 11:49:18 AM - WEATHERMAP: Poller[0] DEBUG: [ReadConfig@Weathermap.class.php:4165][Map 38] iso-segments-fw-map.conf: Setting bandwidth on NODE JC_VPN_3060_CPU (110 -> 110 bps, 110 -> 110 bps, KILO = 1000)

As I said before - you are using the inpercent value in your label...

So here's the calculation that happens:
1) You set MAXVALUE to 110.
2) You fetch a CPU usage value between 0 and 100.
3) Weathermap puts that value into bandwidth_in
4) Weathermap calculations a percentage usage, based on the MAXVALUE: (52/110)*100 -> 47.2% which goes into inpercent

So either set the MAXVALUE to the actual maximum (100, which is the default), or use bandwidth_in instead.
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!)
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Re: Incorrect values when graphing CPU % Usage in Weathermap

Post by ikorzha758 »

Howie, now that you have "spelled it out" I went back to the config file and saw that I did define a MAXVALUE of 110 early in my weathermap carrier. It was done originally to combat the problem of grey links when the value exceeded 100... I guess back than I didn't know what I was doing half of the time.

Wow I'm very impressed with your troubleshooting skills. Thank you so much. I have corrected the 110 to 100. And now everything is correct.
voyager
Posts: 21
Joined: Sat Jun 14, 2014 11:01 am

Re: Incorrect values when graphing CPU % Usage in Weathermap

Post by voyager »

I was also facing this issue and resolved after consulting this page.

Thanks to everybody who contributed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest