How to complete installing a plugin from Nagios Exchange

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.
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

How to complete installing a plugin from Nagios Exchange

Post by rafael »

Hello All,

Anyone let me know how to complete proces of "Install a plugin" from Nagios Exchange. How many steps i need to follow up ? Step by step is high appreciate.
Site:

I'd like to monitoring my Mail exchange server.
My system is: CentOS 7, Nagios Core 4.3.2, Nagios Plugin release 2.2.1, Windows Server 2012 std & MS Exchange 2016.

Thanks you !
Last edited by cdienger on Wed Aug 09, 2017 1:43 pm, edited 2 times in total.
Reason: removing icon so it shows up on the dash
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by mcapra »

From the URL you shared:
Installation / Usage:
See comment inside the powershell (*.ps1) script
There are step-by-step instructions in the powershell script's source. Though the instructions assume your exchange server is running NSClient++.

This documentation might also be useful for understanding the relationship between NSClient++ and Nagios Core:
https://assets.nagios.com/downloads/nag ... ndows.html

The major difference with the above documentation is that you'll want to use check_nrpe from the Nagios Core side of things rather than check_nt.
Former Nagios employee
https://www.mcapra.com/
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by rafael »

Hi Mcapra,
I was followed up steps inside the script, But:
(1) On step 3.) what's it say ?
# On the check_nrpe command include the -t 30, since it takes some time to load the Exchange cmdlet's.
Where can i check this issue ?
(2) How to do the step 5.)
# 5.)
# You need to edit the config below
#
# Configuration:
# ====================
# Create a subset of the previous array for services you want to monitor
# Syntax: $ServicesToCheckArray = "Service1","Service2","Service3";
$ServicesToCheckArray="MSExchangeADTopology","MSExchangeAntispamUpdate","MSComplianceAudit","MSExchangeCompliance","MSExchangeDagMgmt","MSExchangeDiagnostics","MSExchangeEdgeSync","MSExchangeFrontEndTransport","MSExchangeHM","MSExchangeIS","MSExchangeMailboxAssistants","MSExchangeMailboxReplication","MSExchangeDelivery","MSExchangeSubmission","MSExchangeRepl","MSExchangeRPC","MSExchangeFastSearch","HostControllerService","MSExchangeServiceHost","MSExchangeThrottling","MSExchangeTransport","MSExchangeTransportLogSearch","MSExchangeUM","MSExchangeUMCR","FMS";
#
Attached file is the script which i downloaed form nagios exchange.

Could you please support me ?
Thank in advance.!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by lmiltchev »

1) You need to modify the check_nrpe command in commands.cfg on the nagios server by adding "-t 30" to it, in order to increase the timeout to 30 seconds.

Example:

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
If the check takes longer, you could bump up this value even higher.

2) You can remove all of the services that you don't need to monitor from the "NagiosMonitoring_Exchange2016_Services.ps1" script ($ServicesToCheckArray) or leave them "as is" if you want to monitor all of them. Copy the "NagiosMonitoring_Exchange2016_Services.ps1" script to the NSClient++ scripts directory on the Windows server. Next, add a command to the [/settings/external scripts/scripts] section in the nsclient.ini file. Enable the nrpe and external script modules, and restart the NSClient++ service.

Example:

Code: Select all

check_exchange_mailqueue = cmd /c echo C:\"Program Files"\NSClient++\scripts\NagiosMonitoring_Exchange2016_Services.ps1; exit $LastExitCode | powershell.exe -command -
Test your check by running the following command on the Nagios server from the command line:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_exchange_mailqueue
Be sure to check out our Knowledgebase for helpful articles and solutions!
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by rafael »

Hi lmiltchev,
1/ NSClient++ Test OK
Image
2/ Here is output,
Image
3/ Attached file is my NSClient.ini
Does the result correct ? Where can i check the final result ? On Nagios web, I did not see any news.
Any help please.!
Attachments
nsclient.ini
(1.19 KiB) Downloaded 419 times
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by lmiltchev »

You are missing many directives in the nsclient.ini file (unless you are not posting the entire file)...

Log into the CMD Prompt as administrator on the Windows machine, go to the NSClient folder:

Code: Select all

cd "C:\Program Files\NSClient++"
and run the following command in order to add all of the "default" options to the nsclient.ini file:

Code: Select all

nscp settings --generate --add-defaults --load-all
Note: This command is listed on the top of the nsclient.ini file. Don't be alarmed is you see a few warnings/errors. It's not unusual. Restart the NSClient++ service, then open the nsclient.ini file to see if it was populated with the new options.

Post the newly updated file, so that we can see what needs to be modified in order to fix the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by rafael »

Hello,
Here is result run the command and newest nsclient.ini file (See attachement). I saw it is the same former file.
Image
What i did modified the former nsclient.ini file ? I added:
(1) ; TODO
[/settings/default]
allowed hosts= 172.16.201.1
(2); TODO
[/modules]
NRPEServer = enabled
[External Scripts]
LyncFrontendServicesCheck=cmd /c echo C:\NagiosMonitoring\NagiosMonitoring_Exchange2016_Services.ps1 | PowerShell.exe -Command -
(3); TODO
[/modules]
NRPEServer = enabled

Hope receive your help soon. Tks.
Attachments
nsclient.ini
(1.19 KiB) Downloaded 434 times
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by rafael »

Any help ?
Thanks.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by lmiltchev »

The nsclient.ini file should have been updated with new directives... I am not convinced that you were able to stop/start the NSClient++ services properly... Is the service currently running? What is the version of the NSClient++ that you installed? Where did you get it from? Can you provide us with a download link?

I saw similar issues (errors) posted here:
https://github.com/mickem/nscp/issues/304

It may be relevant to your case.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rafael
Posts: 21
Joined: Thu Jul 13, 2017 11:06 pm

Re: How to complete installing a plugin from Nagios Exchange

Post by rafael »

Hello,
I had installed NSClient++ 0.4.1.73, then upgraded 0.5.0.62. The service is also running.
I downloaded from https://sourceforge.net/projects/nscplus/
BUT, based on your comments, I were decided to remove and resinstall NSClient++ 0.4.1.73. All thing seem works well. See below,
[root@Nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 172.16.201.1 -c LyncFrontendServicesCheck
Service OK: All services are up and running
Now, I'd like to look the results/achieves. Where can i find it ? What's all Exchange services state information ? I could only view windows check services.
Image
Locked