Page 1 of 1

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

Posted: Wed Feb 14, 2018 10:36 am
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

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

Posted: Wed Feb 14, 2018 5:49 pm
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'

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

Posted: Thu Feb 15, 2018 2:28 pm
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

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

Posted: Thu Feb 15, 2018 4:20 pm
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

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

Posted: Thu Feb 15, 2018 5:02 pm
by h4doukeeN
I have another question ... what do you mean by mytoken TOKEN ??

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

Posted: Thu Feb 15, 2018 5:16 pm
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.

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

Posted: Mon Feb 19, 2018 9:18 am
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

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

Posted: Mon Feb 19, 2018 3:26 pm
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!

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

Posted: Mon Feb 19, 2018 3:41 pm
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!