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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

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

Post by grayloglearn »

If the script will not complete in 65 sec which output in nagios console will display
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Your data_user.exe is an external script so it would be limited by
grayloglearn wrote:[/settings/external scripts]
timeout = 65
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked