Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to show network connectivity status?

Status
Not open for further replies.

cyberspace

Technical User
Aug 19, 2005
968
GB
I would like to make a web page that i can put on a company server that can be used as quick reference to see if an interface is up or down.

I suppose it would have to ping the interfaces, and then show up or down...

eg..."Internet Access is OK" or "Internet Access Not Available" etc

Would PHP allow me to do this?

If not I would appreciate an alternative solution.

Thanks

'When all else fails.......read the manual'
 
might this work?
Code:
$external_web_site = "[URL unfurl="true"]http://www.google.com";[/URL]
$fh = @fopen($external_web_site, "r");
if ($fh === false):
  echo "The web is down";
else:
  echo "The web is good to go";
endif;
@fclose ($fh);
 
Similar to jpadie's post: I have a front-end for a MRTG installation that uses a combination of ping and snmpget (Linux not Windows) to check several of our core routers and servers as links to the more detailed MRTG pages. Basically the page displays core routers and servers andthen lets you drill down into their areas to display more or the servers and/or network. The snmp queries are for uptime and utilization, the ping queries are for calculating latency and to allow me to skip the snmp query if the server doesn't respond.

I believe you have to compile PHP with an SNMP option to be able to use snmpget/etc. But with it you could specify exactly which interfaces on a given server/switch your trying to get information about. Plus there are MRTG add-ons out there that will let you extend it's capabilitie if you want to go that route.

-T

signature.png
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top