check process size

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.
HaschkeD
Posts: 44
Joined: Tue Feb 02, 2016 8:35 am

check process size

Post by HaschkeD »

Hi,
we use Nagios 3.2.3 and i want to monitor a process….
If the process size is bigger than 1,5 GB i want to get a warning/critical message.
It is a Windows Server 2012 with NSClient 0.3.9.
Is this possible?

Regards
Dennis
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check process size

Post by tgriep »

I recommend upgrading NSClient++ to a newer version. 0.3.9 is out of support.
http://nsclient.org/download/

Then to check a process, take a look at this link under the Sample Commands section for an example.
https://docs.nsclient.org/reference/win ... ck_process
Be sure to check out our Knowledgebase for helpful articles and solutions!
HaschkeD
Posts: 44
Joined: Tue Feb 02, 2016 8:35 am

Re: check process size

Post by HaschkeD »

Thanks. I installed the latest NSClient++ an a Windows x64 Testsystem.
I selected "Generic" with "Insecure legacy mode". Is this correct?
On my old NSClient++ i have a nsc.ini file to configure things. This file is missing in the new NSClient++.
If i try to check something i get the error "Connection refused". Any idea why?

I configure the nsclient.ini file.
Now i get the message "could not fetch Information from Server".
In the web gui i see "Rejected Connection from IP xx.xx.xxx.x".
Under allowed hosts i enter the IP from my Nagios Server.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check process size

Post by tgriep »

This question
I selected "Generic" with "Insecure legacy mode". Is this correct?
Is yes.

I have attached a default, known working nsclient.ini file here.
Add the IP address of the Nagios server to the allowed hosts option and over write the copy on the server and restart NSClient++.
Then check the Nagios server to see if the commands can connect to the Windows system.
Attachments
nsclient-default.ini
(1.91 KiB) Downloaded 173 times
Be sure to check out our Knowledgebase for helpful articles and solutions!
HaschkeD
Posts: 44
Joined: Tue Feb 02, 2016 8:35 am

Re: check process size

Post by HaschkeD »

Thanks for the file. I enter the IP from my Nagios host and Change the file and Restart the service.
Now i get the error "Invalid Password".
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check process size

Post by scottwilkerson »

You will want to edit the password on line 11 to be your password, then restart the service.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
HaschkeD
Posts: 44
Joined: Tue Feb 02, 2016 8:35 am

Re: check process size

Post by HaschkeD »

But what for a password? It's not quite clear to me.
We have several users that login to Nagios…..
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check process size

Post by scottwilkerson »

HaschkeD wrote:But what for a password? It's not quite clear to me.
We have several users that login to Nagios…..
You need to create a password, and this will be the same password you are using in Nagios XI to run the check with the check_nt command
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
HaschkeD
Posts: 44
Joined: Tue Feb 02, 2016 8:35 am

Re: check process size

Post by HaschkeD »

I use Nagios Core 3.2.3
With my old NSClient++ i don't need a password.
I commented the password line out with a #.
Now it works fine…..

We use external scripts..
[NRPE Handlers]
check_ad=cscript.exe //T:30 //NoLogo scripts\check_ad.vbs
check_ms_win_updates=cmd /c echo scripts/check_windows_updates.ps1; exit $LastExitCode | powershell.exe -command -
check_dag=powershell.exe scripts\check_dag.ps1
check_sophos=cscript.exe //NoLogo scripts\check_sophos.vbs /W:$ARG1$ /c:$ARG2$
check_exchange_dag_indexstate_health=cmd /c echo scripts\NagiosMonitoring_Exchange2010ContentIndexStateHealth.ps1 | PowerShell.exe -Command -
check_database_mount_shop=cmd /c echo scripts/Check_database_mount_Shop.ps1 | PowerShell.exe -Command -
check_database_mount_shop_at=cmd /c echo scripts/Check_database_mount_Shop_at.ps1 | PowerShell.exe -Command -
check_database_mount_werke=cmd /c echo scripts/Check_database_mount_Werke.ps1 | PowerShell.exe -Command -

Is this with the new nsclient.ini possible?
Is it possible to install the new NSClient++ with command line (Batch)?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check process size

Post by scottwilkerson »

Yes that should work fine.

There is a silent installer for nsclient++ you can see details here
https://docs.nsclient.org/installing/

We are not the developers of this software however, so further questions regarding nsclient++ should be directed to them
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked