Obtaining Pluse Net Gateway identity within a web server-side script
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Broadband
- :
- Re: Obtaining Pluse Net Gateway identity within a ...
Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 1:35 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I want to be able to report my current PN Gateway on a page delivered by my (local) web server. I know of the Plusnet Usergroup tool 'Which Gateway' (http://usertools.plus.net/@gateway) however that runs within their web pages and all I want is the result embedded in my web page as in 'pcl-ag01'. The reason for doing this server-side is that I want to be able to see this information / web page when not at home on the PN network.
I guess I could (somehow) extract data from tracert...
Quote from: tracert
Tracing route to portal.plus.net [212.159.9.2] over a maximum of 30 hops:
1 * * * Request timed out.
2 322 ms 79 ms 55 ms lo0-central10.pcl-ag01.plus.net [195.166.128.182]
3 196 ms 38 ms 36 ms link11-central10.pcl-gw01.plus.net [84.93.249.20]
4 196 ms 61 ms 36 ms xe-0-2-0.pcl-cr01.plus.net [212.159.1.0]
5 209 ms 36 ms 36 ms po2.pcl-gw01.plus.net [195.166.129.41]
6 266 ms 44 ms 44 ms gi5-8.ptp-cr01.plus.net [84.93.224.48]
7 245 ms 45 ms 45 ms vlan2658.ptp-elb02.plus.net [84.93.224.45]
8 205 ms 46 ms 45 ms portal.plus.net [212.159.9.2]
Trace complete.
If the AP / modem supported TelNet I might beable to extract the data from there, however they do not support TelNet. Would be ral nice ifthere were a PN cgi script which delivered just the gateway name for a given IP address or account name - e.g. http://plus.com/cgi/gateway.cgi?user=townman returns just the Gateway ID.
All seems a bit tedious - anyone got a workable suggestion please?
Cheers,
kevin
In another browser tab, login into the Plusnet user portal BEFORE clicking the fault & ticket links
Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.
If this post helped, please click the Thumbs Up and if it fixed your issue, please click the This fixed my problem green button below.
Re: Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 1:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
$gateway_o = exec("netstat -rn -f inet | grep default");
$gateway = preg_split("/\s+/",$gateway_o);
$gateway_ip = $gateway[1];
$gateway_host = gethostbyaddr($gateway_ip);
$gateway_host_parts = explode(".",$gateway_host);
$gateway_id = $gateway_host_parts[1];
Although you have to run that on the router...
(From the script that does my sig image)
Re: Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 4:09 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks for the suggestion - PHP is over my experience horizon and on the retirement bucket list to learn!
After a bit of scrabbling around, I got the following asp / vbscript to do the job. A bit Heath Robinson, but it works... others might find it useful. Effectively it parses the results of tracert.
<%
Response.Buffer = true
url ="plus.net"
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("tracert -4 -h 4 -w 40 " & url)
strPResult = objCmd.StdOut.Readall()
Set objCmd = nothing:
Set objWShell = nothing
strResponseRows = split(strPResult, vbCRLF)
for i = 4 to ubound(strResponseRows)
if instr(strResponseRows(i),url)>0 then
strInterestingBit = mid(strResponseRows(i),33)
strResult = split(strInterestingBit," ")
strURL= split(strResult(0),".")
response.write strURL(0) & "<br>"
response.write strURL(1) & "<br>"
response.write strResult(1) & "<br>"
exit for
end if
next
%>
Produces...
lo0-central10<br>pcl-ag01<br>[195.166.128.182]<br>
In another browser tab, login into the Plusnet user portal BEFORE clicking the fault & ticket links
Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.
If this post helped, please click the Thumbs Up and if it fixed your issue, please click the This fixed my problem green button below.
Re: Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 4:17 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: townman If the AP / modem supported TelNet I might beable to extract the data from there, however they do not support TelNet.
You can enable telnet on the WAN interface of the 582n using:
:service system ifadd name TELNET group wan
:mlp role addpriv name Administrator access anyaccess service anyservice
:saveall
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 7:44 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Edit: You'd think I'd know URLs for things that I've been involved in building 😕
Re: Obtaining Pluse Net Gateway identity within a web server-side script
04-01-2013 11:30 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Happy New Year to you...
Thanks for this contribution, even though it does not help me here. I've ditched the TG585v8 as I suspect it is part of the problem I'm toying with elsewhere with Anotherone. I do not have the 582n, not too sure it would help anyway other than exposing Bits & Tone data.
Do I correctly conclude that these commands make the TELENT interface remotely accessible ove rthe WAN interface? If so than this might offer the means of undertaking remote RouterStats data collecting in situations where (for whatever reasons) RouterStats cannot be run locally.
Cheers,
Kevin
In another browser tab, login into the Plusnet user portal BEFORE clicking the fault & ticket links
Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.
If this post helped, please click the Thumbs Up and if it fixed your issue, please click the This fixed my problem green button below.
Re: Obtaining Pluse Net Gateway identity within a web server-side script
07-01-2013 11:48 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Yeah, you'll be able to access your router remotely after running the telnet commands.
Re: Obtaining Pluse Net Gateway identity within a web server-side script
15-01-2013 8:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Broadband
- :
- Re: Obtaining Pluse Net Gateway identity within a ...