Process Performance Counters

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

Moderators: Developers, Moderators

Post Reply
Helmut Schneider
Cacti User
Posts: 151
Joined: Mon Feb 05, 2007 3:57 am
Location: Munich, Germany

Process Performance Counters

Post by Helmut Schneider »

Hi,

I didn't find a template that queries processes

- For Windows, *ix and VMWare (works only partially as CPU ticks do not increase. But I was only able to test "free" version of ESXi)
- Sums up CPU and Memory of all occurrences of a process (no duplicates)
- Calculates the Ticks in relation to the CPU count
- Shows CPU and Memory in a single graph "readable"
- 1-Minute Polling

so I created my own one (0.8.8a):
Screenshot_httpd.jpg
Screenshot_httpd.jpg (41.51 KiB) Viewed 2312 times
Screenshot_svchost.exe.jpg
Screenshot_svchost.exe.jpg (39.24 KiB) Viewed 2312 times
While "It works for me" suggestions and comments are very welcome.

(At least) one issue I currently still encounter:

I want to draw a line at the graph maximum and base the CPU graph related to it (e.g. The Maximum is 500MB then 100% CPU should be graphed as 500MB; I used a "hack" for that but I'm not happy with it and wondering if there is a better solution:
CDEF fur CPU Graph: cdef=|99:bytes:3:all_max_peak:2|,99,/,CURRENT_DATA_SOURCE,*
And the line for max: HRULE: |99:bytes:3:all_max_peak:2|

Can I use "all_max_peak" in a CDEF? Or is there another was to put a line on the graph maximum?

Thanks, Helmut

PS: When I have some time left I'll post an SNMP version.
Attachments
Templates.zip
(5.02 KiB) Downloaded 113 times
process_performance_counters.tgz
(2.47 KiB) Downloaded 158 times
Last edited by Helmut Schneider on Tue Feb 11, 2014 4:54 pm, edited 2 times in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Process Performance Counters

Post by BSOD2600 »

This template (which pulls from HOST-RESOURCES-MIB) was created 8 years ago - http://forums.cacti.net/viewtopic.php?t=6661 . This one is more efficient than yours since it's just SNMP and doesnt require the php script server to be launched.
Helmut Schneider
Cacti User
Posts: 151
Joined: Mon Feb 05, 2007 3:57 am
Location: Munich, Germany

Re: Process Performance Counters

Post by Helmut Schneider »

As far as I read
- For Windows, *ix and VMWare (works only partially as CPU ticks do not increase. But I was only able to test "free" version of ESXi)
It's for Windows only
- Sums up CPU and Memory of all occurrences of a process (no duplicates)
Shows each process individually where I wanted the Total.
- Calculates the Ticks in relation to the CPU count
It shows > 100% on SMP systems.
- Shows CPU and Memory in a single graph "readable"
When one value is much lower than the other one it gets very hard to read.

If I'm wrong in any of these points please correct me.
This one is more efficient than yours since it's just SNMP and doesnt require the php script server to be launched.
If there is a more efficient way to calculate with SNMP values (e.g. sum up memory of all instances of 'httpd'. Or divide the sum of all cpu ticks of all instances of 'httpd' by the # of cpus) please let me know.

It was fun anyway to create the template.
brent20
Posts: 1
Joined: Wed Feb 05, 2014 1:05 am

Re: Process Performance Counters

Post by brent20 »

Hi Hulmut,
I can't thank you enough for this script, this is exactly what i've been looking for!
Could you please post the associated templates with it? (data/graph/etc)
I've imported the php script and XML file, but I can't seem to get anything to work and it looks like I need to build the templates by hand and I keep getting stuck.
Any help would be greatly appreciated!
Thanks so much!
colifa
Posts: 6
Joined: Wed Oct 29, 2014 11:06 am

Re: Process Performance Counters

Post by colifa »

Hello Helmut, Brian,

Can you please provide me with some information regarding the Custom Data section when a new graph is created based on this template?
More specifically, Index Type, Index Value, and Output Type ID.
I have been using the process name with its extension in Index Value, with the other two empty, and do not get any information (likely a mistake).

Is there any other configuration step needed? I was checking the log to see if the script was running, but I did not see any call to it. Of course both the script and the query were copied to the server.

Thank you,

Pablo
Hanseat
Posts: 17
Joined: Thu Sep 27, 2012 5:24 am

Re: Process Performance Counters

Post by Hanseat »

Hi all,

thanks, Helmut, for the nice graphs. You just missed exporting your "data query" template, hence some questions came up about how to use them.
If you have a look at how the "old" SNMP process queries are setup you can easily recreate your own data query with Helmuts templates.

Adding SNMP-queries for your graphs would make a huge difference; particular for medium to large sized Cacti installations :).

Cheers from Hamburg!


Edit: adding 7 graphs with the php script (which is not using php-script-server) adds about 12 seconds to my overall polling time.
IF I got the time, I just might look into SNMPing this thing mysqlf :).
colifa
Posts: 6
Joined: Wed Oct 29, 2014 11:06 am

Re: Process Performance Counters

Post by colifa »

Hello Hanseat!

Thanks so much for your pointer, it was exactly what I needed, as I did not consider the use of a data query.
I have created one, and it is showing results as expected, so it is attached to my message in case it can help someone else. I am not an expert, so probably the OP should review it. That said, it works when used together with the other templates in this post.

Thanks again!

Pablo
Attachments
cacti_data_query_php_-_process_performance_counters.xml
(1.64 KiB) Downloaded 119 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests