Page 1 of 2

Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 10:51 am
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

Re: Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 11:16 am
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

Re: Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 11:23 am
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.

Re: Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 11:28 am
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.

Re: Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 11:31 am
by gdolidze
Still same issue.

Re: Check_log3.exe Windoes setup

Posted: Fri May 22, 2015 11:45 am
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.

Re: Check_log3.exe Windoes setup

Posted: Tue May 26, 2015 9:01 am
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.

Re: Check_log3.exe Windoes setup

Posted: Tue May 26, 2015 11:00 am
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"

Re: Check_log3.exe Windoes setup

Posted: Tue May 26, 2015 12:50 pm
by gdolidze
what is the test log?

Re: Check_log3.exe Windoes setup

Posted: Tue May 26, 2015 1:57 pm
by jolson
test.log can be any log on your system that you'd like to monitor.