Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

Interface Command?

is there such a command in cisco ios to check how long an interface has been up?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: Interface Command?

No. This could run from a network server:

tclsh tftp://10.1.1.1/int-uptime.tcl

However, you could copy it to flash if you wanted.

4 REPLIES

Re: Interface Command?

hi,

There is no such command. But router uptime can be obtained (sh verion). And Last input / Last output also (sh int f0/0).

Instead I would suggest either you use a Syslog server to log the interface up/down messages or a SNMP tool (OpenNMS), which would be the best option.

Cisco Employee

Re: Interface Command?

If your device is running 12.3(7)T or higher (or a 6500 running 12.2(18)SXF5 or higher), you can use this Tcl script to get the uptime for an interface. You can run it like:

Router#tclsh flash:int-uptime.tcl --interface FastEthernet0/0 --community public

Interface FastEthernet0/0 has been in its current state for 4 weeks, 5 days, 8 hours, 34 minutes, 47 seconds (since Tue May 27 16:59:58 EDT 2008)

You can run the script with --help or --usage to get usage help. This tool uses the SNMP object ifLastChange to determine the last time an interface changed state. If the interface is currently up, then the time shown will be the interface uptime.

Community Member

Re: Interface Command?

thanks. do I need to copy this in to flash?

Cisco Employee

Re: Interface Command?

No. This could run from a network server:

tclsh tftp://10.1.1.1/int-uptime.tcl

However, you could copy it to flash if you wanted.

389
Views
5
Helpful
4
Replies
CreatePlease to create content