check_winprocess

7 posts / 0 new
Last post
fucand
Offline
Last seen: 8 years 5 months ago
Joined: 31.03.2015 - 22:31
check_winprocess

Hello,

i'am using the great Nagios Plugin check_winprocess. I need some Performance Data and i don't know if it is possible

1. The Amount of consume Memory by an single Process

2. The Amount of consume CPU usage by an single Process

Is it possible.

Thanks a lot

Regards

Andreas

itefix
Offline
Last seen: 2 hours 52 min ago
Joined: 01.05.2008 - 21:33
check_winprocess is primarily

check_winprocess is primarily about the number of processes qualifying against a set of criteria. It produces also performance data. However, it is not designed to report/monitor internal performance metrics for a process. Some WMI output is probably required for that purpose. You can use our check_wmic for that purpose. Example:

 

check_wmic -H localhost --alias "process where (name='process.exe')" --property workingsetsize --format "Working set size: %d|'working set size'=%d"

 

gets the WorkingSetSize value for the process process.exe and produces performance data as well:

OK - Working set size: 132481024|'working set size'=132481024

List of WMI attributes available for a process (output from wmic process get /?):

CSName
CommandLine
Description
ExecutablePath
ExecutionState
Handle
HandleCount
InstallDate
KernelModeTime
MaximumWorkingSetSize
MinimumWorkingSetSize
Name
OSName
OtherOperationCount
OtherTransferCount
PageFaults
PageFileUsage
ParentProcessId
PeakPageFileUsage
PeakVirtualSize
PeakWorkingSetSize
Priority
PrivatePageCount
ProcessId
QuotaNonPagedPoolUsage
QuotaPagedPoolUsage
QuotaPeakNonPagedPoolUsage
QuotaPeakPagedPoolUsage
ReadOperationCount
ReadTransferCount
SessionId
Status
TerminationDate
ThreadCount
UserModeTime
VirtualSize
WindowsVersion
WorkingSetSize
WriteOperationCount
WriteTransferCount
fucand
Offline
Last seen: 8 years 5 months ago
Joined: 31.03.2015 - 22:31
ok, thanks. I check it on

ok, thanks. I check it on Commandline and it works. Now i on Holidays. After this i will integrate it in Nagios after this i will contact you. Thanks a lot for your work.

fucand
Offline
Last seen: 8 years 5 months ago
Joined: 31.03.2015 - 22:31
Hello, now i'am back. the

Hello, now i'am back.

the command does not work from the nagios server

command

/usr/local/nagios/libexec/check_nrpe -H ip -n -c 'check_wmic' -a '-H localhost --alias "process where (name=''sqlservr.exe'')" --property workingsetsize --format "Working set size: %d|''working set size''=%d"'

nsclient++ log

2015-04-15 12:30:59: debug:NSClient++.cpp:1034: Injecting: check_wmic: -H localhost --alias "process where (name=sqlservr.exe)" --property workingsetsize --format "Working set size: %d|working set size=%d"

i think the ' is not transport to the nsclient++. how can i do this?

Regards

Andreas

itefix
Offline
Last seen: 2 hours 52 min ago
Joined: 01.05.2008 - 21:33
To make it work, you need to

To make it work, you need to define some Nagios configuration elements - Have a look at our Nagwin usage example here.

 

 

 

fucand
Offline
Last seen: 8 years 5 months ago
Joined: 31.03.2015 - 22:31
i use nsclient++ on a windows

i use nsclient++ on a windows maschine. the command in nsclient.ini looks so

check_wmic = C:\Programme\NSClient++\scripts\check_wmic.exe --H localhost --alias "process where (name='sqlservr.exe')" --property workingsetsize --format "Working set size: %d|'working set size'=%d"

in the cmd box on the windows maschine it looks fine

C:\Programme\NSClient++>C:\Programme\NSClient++\scripts\check_wmic.exe --H local
host --alias "process where (name='sqlservr.exe')" --property workingsetsize --f
ormat "Working set size: %d|'working set size'=%d"
OK - Working set size: 1744502784|'working set size'=1744502784

on my nagiosserver i try this

/usr/local/nagios/libexec/check_nrpe -H ip from windowsserver -n -c check_wmic

The log from nsclient++ on the windows maschine says

2015-04-16 12:33:21: debug:D:\source\042\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:254: Command line: C:\Programme\NSClient++\scripts\check_wmic.exe --H localhost --alias "process where (name='sqlservr.exe')" --property workingsetsize --format "Working set size: %d|'working set size'=%d"

2015-04-16 12:35:16: error:D:\source\042\nscp\include\socket/connection.hpp:147: Failed to send data: Das angegebene Dateihandle ist ungültig

itefix
Offline
Last seen: 2 hours 52 min ago
Joined: 01.05.2008 - 21:33
Problem seems to be NSClient

Problem seems to be NSClient actually. What I can only say that the account running check_wmic (NSClient service account) needs to have privileges to run WMI. Being member of local administrators should help. But, again, you can get a better and more qualified answer at NSClient forums. 

Release news