Cacti WMI Graph for 64 Processors - Issue

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
jborg
Posts: 9
Joined: Mon Sep 07, 2015 3:26 am

Cacti WMI Graph for 64 Processors - Issue

Post by jborg »

Hi All,
I'm using the excellent WMI templates and scripts at http://svn.parkingdenied.com/CactiWMI/t ... _-_all.xml. That said, I need a CPU template capable of graphing 64 CPUs. since this wasn't readily available, I made copies of the existing graph and data templates for graphing a lower amount of CPUs and started building on this.

So far I've built a graph template (with associated data templates and input methods) capable of graphing 37 CPUs and deciced to try it out.

The problem is that I'm only getting a graph that graphs till processor number 28. Above that, the processor data remains '-nan'. Further digging revealed the following output in the cacti log file:

09/07/2015 10:12:07 AM - SPINE: Poller[0] Host[32] TH[1] DS[802] SCRIPT: /usr/bin/php -q /www/scripts/wmi.php -h 'host_server_foo' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfFormattedData_PerfOS_Processor' -n '' -k '' -v '' -c 'PercentProcessorTime', output: Name0:_Total PercentProcessorTime0:1 Name1:0 PercentProcessorTime1:6 Name2:1 PercentProcessorTime2:0 Name3:10 PercentProcessorTime3:0 Name4:11 PercentProcessorTime4:0 Name5:12 PercentProcessorTime5:0 Name6:13 Pe entProcessorTime6:0 Name7:14 PercentProcessorTime7:0 Name8:15 PercentProcessorTime8:0 Name9:16 PercentProcessorTimâ–½0 Name10:17 PercentProcessorTime10:0 Name11:18 PercentProcessorTime11:0 Name12:19 PercentProcessorTime12:0 Name13:2 PercentProcessorTime13:6 Name14:20 PercentProcessorTime14:0 Name15:21 PercentProcessorTime15:0 Name16:22 PercentProcessorTime16:0 Name17:23 PercentProcessorTime17:0 Name18:24 PercentProcessorTime18:0 Name19:25 PercentProcessorTime19:0 Name20:26 PercentProcessorTime20:0 Name21:27 PercentProcessorTime21:0 Name22:28 PercentProcessorTime22:0 Name23:29 PercentProcessorTime23:0 Name24:3 PercentProcessorTime24:0 Name25:30 PercentProcessorTime25:0 Name26:31 PercentProcessorTime26:0 Name27:32 PercentProcessorTime27:0 Name28:33 PercentProcessorTime28:0 Name29:34

The log above would seem to indicate that the data for processors above CPU28 is not being return. However, I then ran the command manually:

[root@cacti ~]# /usr/bin/php -q /www/scripts/wmi.php -h 'host_server_foo' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfFormattedData_PerfOS_Processor' -n '' -k '' -v '' -c 'PercentProcessorTime'
PHP Notice: Undefined variable: condition_key in /var/lib/cacti/scripts/wmi.php on line 119
PHP Notice: Undefined variable: condition_val in /var/lib/cacti/scripts/wmi.php on line 119
Name0:_Total PercentProcessorTime0:2 Name1:0 PercentProcessorTime1:7 Name2:1 PercentProcessorTime2:0 Name3:10 PercentProcessorTime3:0 Name4:11 PercentProcessorTime4:0 Name5:12 PercentProcessorTime5:0 Name6:13 PercentProcessorTime6:0 Name7:14 PercentProcessorTime7:0 Name8:15 PercentProcessorTime8:0 Name9:16 PercentProcessorTime9:13 Name10:17 PercentProcessorTime10:0 Name11:18 PercentProcessorTime11:0 Name12:19 PercentProcessorTime12:0 Name13:2 PercentProcessorTime13:19 Name14:20 PercentProcessorTime14:0 Name15:21 PercentProcessorTime15:0 Name16:22 PercentProcessorTime16:0 Name17:23 PercentProcessorTime17:0 Name18:24 PercentProcessorTime18:0 Name19:25 PercentProcessorTime19:0 Name20:26 PercentProcessorTime20:0 Name21:27 PercentProcessorTime21:0 Name22:28 PercentProcessorTime22:0 Name23:29 PercentProcessorTime23:0 Name24:3 PercentProcessorTime24:7 Name25:30 PercentProcessorTime25:0 Name26:31 PercentProcessorTime26:0 Name27:32 PercentProcessorTime27:7 Name28:33 PercentProcessorTime28:7 Name29:34 PercentProcessorTime29:7 Name30:35 PercentProcessorTime30:0 Name31:36 PercentProcessorTime31:7 Name32:37 PercentProcessorTime32:0 Name33:38 PercentProcessorTime33:7 Name34:39 PercentProcessorTime34:0 Name35:4 PercentProcessorTime35:0 Name36:40 PercentProcessorTime36:0 Name37:41 PercentProcessorTime37:0 Name38:42 PercentProcessorTime38:0 Name39:43 PercentProcessorTime39:0 Name40:44 PercentProcessorTime40:0 Name41:45 PercentProcessorTime41:0 Name42:46 PercentProcessorTime42:0 Name43:47 PercentProcessorTime43:0 Name44:48 PercentProcessorTime44:0 Name45:49 PercentProcessorTime45:7 Name46:5 PercentProcessorTime46:0 Name47:50 PercentProcessorTime47:0 Name48:51 PercentProcessorTime48:0 Name49:52 PercentProcessorTime49:13 Name50:53 PercentProcessorTime50:0 Name51:54 PercentProcessorTime51:0 Name52:55 PercentProcessorTime52:0 Name53:56 PercentProcessorTime53:0 Name54:57 PercentProcessorTime54:0 Name55:58 PercentProcessorTime55:0 Name56:59 PercentProcessorTime56:0 Name57:6 PercentProcessorTime57:0 Name58:60 PercentProcessorTime58:0 Name59:61 PercentProcessorTime59:0 Name60:62 PercentProcessorTime60:0 Name61:63 PercentProcessorTime61:0 Name62:7 PercentProcessorTime62:0 Name63:8 PercentProcessorTime63:0 Name64:9 PercentProcessorTime64:0

...and the data for all 64 processors is being returned. It would therefore seem that the data is being somehow lost when parsed by the php script/cacti. Any ideas what the issue could be?

Thanks,

Joe
ps. If I get it to work, I'll share the templates for this since it's quite a pain creating a template for 64 processors :-)
jborg
Posts: 9
Joined: Mon Sep 07, 2015 3:26 am

Re: Cacti WMI Graph for 64 Processors - Issue

Post by jborg »

Just a minor update on this. I'm using Cacti 0.8.8b but Spine 0.8.8f.

I'm starting to suspect that this has to do with buffer size being malloced in spine. BUFSIZE seems to be defined as 1024 in spine.h and the truncated output shown in the log file is 1014 characters (pretty close). Is anyone more familiar with the Spine C code to confirm this and, if so, is there any clean way around this? In spine.h, several other buffer sizes are defined (e.g. BIG_BUFSIZE) so I'm not sure if there's a compilation switch or anything of the sort I could use to enlarge the buffers.

Thanks,

Joe
jborg
Posts: 9
Joined: Mon Sep 07, 2015 3:26 am

Re: Cacti WMI Graph for 64 Processors - Issue

Post by jborg »

Came across this thread: http://forums.cacti.net/viewtopic.php?f=2&t=51851 and, sure enough, re-compiling with ./configure --with-results-buffer=4096 seems to have done the trick. Thought I'd reply for completeness - just in case anyone else comes across this issue.

Joe
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests