I've wrote perl scripts to query my network (cisco switchs) in SNMP
and I want to display informations (speed, @mac, duplex...) found by the script on an web interface. I want a sketch of the switch, with green ports, if all is ok, orange if there is a problem, on mouse over, or on the side, the differents informations about the port. I would like something like that : And color of the ports dynamically cha开发者_如何学编程nge depending on the answer of the perl scripts.Thanks, bye.
The easiest way to do this would be to use a CGI script with ImageMagick or GD to mark on a template graphic and schedule a reload frequency on the image using the Refresh HTTP header.
The modern way would be to use AJAX methods to regularly download current status, and then draw appropriate elements on the template image. The AJAX back-ends can be written as CGI scripts, too.
First of all, the cgi idea isn't bad. You can visualize your network stats on many clients. And they only need a browser. E.g http://raphaeljs.com/ nice chart, graph etc js lib. I've build such a thing myself. Networksensors are pushing informations to a database. And a webfrontend (it don't have to be perl) is aggregating and displaying the (avg/peak/amount) traffic over time. It works
精彩评论