Win32 - Monitor running processes

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

Moderators: Moderators, Developers

Post Reply
Author
Message
argon0
Cacti User
Posts: 443
Joined: Fri Mar 12, 2004 1:22 pm

Re: Win32 - Monitor running processes

#226 Post by argon0 » Mon Mar 04, 2013 6:21 am

Phalek, you got the right thing.

If you manually choose Index Type hrSWRunName, and specify the Index Value with a running process name (e.g. sqlservr.exe) the query (and thus the graphs) work... So this MUST be a valid way to do this... but HOW do you get the data template to use this/these values?

I'm going to do some experimentation with the data template - I have an idea...
[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

#227 Post by argon0 » Mon Mar 04, 2013 6:44 am

Well.... that seems to have worked... Instead of going by the manual, which says not to touch these three fields if you change the fields to look like below... it works (or looks like it does - I haven't restarted the proc yet, so can't comment on if it works after a restart).
Proc_Data_Template_pic.PNG
View of Data Procs Template as changed by me...
Proc_Data_Template_pic.PNG (13.67 KiB) Viewed 3716 times
You get Data Sources which look like this:
Data_Source_Example_Process.PNG
Data Source seems to be missing the index type and index value fields - but these are specified in the template...
Data_Source_Example_Process.PNG (24.29 KiB) Viewed 3698 times
And creates a graph like this (zoomed in a bit as its only been running a few minutes):
Graph_Created_with_new_Data_Template.PNG
Graph created after I've changed the data Template
Graph_Created_with_new_Data_Template.PNG (23.13 KiB) Viewed 3716 times
Finally a copy of my data template ...

{editted thanks to Phalek pointing out server names!}
Attachments
cacti_data_template_snmp_-_running_process_info_editted_by_Argon0.xml
Data Template as editted by me....
(9.23 KiB) Downloaded 264 times
Last edited by argon0 on Mon Mar 04, 2013 7:25 am, edited 2 times 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

#228 Post by argon0 » Mon Mar 04, 2013 6:44 am

Interestingly this seems to have kick started my other non-working graphs as well! (Though I suspect coincidence, as I did run queries a few minutes before changing the template)... Those that rely on PID are still not working.
[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....

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

Re: Win32 - Monitor running processes

#229 Post by BSOD2600 » Mon Mar 04, 2013 1:14 pm

argon0 wrote:Well.... that seems to have worked... Instead of going by the manual, which says not to touch these three fields if you change the fields to look like below... it works (or looks like it does - I haven't restarted the proc yet, so can't comment on if it works after a restart).
Do NOT do this. You're only asking for problems.

For all Data Query templates (which includes [SNMP - Running Processes]), the correct way to create graphs is:
Devices -> select a device -> click on [Create Graphs for this Host] -> select the item(s) from each Data Query -> click Create at the bottom of the page.

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

Re: Win32 - Monitor running processes

#230 Post by argon0 » Mon Mar 04, 2013 2:21 pm

BSOD2600 wrote:
argon0 wrote:Well.... that seems to have worked... Instead of going by the manual, which says not to touch these three fields if you change the fields to look like below... it works (or looks like it does - I haven't restarted the proc yet, so can't comment on if it works after a restart).
Do NOT do this. You're only asking for problems.

For all Data Query templates (which includes [SNMP - Running Processes]), the correct way to create graphs is:
Devices -> select a device -> click on [Create Graphs for this Host] -> select the item(s) from each Data Query -> click Create at the bottom of the page.
Yes, done as in that is exactly the way I create these graphs - what I do above doesn't change that. I am using variables i.e. |query_hrSWRunName| for the index value, the index type needs to be hard coded, or it will default to the first in the list (i.e hrSWRunIndex - it seems to be alphabetical). I'm just changing stuff back at the data template - not changing the process of creating graphs - well I am - but making it so you don't have to go back and edit them after creation to get the data source working properly. Now, whether I have stored up problems for myself later on or not is another question, but I don't see how...

If those fields aren't designed to be used, why are they there?
[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....

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

Re: Win32 - Monitor running processes

#231 Post by BSOD2600 » Mon Mar 04, 2013 6:17 pm

argon0 wrote:I am using variables i.e. |query_hrSWRunName| for the index value, the index type needs to be hard coded, or it will default to the first in the list (i.e hrSWRunIndex - it seems to be alphabetical).
Something's not working properly then as

Code: Select all

   <index_order>hrSWRunName:hrSWRunIndex</index_order>
in win32_procs.xml should've made hrSWRunName the default. Just tested some new items on my installation and also ran into the same problem. I'll file a bug. It should have the process name it it:
cacti - its-sp-rx1 - procexp64.png
cacti - its-sp-rx1 - procexp64.png (22.36 KiB) Viewed 3687 times
argon0 wrote:If those fields aren't designed to be used, why are they there?
They're suppose to be used for data source and graph titles.

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

Re: Win32 - Monitor running processes

#232 Post by argon0 » Mon Mar 04, 2013 6:29 pm

Really?

OK.

Is this due to 0.8.8a Then?
[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....

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

Re: Win32 - Monitor running processes

#233 Post by BSOD2600 » Mon Mar 04, 2013 6:53 pm

argon0 wrote:Is this due to 0.8.8a Then?
I haven't created new graphs with this template for quite a while so it very well could be.

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

Re: Win32 - Monitor running processes

#234 Post by argon0 » Tue Mar 05, 2013 8:13 am

The behaviour you describe above is what I expected to happen, so was surprised when graphs broke post a service restart.... Thus the digging.
[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

#235 Post by argon0 » Tue Mar 12, 2013 5:06 am

As it currently stands I can't use these graphs.

Essentially they are fine when I set them up - either with the original template, or with my edit of it, which "hardcodes" |query_hrSWRunName| into the graph. On a restart of a service everything goes screwy though.

With my edit I end up with a load of (broken) graphs with the name HOSTNAME - Process - |query_hrSWRunName|, and (because I used Autom8 to create graphs) a loat of new HOSTNAME - Process - PROCESSNAME graphs - which work until the next restart, with the original I ended up with a load of broken HOSTNAME - Process - .... graphs.

So.... Any idea of a fix to the "bug"? So I can go back to the original graphs?
[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....

User avatar
phalek
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Win32 - Monitor running processes

#236 Post by phalek » Tue Mar 12, 2013 5:36 am

Maybe something like this template would be sufficient for you ( to get availability ) in the first place ?

I'm using it for the service availability calculations in my reporting plugin.

http://forums.cacti.net/viewtopic.php?f ... &start=135
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

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

Re: Win32 - Monitor running processes

#237 Post by argon0 » Tue Mar 12, 2013 9:43 am

I'm monitoring Services fine, its when I try to do Processes that the problem happens...
[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....

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

Re: Win32 - Monitor running processes

#238 Post by BSOD2600 » Tue Mar 12, 2013 5:33 pm

argon0 wrote:As it currently stands I can't use these graphs.
1) dont use automate for this template, as it doesnt work properly.
2) the reindex method should be index count changed for this data query.
3) the data template for each device's instance needs manual updating until the bug gets fixed. Index Value should be the process executable (i.e. spoolsv.exe) and Index Type should be hrSWRunName.
argon0 wrote:So.... Any idea of a fix to the "bug"? So I can go back to the original graphs?
bug the developers to look into http://bugs.cacti.net/view.php?id=2350 I suppose.

JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Win32 - Monitor running processes

#239 Post by JJX » Tue Jul 26, 2016 9:15 am

I have two processes with the same name.
I match the first process with the name; the 2nd one with the PID.

This is the graph of the 2nd process, matched with the PID:
A.png
A.png (69.18 KiB) Viewed 1945 times
The top graph is the one appearing to the Graph tree; it doesn't depict the memory.
However, the realtime graphs shows the memory.

Any idea why this happens?
cacti rulez!

JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Win32 - Monitor running processes

#240 Post by JJX » Mon Aug 01, 2016 2:02 am

After deleting the rrd file and running again the poller the problem was resolved
cacti rulez!

Post Reply