Check_log3.exe Windoes setup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Check_log3.exe Windoes setup

Post by gdolidze »

On the Windows side, I've tested this using check_log3.exe instead of check_log3.pl. Check_log3.exe can be downloaded here: http://sourceforge.net/projects/pma-oss ... s-plugins/

You will need to have NSClient running on your Windows Servers. You can download NSClient here: http://www.nsclient.org/download/

Once downloaded, you'll need to adjust nsclient.ini - I used the following configuration:


[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1

[/settings/external scripts/scripts]
check_log3 = scripts\check_log3.exe "-p somestring" "-l C:\testlog" "-c 1" --no-timeout


Then restart NSclient on the windows box with an administrative cmd prompt:
CODE: SELECT ALL
net stop nscp
net start nscp


Once it's restarted, you can call the Windows machine in much the same way you'd call a linux box:
CODE: SELECT ALL
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log3
OK: Found 0 lines (limit=1/1): No matches found.|'lines'=0

I have tried this and get the error UNKNOWN: No handler for that command
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check_log3.exe Windoes setup

Post by jolson »

What version of NSClient are you using? Do you have the password and allowed hosts in place?

Code: Select all

[/settings/default]
allowed hosts = 192.168.x.x/24
password = nsclient
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Check_log3.exe Windoes setup

Post by gdolidze »

the version is 2.15 and I have allowed host and passwords set up.

I have nagios setup for this server. I just wanna setup log monitoring now.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check_log3.exe Windoes setup

Post by jolson »

Under [modules], please add the following setting:

Code: Select all

CheckExternalScripts=enabled
After adding the above, restart NSClient and perform your testing once more.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Check_log3.exe Windoes setup

Post by gdolidze »

Still same issue.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check_log3.exe Windoes setup

Post by jolson »

Let's run NSClient in test mode. On your Windows box, open an administrative command prompt and perform the following procedure:

Code: Select all

cd <NSClientDIR>
e.g. C:\Program Files\NSClient++

Code: Select all

net stop nscp
nscp test
While the test output is going, attempt to perform the check from your Nagios box. What error is produced, if any? Is there any startup error? Post the output here.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Check_log3.exe Windoes setup

Post by gdolidze »

nscp command does not exist/work

Can you give me all the steps from the begging so I can make sure that I did not miss anything.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check_log3.exe Windoes setup

Post by lmiltchev »

nscp command does not exist/work
What is the version of the NSClient++ that you are running? If you are running an older version (i.e. 0.3.9), you may need to run:

Code: Select all

net stop nsclientpp
net start nsclientpp
or restart the NSClient++ service from the GUI.

FYI, I just tried the check and it worked just fine for me. I have it defined in the nsclient.ini file as such:

Code: Select all

check_log3 = scripts\check_log3.exe -l "c:\test.log" -p "failed"
Be sure to check out our Knowledgebase for helpful articles and solutions!
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Check_log3.exe Windoes setup

Post by gdolidze »

what is the test log?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check_log3.exe Windoes setup

Post by jolson »

test.log can be any log on your system that you'd like to monitor.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked