returned an invaled return code 255

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: returned an invaled return code 255

Post 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
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.
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post by ariarlet »

Same error

Code: Select all

OUTPUT: Cannot read $ARG2$
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: returned an invaled return code 255

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post 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$"
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: returned an invaled return code 255

Post 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:

Code: Select all

nscp.exe test
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.
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.
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post 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.
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post by ariarlet »

Thank all you

Finally i resold the problem

I write --no-timeout in the .ini and run correctly
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: returned an invaled return code 255

Post 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
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.
ariarlet
Posts: 61
Joined: Wed Apr 22, 2015 11:04 am

Re: returned an invaled return code 255

Post 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

Locked