[solved] monitoring Processes by name not PID

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
bigturk
Posts: 37
Joined: Wed Sep 02, 2009 4:45 pm

[solved] monitoring Processes by name not PID

Post by bigturk »

Hello all, right now i have graphing signal processes, the graphs are nice the data looks good. BUT when a processes restarts for some reason or the system reboots the graph is no good, and that is because it works via PID and not process name. does anyone know of a data queries that work off process names and not PID's?
any help would be great.
thanks
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Created years ago. Searching the template repository and/or script forum will assist your quest.

http://docs.cacti.net/usertemplate:data ... ib:process
bigturk
Posts: 37
Joined: Wed Sep 02, 2009 4:45 pm

Post by bigturk »

thank you for your reply and i think i found your readme from another post about this same thing.
you posted in step 7.
By default, the index type will use "hrSWRunIndex, and i will need to change it to "hrSWRunName. then type in the exe name.
the only place i see hrSWRunName is in the title under Graph fields.
and where should i type in the exe. any help would be great thank you every every much.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You don't type in the exe name anywhere. Once the data query has been added to a device, click on the 'create graphs for this host' link. Then from the list of processes, select it and click create.
bigturk
Posts: 37
Joined: Wed Sep 02, 2009 4:45 pm

Post by bigturk »

I'm able to get the graph up and running its when the process gets a new PID(restarts) the graph becomes useless. I have tried different combination's but no luck.
HERE is the how to:

Graph a processes CPU and memory usage on a Win32 Host.
Created by BSOD2600

1. Import all the templates.
2. copy win32_procs.xml to <cactiroot>\resource\snmp_queries\
3. Add the data query 'SNMP - Running Processes' with Re-inxed method 'Index Count Changed'. This has worked fine for me, but you might need to use 'Verify all fields'
4. Click on 'Create Graphs for this Host'. You should see a list of all the running processes on the remote computer, simular to running_procs_graph.png. Click the ones you want to graph.
5. Go to your Data Sources and open up each process you created.
6. I'd change the RRA name to something more distinct and readable (i.e. computer_proc_processname_1.rra)
7. By default, the index type will use 'hrSWRunIndex'. This number is the same as the PID in process manager. You want to change it to use 'hrSWRunName' for each process. Type in the executables name (i.e. winamp.exe). You can find the name at top of the screen for the process you're working on (i.e. computername - process - processname). It you do not change it to use the processes name, soon as your restart restart an process, its PID changes and Cacti will no longer be able to graph it! Don't forget to save the changes.
8. That should be it to make it work!

Having issues with step 7.
Thank you again for your help.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Hmm old instructions I should update.

Basically, cacti will only reindex / update the PID of the processes if the number of them change between polling cycles. If you want to force it to do it every polling cycle regardless if its needed or not, then change the reindex method to Verify All Fields.
bigturk
Posts: 37
Joined: Wed Sep 02, 2009 4:45 pm

Post by bigturk »

thank you for your help and replies.
i found the area where i need to edit. under data sources, find the process graph and in the index value field type in the process name and in the index type change it to hrSWRunName and save changes. noticed that if the process goes down and gets a new PID which 99.999% of the time will,it take about 10-15 minutes before it refreshes and it continues graphing.

once again thank you for your help and support.
sebish
Posts: 7
Joined: Wed May 23, 2012 7:22 am

Re: [solved] monitoring Processes by name not PID

Post by sebish »

I have exact the same problem at the moment, but my server os is unix (ubuntu).

I need to monitor the services (processes) to see if specific tasks are up and running.
I now know i need to use the hrSWRunName table, but when the server restarts the oids (pids) change my graphs will crash.

Did you get it to work? And does a script for this exist for unix os and net-snmp?
nescio
Posts: 7
Joined: Tue Aug 28, 2012 5:26 am

Re: [solved] monitoring Processes by name not PID

Post by nescio »

Is this data template work in Cacti 0.8.8a as well? As I tried, It directlly gave the error (red) below

09/10/2012 10:40:32 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1054', SQL:"UPDATE graph_templates_graph SET name='|host_description| - Process - |query_hrSWRunName|' WHERE local_graph_id=161'
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: [solved] monitoring Processes by name not PID

Post by BSOD2600 »

Yes, it does.

Does the cacti technical support page show any issues?
Any other errors in cacti.log?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests