Page 1 of 1

Windows process memory check

Posted: Tue Dec 17, 2019 4:18 pm
by paul.omalley
Hello!
I have some users that want to check Windows process memory usage.
For example, they have a process named "nautilus.exe". They want to alert if memory usage falls below 10MB.

Can check_ncpa "processes" module do this? Or does it require a custom plugin for NCPA?

Thanks,
Paul

Re: Windows process memory check

Posted: Tue Dec 17, 2019 5:30 pm
by mbellerue
Right now NCPA only checks for processes that are using too much memory. It's not very often we get people worried about a process using too little memory. :)

But that's not to say that we can't do this. It will just require a couple of twists and turns.

First, let's have NCPA identify the process.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H remoteserverIP -t 'ASecretToken' -M 'processes' -c 0 -u M -q 'name=nautilus.exe,mem_rss=10'
That will find any instances of nautilus.exe running that is using 10MB or more of memory. If it finds even 1 instance, it will throw a critical. This may look like the exact opposite of what you want to do, and it is. So let's turn it around using the negate plugin.

negate is a wonderful plugin that can change up the status of checks, so we can make CRITICALs OKs, and OKs CRITICALs.

Code: Select all

/usr/local/nagios/libexec/negate --ok=CRITICAL --critical=OK --substitute /usr/local/nagios/libexec/check_ncpa.py -H remoteserverIP -t 'ASecretToken' -M 'processes' -c 0 -u M -q 'name=nautilus.exe,mem_rss=10'
Give that a shot, and let me know if that works out for you. You should then be able to build a command in XI out of that.