Page 1 of 2

What is the difference between -t 120 in check command and n

Posted: Tue Oct 22, 2019 9:44 am
by grayloglearn
Hi Team,

What is the difference between configuration as -t 120 in check command and changing the timeout in nsclient.ini file
[Settings/NRPE/server]
allow arguments = true
timeout = 65
[/settings/external scripts]
allow arguments = true
timeout = 65

Ex: if we execute the command as below what nagios assumes and what clients will assume.

/usr/local/nagios/libexec/chec_nrpe - H XXXX -t 120 -c test

Please consider above client configuration timeout while calling from nagios

Re: What is the difference between -t 120 in check command a

Posted: Tue Oct 22, 2019 9:51 am
by scottwilkerson
timeout = 65 in the nsclient.ini file is how long nsclient will wait before erroring

-t 120 on the check_nrpe command is how long the plugin will wait before erroring (you will never get there if you have timeout = 65 in the nsclient.ini file

Re: What is the difference between -t 120 in check command a

Posted: Tue Oct 22, 2019 10:53 am
by grayloglearn
So for example

Now consider as now the time is 10:00 AM
At 10AM checknrpe is calling the remote plugin now script has taken 75sec to execute script.
Now how to understand this situation.
We have timeout=65 in nsclient.ini (just assume the value)
It's mean that the script execution time(75sec) +nsclient wait (65) = 140sec it's mean that to report back to nagios it will take 140 sec but we put the value as 120while we calling remote plugin. So in nagios console what start will come??

Please correct me if my assumption is wrong.

Re: What is the difference between -t 120 in check command a

Posted: Tue Oct 22, 2019 10:58 am
by scottwilkerson
When you make the call, check_nrpe will wait up to 120 seconds
the call will immediately go to nsclient which is instructed to ONLY wait 65 seconds for the script to complete.
If it doesn't complete in 65 seconds it will timeout and return that to check_nrpe

Re: What is the difference between -t 120 in check command a

Posted: Tue Oct 22, 2019 10:45 pm
by grayloglearn
If the script will not complete in 65 sec which output in nagios console will display

Re: What is the difference between -t 120 in check command a

Posted: Wed Oct 23, 2019 7:34 am
by scottwilkerson
grayloglearn wrote:If the script will not complete in 65 sec which output in nagios console will display
An external script timeout should display I believe, however we are not the authors of NSClient++ and it could vary by version

Re: What is the difference between -t 120 in check command a

Posted: Thu Oct 24, 2019 10:05 am
by grayloglearn
We have couple of scripts in script folder.

[/settings/external scripts/wrappings]
vbs = cscript.exe //T:120 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

What is the difference putting in above line 120 and below nrpe timeout 70

[/settings/external scripts]
timeout = 65

[settings/NPRE/server]
timeout = 70


Could you please explain what will happen if we put above line by calling below
/usr/local/nagios/libexe/check_nrpe -H XXXX -t 120 -c check_usik

Re: What is the difference between -t 120 in check command a

Posted: Thu Oct 24, 2019 10:40 am
by scottwilkerson
grayloglearn wrote:[/settings/external scripts]
timeout = 65
this is how long your external scripts will be allowed to run before timing out
grayloglearn wrote: [settings/NPRE/server]
timeout = 70
This is how long any NRPE command will be allowed to run before timing out (not just limited to external scripts)
grayloglearn wrote:Could you please explain what will happen if we put above line by calling below
/usr/local/nagios/libexe/check_nrpe -H XXXX -t 120 -c check_usik
I'm not sure I understand your question, this will execute the command for check_usik if one exists and then return the output provided it get a response in under 120 seconds from the server XXXX

Re: What is the difference between -t 120 in check command a

Posted: Thu Oct 24, 2019 11:29 am
by grayloglearn
I will explain my concern

We have data_user.exe scirpt to execute data_user.exe we use the command check_usik(This will help execute the script while we call from nagios as below

/usr/local/nagios/libexe/check_nrpe -H XXXX -t 120 -c check_usik

Once we call check_usik this will execute data_user. data_user its taking some time and it push the output to nagios console that is regular .


If script data_user.exe taking more time execute then we are not getting the any data. we have to put the timeout in nsclient.ini

We know that data_use.exe taking more than 60 sec we want to put execution time 90 for this we have done as below

[setting/NRPE/SERVER
timeout=90

Now for above timeout=90( It means we are putting the restriction to agent can wait 90 sec for the data_use.exe output ).If the script not getting the data 90 sec data_use.exe demon will kill. Correct me i am wrong. Then again next will happen same

Now

[/settings/external scripts]
timeout = 65

What does it mean External scripts. The script which are in C:\Program Files\NSClient++\scripts ???
Now again what is timeout=65

[/settings/external scripts/wrappings]
vbs = cscript.exe //T:120 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

What does it mean external scripts/wrappings ??

what does it mean if we put 120 below
vbs = cscript.exe //T:120 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%..

I

Re: What is the difference between -t 120 in check command a

Posted: Thu Oct 24, 2019 12:32 pm
by scottwilkerson
Your data_user.exe is an external script so it would be limited by
grayloglearn wrote:[/settings/external scripts]
timeout = 65