I recently configured a Linux router to share the internet in my local network. I used to have a hardware router before this, but it doesn't work anymore. On the router it was something called "Web Configurator" from where you could do things like forward ports, set up DHCP and such. Basic router stuff. There were also some system information about the internet connection which displayed <B>uptime</B>, transferred/transmitted bytes/packets, current IP and such.
This is something I really miss, so I began making a site like this for my Linux router. This is where my problem comes in. I have no idea how to display the internet connection uptime. I know I can find out when the connection started by looking at when i.e. /var/run/ppp0.pid was started, but that doesn't help me much since I don't know what to do with it. I don't know perl or PHP, so I'm not able to make a script which figures out this issue.
I've searched the internet, but this hasn't helped a lot.
Another problem is how to export the information from the router box and over to the web server. -My- best solution is to set up crontab entry for scp'ing a file from the router and over to the server, but then I need a script which calculates the uptime and prints it to a file. How to export is though not my main problem, but I'm really open for better suggestions.
But what I really need help about is the uptime issue.
Thanks in advance.