mbeals Posted October 23, 2007 Share Posted October 23, 2007 I am building a dynamic site for monitoring computer networks. I store the static info (gatewayIP, equipment info, service address, etc) in a mysql database. I also use SNMP to retrieve stats on the individual components of the networks. I have one php script to build a general info (html)table for a single network. The index page runs a looped include statement, so the main page will load as many instances of this table as there are rows in the main database. Anyway... I use SNMP to poll the devices on each network to identify problems. This generates a list of problem devices that is displayed on the index page with each network. I have simplified the polling process as much as I can, having it only do a full walk on a single field, sort out the problem devices, then get the MAC just for those specific ones. This polling process takes around 10 to 15 seconds per network to complete. This means that once I have 10 or so networks built, it will take forever to load the index page and will most likley cause timeout issues. Is there a fancy way to allow the snmp polling script to run in the background while the rest of the page loads, then once it is done, load the results into a CSS layer or some other object on the page? Is this outside of the abilites of php? Do I need to be looking at java? I thought about writing a perl script that would get the info and load it into the db on specific intervals (with cron), but the page really needs to be refreshed every time you view it. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/74460-speeding-up-php-and-snmp/ Share on other sites More sharing options...
BlueSkyIS Posted October 23, 2007 Share Posted October 23, 2007 Ajax may be your best bet. you could load the page and update each element as the results are completed. Each element could run it's own instance of the monitoring script so it should only take 10 to 15 seconds to load the entire page. Quote Link to comment https://forums.phpfreaks.com/topic/74460-speeding-up-php-and-snmp/#findComment-376209 Share on other sites More sharing options...
mbeals Posted October 23, 2007 Author Share Posted October 23, 2007 Thank you very much. It took about 2 hours of tinkering but I got it up and running. AJAX is awesome Quote Link to comment https://forums.phpfreaks.com/topic/74460-speeding-up-php-and-snmp/#findComment-376611 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.