Page 4 of 5
Re: returned an invaled return code 255
Posted: Mon May 11, 2015 10:50 am
by jolson
What if you put the no timeout option next to check_log3 instead?
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H [HOST] -p 5666 -c check_log3 -t 30 -a --no-timeout -a -p "unable" -l "D:/alert_enetvae.log" -a -c 1
Re: returned an invaled return code 255
Posted: Mon May 11, 2015 11:32 am
by ariarlet
Re: returned an invaled return code 255
Posted: Mon May 11, 2015 12:10 pm
by tgriep
Try running the command like this and post the output here.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H [HOST] -p 5666 -c check_log3 -t 30 -a --no-timeout -p "unable" -l "D:/alert_enetvae.log" -c 1
Also, you you upload your fill nsclient.ini file so we can review it?
Re: returned an invaled return code 255
Posted: Tue May 12, 2015 8:09 am
by ariarlet
This code does not work, this problem is that not read arg2 while others servers yes
Code: Select all
check_log3 = E:/strawberry\perl\bin\perl.exe scripts\check_log3.pl -p "$ARG1$" -l "$ARG2$" -c "$ARG3$"
Re: returned an invaled return code 255
Posted: Tue May 12, 2015 11:14 am
by ariarlet
my problem is that in some servers run correctly and other servers not run.
And the errors are:
plugin timeout
and can't not read arg2
Code: Select all
OUTPUT: Cannot read c:/alert_inetvaes.log -c 1
in the all servers i write the code that i said
Re: returned an invaled return code 255
Posted: Tue May 12, 2015 1:09 pm
by jolson
I got this working on my own test box, but my procedure was a little different than yours. Let me know if you find this helpful.
I downloaded the latest version of NSClient here:
http://www.nsclient.org/download/0-4-3/
I downloaded check_log3.exe from here:
http://sourceforge.net/projects/pma-oss ... s-plugins/
check_log3.exe was placed in the scripts directory.
I used the following nsclient.ini configuration:
Code: Select all
[/settings/default]
allowed hosts = 192.168.x.x/24
password = nsclient
[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1
CheckExternalScripts=enabled
[/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 teststring" "-l C:\testlog" "-c 1" --no-timeout
Using that configuration, I started NSClient in test mode:
After making sure that it bound to my ports properly, I logged into my XI box and issued the following:
Code: Select all
/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
This tells me that the command worked properly. Does the above help you out at all?
Notes:
I hard-coded my arguments instead of leaving them to be defined.
Perhaps you could give the .exe a shot instead of using the perl script? This way you don't have to rely on installed perl versions.
Re: returned an invaled return code 255
Posted: Wed May 13, 2015 8:08 am
by ariarlet
I have got same versions in all servers.
The configuration of nsclient.ini same
I already download this page too
I do not understand my mistake.
Re: returned an invaled return code 255
Posted: Wed May 13, 2015 9:41 am
by ariarlet
Thank all you
Finally i resold the problem
I write --no-timeout in the .ini and run correctly
Re: returned an invaled return code 255
Posted: Wed May 13, 2015 9:49 am
by jolson
Glad to hear that your issue was resolved. Would you be willing to post your final configurations so that other people can learn from your work if they have similar requirements?
Thanks!
Jesse
Re: returned an invaled return code 255
Posted: Wed May 13, 2015 10:04 am
by ariarlet
Ok no problem
In CCM Nagios Comand:
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_log3 -t 100 -a $ARG1$ $ARG2$ $ARG3$
ARG1 = "unable"
ARG2 = "C:/table.log"
ARG3 = 1
In nsclient.ini
Code: Select all
[/settings/external scripts/scripts]
default =
check_log3 = E:/strawberry\perl\bin\perl.exe scripts\check_log3.pl -p $ARG1$ -l $ARG2$ -c $ARG3$ --no-timeout