cancel
Showing results for 
Search instead for 
Did you mean: 

How can I modify the tftp timeout?

How can I modify the tftp timeout?

Ali_Askari
New Contributor II
I'd like to test if a tFTP server is up and if it's up I'm downloading some scripts on to the switch. Right now I'm trying to download a dummy file from the tFTP server using this command

tftp get serverIP dummyFile.xsf

if the tftp server is up, I get a reply very fast that the file is not available. But if the server is down the timeout for the tftp command is 60 seconds. It is very long in my application. I'd like to decrease it to 5-6 seconds. Is this possible?

Is there any other method to find out if the server is up or not?

EDIT:

BTW, I've tried to ping the tFTP server but even when it's up I get this errPacket transmit error: Packet transmit error; Destination unreachable
6 REPLIES 6

Matthew_Hum1
Extreme Employee
Can I ask why you are doing this from a switch and not a server? It seems to me that it is much easier to write a script to test your tftp server and then send out notification (syslog/email) if the tftp server fails and put it on a cronjob. Or even use nmap/nping or udpping to verify that your tftp server is up. that way you don't actually have to transfer any files.

Henrique
Extreme Employee
Hi Ali, currently there is no native CLI option to modify the TFTP timeout.

An option would be creating a Python script to ping the server through MGMT vlan and only start the TFTP process if the server is up.

However this script might need to be created from scratch.

You can find some examples for Python scripts in the link below:

EXOS Python Scripts

Note: Python version 2.7.3 has been integrated into EXOS since EXOS 15.6.1

OscarK
Extreme Employee
Using python you could use expect and the timeout option so it will fail if the command is not finished within that timeout.
Something like below but then you need to extend that a bit.

import pexpectimport exshexpect
exosPrompt = ' # '
Create an expect object. Pass in the prompt and the back end function to call:
p = exshexpect.exshspawn(exosPrompt, exsh.clicmd)
Use sendline to send commands to the backend function (in this case exsh.clicmd) :
p.sendline('tftp get ') <-
idx = p.expect([exosPrompt, pexpect.EOF, pexpect.TIMEOUT])

Ali_Askari
New Contributor II
Hi Henrique, thanks for your comment. I can write the python script but as I've explained to@Brandon my tFTP server is running on a Windows machine so if I ping the tFTP server and even if the server is not running I will get a reply to my ping requests, so ping is not useful in my case.
GTM-P2G8KFN