Win32 - Monitor running processes

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

Moderators: Developers, Moderators

Post Reply
b3nw
Posts: 5
Joined: Thu Jul 16, 2009 3:13 pm

Post by b3nw »

I have 6-7 servers with graphs created. I just added the processor page, and when I try to select any of the processes it lists, it throws the error. But for example, interface statistics, mounted partitions, all map fine. I've not had any issues until I tried to add a graph for this script/template

as for versions, standard debian 5.0 stable, i'll have to get the exact versions first thing tomorrow morning.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Hmm, odd. The devices generating those errors are Windows boxes?
b3nw
Posts: 5
Joined: Thu Jul 16, 2009 3:13 pm

Post by b3nw »

yes, windows 2000 server.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

The verbose query and/or manual snmpwalk of .1.3.6.1.2.1.25.4.2.1 returns correct data for that problem device?
intenso
Posts: 19
Joined: Mon Oct 17, 2005 5:50 am
Location: Germany
Contact:

Post by intenso »

hi,

my problem:

if i close the monitored program (like iexplore.exe) and restart it the mem/cpu line on the graph stops forever.

in the data source i have changed the "index type" from "hrSWRunIndex" to "hrSWRunName". on the "index value" field i removed the pid and write the proces name.
but cacti ignored it. in the cacti log file the oid for this proces will be never changed or updated to the new pid.

cacti Log:
09/16/2009 02:50:25 PM - SPINE: Poller[0] Host[126] DS[2214] SNMP: v1: 192.168.10.35, dsname: proc_mem, oid: .1.3.6.1.2.1.25.5.1.1.2.1336, value: U

(1336 is the old PID)


can anyone help me please?

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

Post by BSOD2600 »

Until cacti runs another reindex for the 'running process info' query, it'll still have the old/invalid PID of the process. You have two options:

1) leave the Reindex method for 'SNMP - Running Processes' as 'Index Count Changed' -- then whenever the number of processes changes from its current number, cacti will invoke a reindex and the graph will work again.
2) Change the reindex method to Verify all fields.
intenso
Posts: 19
Joined: Mon Oct 17, 2005 5:50 am
Location: Germany
Contact:

Post by intenso »

hi,

thanks for your answer and sorry for my english...

1. the "Index Count Changed" method is my actual method.

2. i have changed the "re-indexed method" to "verify all fields".
if i stop and start my proces the pid is still the old in cacti.

then if i go to the device and klick on the "verbose query" button, cacti re-indexed the pid-map and i see the correct pid for my proces.

but this is an unusfull "handjob" to do this on every time if a proces restarts...

how reindexed cacti automatic? why doesnt work it?

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

Post by BSOD2600 »

Not sure what you've done to mess up the script for your install... I know that for me, if I close the process being monitored (say trillian.exe) the current process count drops from 41 to 40. If cacti polls the server during that time, it'll notice the different in processes and issue a reindex. Now, if during that same 5 minute time window, I launch another process so the process count is STILL 41, cacti will NOT issue a reindex, even though there are now different processes/PIDs. As stated earlier, the only way around this is to use the Verify all fields option.

Look through your cacti log file while in debug mode during a polling cycle. Find the Data Source (DS ##) for this query and track what cacti does. Why does/doesn't it do a reindex?
intenso
Posts: 19
Joined: Mon Oct 17, 2005 5:50 am
Location: Germany
Contact:

Post by intenso »

hi,

ok, i have changed the cacti default "reindex method for Data Queries" to "Verify All Fields" and now it works :)

thanks for help.
User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

Post by pirx »

nice template and it even works with net-snmp linux clients. At least on my debian lenny systems with net-snmp 5.4.1.
jpipitone
Posts: 19
Joined: Tue Nov 06, 2007 11:41 am

Post by jpipitone »

I am using this great template to keep an eye on w3wp.exe memory usage.

We have multiple application pools which each spawn their own instance of w3wp.exe. When I add all of these processes, they each have w3wp.exe as the label.

Is there a way to name these graphs individually so I know which application pool (Pool_sitename) is associated with each w3wp.exe process?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

SNMP doesn't expose this info. You'll need a WMI script instead to handle the app pools
adrianzzs
Posts: 4
Joined: Mon Nov 15, 2010 9:39 am

Re: Win32 - Monitor running processes

Post by adrianzzs »

hello BSOD2600
your script is very useful !

still, there is any way to have the datasources automatically configured by hrSWRunName with the correct index value, for example explorer.exe instead of hrSWRunIndex with the PID ?

I want this because I want to monitor a lot of services but when they restart, a new PID is generated and the only way that re-index works is if I have hrSWRunName with the correct service name in Index Value field.

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

Re: Win32 - Monitor running processes

Post by BSOD2600 »

It should be using the process name by default...
adrianzzs
Posts: 4
Joined: Mon Nov 15, 2010 9:39 am

Re: Win32 - Monitor running processes

Post by adrianzzs »

hello
Thank you for your answer, but I don't think you understood me

so I have my host, and I click on create graphs for this host
Image

I also have the data queries for my host "SNMP Running Processes" with Index count changed for reindex method:
Image

Then I will select the process that I want to monitor (explorer.exe) and hit the create button
Image

Next I'll have the possibility to give the name to my graph, by default it's Hostname Process + hrSWRunName (I'm not referring to this in my previous post) I dont have a problem with the name of the graph
Image

Now If I go to my device and select the datasource that was just created
Image

I'll see the following screen:
Image

Now here I have a problem ! I want this to be automatically with
hrSWRunName in the Index Type field and not hrSWRunIndex
and
the correct process name in the Index Value field and not the PID value.

Do you think it's possible to have that ?
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests