What's new

WAN uptime

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

lfbb

Regular Contributor
Is it possible to know the uptime of a wan connection (without looking at the system log and do some math)? Any command for this?

- lfbb
 
No, there's no timer for it. DHCP leases will get renewed after a while, so there's no way to keep track of when your WAN was up - the concept of "up" is kinda fuzzy due to limited DHCP leases.
 
I'm using a wan-start script which sends a e-mail when the WAN connection goes up.
At least you know it has been down, but for how long you don't know.
Maybe you can give it a try.
 
Look here.

I used RMerlin his script and added the uptime command to it.
If you receive the e-mail and uptime is zero, your router rebooted. (Power outage most likely.)
If uptime is high, only your WAN connection went down and up again.

Works well for me. :)
 
No, there's no timer for it. DHCP leases will get renewed after a while, so there's no way to keep track of when your WAN was up - the concept of "up" is kinda fuzzy due to limited DHCP leases.
This thing (absence of connection uptime) is annoying me for some time. Sometimes I just want to check for how long my connection is up to identify some issues (be it ISP or whatever). This info was available on my old D-Link under WAN status. Guess I'll use the wan-start script to store the last connection time in some text file (which alternatively can be done by FW and displayed in WAN status page ;) )
 
I agree it would be nice to have such info. Was using Tomato for few weeks and despite 5min DHCP WAN IP lease time, it summed UP "connection" time nicely until it was dropped or switched to WAN2. I was able to have a quick look and check how long it's been up. With Asus I have to check the logs to figure this out.
 
Just because I needed a diversion from some other work, I gen'd this up on my fork....still needs some more testing :)
WanUptime.png


This was after I pulled the modem internet cable to create a WAN down for a few minutes.
WAN Uptime (Current) is the uptime following the last WAN up.
 
Just because I needed a diversion from some other work, I gen'd this up on my fork....still needs some more testing :)View attachment 7276

This was after I pulled the modem internet cable to create a WAN down for a few minutes.
WAN Uptime (Current) is the uptime following the last WAN up.

The tricky part is handling the PPPoE session time. The code could probably be borrowed from Tomato, but for me this isn't a priority.

And we have to assume that Asus's WAN detection works properly. That's something they have been constantly changing these last 4 months...
 
The tricky part is handling the PPPoE session time. The code could probably be borrowed from Tomato, but for me this isn't a priority.
I started from a 'clean sheet' and wrote my own solution. From what I can see, it should also work for PPPoE, but will need to get someone to test it.

And we have to assume that Asus's WAN detection works properly. That's something they have been constantly changing these last 4 months...
Well, you have to start somewhere :)
 
Last edited:
The tricky part is handling the PPPoE session time. The code could probably be borrowed from Tomato, but for me this isn't a priority.

And we have to assume that Asus's WAN detection works properly. That's something they have been constantly changing these last 4 months...

Sorry for reviving an old thread but I don't feel like opening a new topic since my query is related.

I set a script to send me an email every time my WAN connects and I just want to add the last connect time in the email, I see an option in the router log which shows that info but I don't seem to find where it's stored and how to fetch it from within the email, so any help is greatly appreciated.

I'm talking about this entry:

Code:
Feb 21 12:57:08 pppd[671]: Connect time 635.1 minutes.
 
It's not stored anywhere, it's dynamically logged by the pppd server as it closes its own connection.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top