how to monitor the total number of processes in windows

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.
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

how to monitor the total number of processes in windows

Post by h4doukeeN »

Hi,

I would like to see how to monitor the total of processes in windows, for example by default in localhost comes check_local_procs! 250! 300! RSZDT. I would like to see if you can give me a hand for something similar but be able to count the processes of a windows server. I do not know if with the same check_nt it will be possible or if someone can guide me how to do it. Thank you very much and sorry for the English (google translator)

regards
kyang

Re: how to monitor the total number of processes in windows

Post by kyang »

There are a number of ways. Finding a plugin from our Nagios Exchange site is probably the easiest.

I'll just reference one that I use which uses SNMP.
https://exchange.nagios.org/directory/P ... MP/details
My example of running it.

Code: Select all

[root@localhost libexec]# ./check_nproc_snmp 192.168.3.242 nagiosprivate 20 25
Critical - NProcs => 115
tasks.PNG
tasks.PNG (2.25 KiB) Viewed 4396 times
Otherwise, there is a lot you can look at depending on your requirement.
https://exchange.nagios.org/directory/P ... /Processes

Do you have an agent? NRPE? NSClient++? NCPA?
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the total number of processes in windows

Post by h4doukeeN »

kyang wrote:There are a number of ways. Finding a plugin from our Nagios Exchange site is probably the easiest.

I'll just reference once that I use which uses SNMP.
https://exchange.nagios.org/directory/P ... MP/details
My example of running it.

Code: Select all

[root@localhost libexec]# ./check_nproc_snmp 192.168.3.242 nagiosprivate 20 25
Critical - NProcs => 115
tasks.PNG
Otherwise, there is a lot you can look at depending on your requirement.
https://exchange.nagios.org/directory/P ... /Processes

Do you have an agent? NRPE? NSClient++? NCPA?
I have NSclient



[root@localhost plugins]# ./check_nproc_snmp 10.10.10.30 public 300 500
Timeout: No Response from 10.10.10.30.
./check_nproc_snmp: línea 17: [: -ge: se esperaba un operador unario
./check_nproc_snmp: línea 24: [: -ge: se esperaba un operador unario
./check_nproc_snmp: línea 29: [: -lt: se esperaba un operador unario
[root@localhost plugins]#
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: how to monitor the total number of processes in windows

Post by npolovenko »

@h4doukeeN
I have NSclient
Then use either this command if you use NSClient + NRPE:

Code: Select all

./check_nrpe -H windows_server_ip -c check_process
Or this command if you use NSCLient check_nt:

Code: Select all

./check_nt -H windows_server_ip  -p 12489 -s 'Str0ngP@ssw0rd' -v PROCSTATE -l spoolsv.exe -d SHOWALL
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 total number of processes in windows

Post by h4doukeeN »

Hello, I have managed to integrate the process enumeration, but I have a problem with only one server and it is as if I did not have the NCPA agent installed, but if it is, I can monitor the memory in all the servers that have it and list the processes in all the servers that I have it except in one and I do not know what is the reason that throws me "UNKNOWN"

Image


Code: Select all

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

Code: Select all

define service{
        use                     generic-service
        host_name               01-Sv-10.68
        service_description     Numero Procesos
        check_command           check_ncpa!-t public -P 5693 -M processes -w 1000 -c 1100
        check_interval          0.1
        retry_interval          1
        notification_interval   1
        max_check_attempts      1
        }
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Re: how to monitor the total number of processes in windows

Post by h4doukeeN »

when typing script by console the same problem is maintained for the server 10.10.10.68, but when using another ip as in this case the 10.10.10.69 works without problems

Image
h4doukeeN wrote:Hello, I have managed to integrate the process enumeration, but I have a problem with only one server and it is as if I did not have the NCPA agent installed, but if it is, I can monitor the memory in all the servers that have it and list the processes in all the servers that I have it except in one and I do not know what is the reason that throws me "UNKNOWN"

Image


Code: Select all

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

Code: Select all

define service{
        use                     generic-service
        host_name               01-Sv-10.68
        service_description     Numero Procesos
        check_command           check_ncpa!-t public -P 5693 -M processes -w 1000 -c 1100
        check_interval          0.1
        retry_interval          1
        notification_interval   1
        max_check_attempts      1
        }
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: how to monitor the total number of processes in windows

Post by npolovenko »

@h4doukeeN, Can you put processes in a single quotes and then try to run the command locally one more time?

Code: Select all

./check_ncpa.py -H <ncpaserver> -t mytoken -M 'processes' --warning=100 --critical=200
What version of NCPA is installed on that server? Can you upload the ncpa.cfg config here?
Also, did you try running the command with a verbose flag?
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 total number of processes in windows

Post by h4doukeeN »

hello, the NCPA version is 2.1.1, attached image with the command executed for server 68 and 69 plus both cfg
ncpa-servidor68.cfg
(7.55 KiB) Downloaded 362 times
ncpa-servidor69.cfg
(7.55 KiB) Downloaded 354 times
Image
npolovenko wrote:@h4doukeeN, Can you put processes in a single quotes and then try to run the command locally one more time?

Code: Select all

./check_ncpa.py -H <ncpaserver> -t mytoken -M 'processes' --warning=100 --critical=200
What version of NCPA is installed on that server? Can you upload the ncpa.cfg config here?
Also, did you try running the command with a verbose flag?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: how to monitor the total number of processes in windows

Post by npolovenko »

If you encounter problems with the plugin, you can use the -v argument to enable verbose output of problems. There is also a -D argument that enables debugging output.
@h4doukeeN, We should try that. Please run the command locally against the .68 server and add the -v argument at the end, also try the -D argument for debugging.
Can you put the word processes in single quotes and then try the command?
Do both servers have the same version of NCPA agent?
On the .68 server you may check out the log files in C:\Program Files (x86)\Nagios\NCPA\var\log\ directory. You might find something useful.
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 total number of processes in windows

Post by h4doukeeN »

npolovenko wrote:
If you encounter problems with the plugin, you can use the -v argument to enable verbose output of problems. There is also a -D argument that enables debugging output.
@h4doukeeN, We should try that. Please run the command locally against the .68 server and add the -v argument at the end, also try the -D argument for debugging.
Can you put the word processes in single quotes and then try the command?
Do both servers have the same version of NCPA agent?
On the .68 server you may check out the log files in C:\Program Files (x86)\Nagios\NCPA\var\log\ directory. You might find something useful.

Hello, when you put -v -D it throws the following in the server 68, in the 69 it executes the command without problems. The command is also sent with single quotes and the same goes without quotation marks. Regarding the version of NCPA 2.1.1 is the same for all the servers I installed them myself

Image
Locked