Win32 - Monitor running processes

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

Moderators: Moderators, Developers

Post Reply
Author
Message
adrianzzs
Posts: 4
Joined: Mon Nov 15, 2010 9:39 am

Re: Win32 - Monitor running processes

#196 Post by adrianzzs » Wed Dec 01, 2010 3:14 pm

hello, still waiting for you answer if there's any.

And I have another question: can I make it work with \Process()\% Processor Time ? and not with CPU load for every service that is running?

Thank you in advance.

Wikky
Posts: 1
Joined: Thu Dec 02, 2010 9:13 am

Re: Win32 - Monitor running processes

#197 Post by Wikky » Thu Dec 02, 2010 9:35 am

hrSWRunName - Field Length ?

Is there a way to modify the |query_hrSWRunName| to capture more than 15 characters? It's not a problem when capturing processes one-by-one and making note of which rrd they are, then modifying the field afterwards, but it's a real pain to create a bunch of new graphs all at once then figure out which on is which.

Our naming conventions are:
11CharaName.Services.UniqueName

The Data Query Template displays the full key, however the Data Source list and Graph list simply truncate.

Thanks,
Your *new* Friendly Neighborhood Cacti User

\Wikky/

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Win32 - Monitor running processes

#198 Post by BSOD2600 » Thu Dec 02, 2010 12:37 pm

adrianzzs: That would be a WMI query. There are various wrapper scripts on the forum or try this: http://docs.cacti.net/usertemplate:data ... s:typeperf

Wikky: If all the name appears in a snmpwalk, then cacti is simply truncating it during display. Check Settings -> Visual and increase the lengths as needed.

adrianzzs
Posts: 4
Joined: Mon Nov 15, 2010 9:39 am

Re: Win32 - Monitor running processes

#199 Post by adrianzzs » Fri Sep 02, 2011 4:28 am

Hello BSOD2600
I found out that this template (Win32 - Monitor running processes) does not take into consideration the number of cores.
example: for a server with 24 cores the real CPU usage for a process is 0.1% but this template reports 2.4%.
So i had to create a new CDEF function to divide by 24 in a new graph template in order for my graphs to report the correct values.

can it be updated so that it can take into consideration the number of cores an report correctly the percent usage for a process?

thank you,
Adrian

noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Win32 - Monitor running processes

#200 Post by noname » Fri Sep 02, 2011 5:08 am

adrianzzs wrote: I found out that this template (Win32 - Monitor running processes) does not take into consideration the number of cores.
example: for a server with 24 cores the real CPU usage for a process is 0.1% but this template reports 2.4%.
So i had to create a new CDEF function to divide by 24 in a new graph template in order for my graphs to report the correct values.
Just FYI:

hrSWRunPerfCPU (.1.3.6.1.2.1.25.5.1.1.1)
The number of centi-seconds of the total system's CPU resources consumed by this process.
Note that on a multi-processor system, this value may increment by more than one centi-second in one centi-second of real (wall clock) time.
Probably to adapt to multi-processor/multi-core machines, it needs to get information (by using SNMP?) about "how many processors/cores do you have".


P.S.
ssCpuRawUser (.1.3.6.1.4.1.2021.11.50) on NET-SNMP has also similar specifications.
- http://www.net-snmp.org/docs/mibs/ucdavis.html#ssCpuRawUser

User avatar
spyd4r
Posts: 29
Joined: Wed Sep 09, 2009 11:48 am
Location: Waterloo, Ontario

Re: Win32 - Monitor running processes

#201 Post by spyd4r » Wed Jan 11, 2012 10:39 am

I am using this and it's working great, but i have 1 question.

Is there a way to stack the data from the 5 processes I am monitoring with this as 1 graph using stack, instead of 5 individual graphs?

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Win32 - Monitor running processes

#202 Post by BSOD2600 » Wed Jan 11, 2012 1:25 pm

spyd4r wrote:Is there a way to stack the data from the 5 processes I am monitoring with this as 1 graph using stack, instead of 5 individual graphs?
Could use the aggregate plugin to create it.

Netcooler
Cacti User
Posts: 127
Joined: Thu Dec 24, 2009 9:08 am

Re: Win32 - Monitor running processes

#203 Post by Netcooler » Tue Mar 20, 2012 12:52 pm

I am attemping to graph 2 processes with the same name but different PIDS.

My Re-Index Method is Validate All fields

It appears that when I am graphing these with the same name (i.e CMS.exe) Cacti chooses one or the other and i am not graphing both

I added |query_hrSWRunIndex| to my title and I see the PID value change there from one PID to the Other PID back and forth and don't know which one I am actually getting.

Is this because the data source is using the name (CMS.exe) as the Index and not the Run Index? Because of how that can change?

Am I overlooking something obvious?

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Win32 - Monitor running processes

#204 Post by BSOD2600 » Tue Mar 20, 2012 4:46 pm

It's really best practice to profile by process name and not the PID, because it can change so often. However, as you've found out when using the name, Cacti is only able to collect data from the "first" instance (I believe with the lowest PID). Short of using a plugin (like hmib or writing something similar), I'm not aware of any way to concurrently track multiple same-named processes. How would you even able to keep them straight between instances?

Netcooler
Cacti User
Posts: 127
Joined: Thu Dec 24, 2009 9:08 am

Re: Win32 - Monitor running processes

#205 Post by Netcooler » Wed Mar 21, 2012 12:04 pm

BSOD thanks for the reply - I agree as well and figured it was due tpo the index on Name (which is why it is noce because if it restarts on a new PID you still have the graphing).

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#206 Post by argon0 » Thu Feb 14, 2013 8:18 am

BSOD: Multiple Processes with same name... The only way I can think of doing it would be to rename the exes, then you'd be cool (I think we did this with SQL exes at my last place).

My graphs using this are showing some odd CPU usage - see below (I've only been running it a few minutes, so have zoomed in).
graph_image_info01_System_Idle_Proc.png
graph_image_info01_System_Idle_Proc.png (31.82 KiB) Viewed 2487 times
graph_image_info01_System_Idle_Proc.png
graph_image_info01_System_Idle_Proc.png (31.82 KiB) Viewed 2487 times
System Idle is showing peak at 600+ SAV is showing peak at almost 100

This server is a VM running with 4 cores, so even if we divide that by 4 we get over 150 for proc...

What is cpu actually measuring?
Attachments
graph_image_info01_SavService.png
graph_image_info01_SavService.png (22.89 KiB) Viewed 2487 times
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#207 Post by argon0 » Thu Feb 14, 2013 8:31 am

:oops:. I've put the same image in twice. But doesn't matter...

Just checked out the data template, noticed the data source type is set to counter..

From: http://docs.cacti.net/manual:087:3_temp ... a_template
A COUNTER is for continuously incrementing values that might overflow, e.g. ifInOctets (Traffic).

CPU should surely be a Gauge (as you've got Memory set ...)

A GAUGE is for numbers that are not continuously incrementing, e.g. a temperature.

Gauge is what the Host MIB - CPU Utilization data template uses...

Will try with Gauge and report back.
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#208 Post by argon0 » Thu Feb 14, 2013 8:34 am

(though how you get a data template to cascade down to the graphs that rely on it I DON'T know - you don't see the link I posted earlier - you need to create new graphs with this data template..)
Last edited by argon0 on Thu Feb 14, 2013 11:20 am, edited 1 time in total.
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#209 Post by argon0 » Thu Feb 14, 2013 10:51 am

OK, so I've been a tad hasty in my previous posts, using Getif I can see that the OID being queried (.1.3.6.1.2.1.25.5.1.1.1) has the description:
The number of centi-seconds of the total system's
CPU resources consumed by this process. Note that
on a multi-processor system, this value may
increment by more than one centi-second in one
centi-second of real (wall clock) time.
So, presumably what is being graphed is the number of centiseconds (or, looking at my system idle time graph, seconds?) of the total system's CPU resources being consumed by this process in the last measurement period (i.e. 5 minutes?)... Should we divide this by 300 or 60 to give number of centiseconds being used per second (OK this would give a higher number on multi proc systems - but we can get that number from snmp...(OID - .1.3.6.1.2.1.25.3.3.1.2) which gives a table with one line per processor....

Hmmm.. needs thinking about - will leave as it is for the moment...

BSOD - any ideas?
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#210 Post by argon0 » Thu Feb 14, 2013 11:46 am

First off - sorry for rambling/going on a bit - just trying to understand what these graphs are showing me/us....

OK, another weirdity about this when I zoom in I get higher (MAX) values for shorter periods of time... Ah.. but its doing average isn't it so a MAX average over 5 minutes could be lower than a MAX average over a minute, which is the smallest granularity...

Looking at my most granular graphs - I can see that Sys idle peaks at 1100 (seconds or Centiseconds?) per minute(?)

So first divide 1100/60 = 18.333. Then divide by 4 (number of procs) = 4.58 seconds/second? Which can't be right... Until you think...

If its doing it per 5 minutes, and take a look at the period around that peak ... I can see that there is a peak of 1100 for 1 minute, surrounded, on the both future and past sides by 2 minute plateaus of ~40 so add them up you get ~ 1200 total.... So divide that by 300 (seconds in 5 minutes)=~ 4. Divide this by number of processors gives ~ 1...

The only problem with this is there is another peak of ~ 1100 both in the minute previous to the past plateau and in the minute post plateau - which kind of puts the "bell curve" being a 3 minute one with 1100 peak, which wrecks the above calculations completely. (i.e. 1200/(180*4) = 1.67 s/s, but if 1200 isn't the total (but as System Idle is not the whole story and if we could find another 240 seconds of CPU time in 3 minutes... - this would give 2s/s but...... <ack>)

Looking at the same machine in task manager directly on the system - sys idle process ends up using 4 seconds of CPU time per second... and it has 4 cpus... so over 5 minutes it should use 1200 seconds of CPU time (ish) it is also using 99% of the CPU at most times.

Oh, and the daily graphs say 5 minute average....
[size=50]No longer a n00by but[/size] not yet an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....

Post Reply