how to monitor the memory size in use of a winserver process

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

how to monitor the memory size in use of a winserver process

Post by h4doukeeN »

Hello, after looking for some plugins I have not been able to add to monitoring the monitoring of a specific process in MB. I want to receive a "warning" and "critical" alert to a certain amount of megas consumed. Can someone help me?

for example that process I want to monitor and inform me alerts to a certain amount of megas consumed

Image

I hope you can help me please
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: how to monitor the memory size in use of a winserver pro

Post by cdienger »

NCAP can be used for this:

https://www.nagios.org/ncpa/getting-started.php

A check to monitor the spoolsv.exe process and alert when memory usage is 80 and 90MB would look like:

./check_ncpa.py -H client_ip -t '<your token>' -M 'processes' -w 80 -c 90 -u M -q 'name=spoolsv.exe'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the memory size in use of a winserver pro

Post by h4doukeeN »

cdienger wrote:NCAP can be used for this:

https://www.nagios.org/ncpa/getting-started.php

A check to monitor the spoolsv.exe process and alert when memory usage is 80 and 90MB would look like:

./check_ncpa.py -H client_ip -t '<your token>' -M 'processes' -w 80 -c 90 -u M -q 'name=spoolsv.exe'
forgive my ignorance, but to bring this to "define services (check_command ?????" in the cfg as it should be. Besides adding in "commands.cfg" the define commands? Attentive. Thank you
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: how to monitor the memory size in use of a winserver pro

Post by mcapra »

The official documentation has some steps for configuring Nagios Core to interact with NCPA on a Windows machine:
https://assets.nagios.com/downloads/nag ... ndows.html
Former Nagios employee
https://www.mcapra.com/
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the memory size in use of a winserver pro

Post by h4doukeeN »

I have another question ... what do you mean by mytoken TOKEN ??
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: how to monitor the memory size in use of a winserver pro

Post by lmiltchev »

The token is like a password or community string (in SNMP). It is used to authenticate when accessing the API. It is defined in the ncpa.cfg file. You can read more about NCPA and how to configure it here:

https://www.nagios.org/ncpa/help.php#configuration

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the memory size in use of a winserver pro

Post by h4doukeeN »

Thanks for the help

Code: Select all

#######  commands.cfg #####

#  'check_ncpa.py' definicion de comando
define command{
         command_name    check_ncpa
         command_line    $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
        }

######## windows.cfg  #####


define service{
        use                     generic-service
        host_name               01-Sv-10.30
        service_description     Consumo Spooler
        check_command           check_ncpa!-t public -P 5693 -M memory/virtual -q name=spoolsv.exe -u M -w 450 -c 650
        check_interval          0.1
        retry_interval          1
        notification_interval   1
        max_check_attempts      1
        }
Image
Last edited by tmcdonald on Mon Feb 19, 2018 10:48 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: how to monitor the memory size in use of a winserver pro

Post by lmiltchev »

I am glad I could help!

You check is working now, so all you need to do is adjust the warning and critical thresholds to fit your needs, and restart nagios, so that changes can take effect.

One thing I noticed though - in your service definition, you have check_interval = 0.1, which means that you would like this check to run every 6 seconds! Do you really want to do this? Having a check run on a less than 1 min interval is not a good idea. This will put an extra load to the system with almost no added benefit. I would recommend that you don't use decimals, when defining the check_interval, retry_interval, and notification_interval.

Let us if you have any more questions, and if it is ok to lock this topic. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the memory size in use of a winserver pro

Post by h4doukeeN »

Hi, thanks for the check_interval I'm clear about that, but even so I need that to be in "almost" real time. In my company the IT department adapted a logistics software for sales and it is a real disgust the worst thing I have seen in my life so I am analyzing each cpu upload in real time and other details that can contribute to the solution (the only solution that I see in me is that the company hires real computer hahaha). Please close the thread, I am very grateful for your help a hug to the distance ...
lmiltchev wrote:I am glad I could help!

You check is working now, so all you need to do is adjust the warning and critical thresholds to fit your needs, and restart nagios, so that changes can take effect.

One thing I noticed though - in your service definition, you have check_interval = 0.1, which means that you would like this check to run every 6 seconds! Do you really want to do this? Having a check run on a less than 1 min interval is not a good idea. This will put an extra load to the system with almost no added benefit. I would recommend that you don't use decimals, when defining the check_interval, retry_interval, and notification_interval.

Let us if you have any more questions, and if it is ok to lock this topic. Thank you!
Locked