Zenoss Google Maps Traffic Monitor

.!.

Zenoss can now monitor two kinds of traffic.

By hacking at the javascript in the default zenoss template it is possible to add Google Maps traffic overlays to the Zenoss dashboard.

zenosstraffic.png

Submit your own Zenoss tip and get a chance to win an AsusEEE!

The full Google Maps Traffic Report Howto is on the Zenoss Tips and Tricks wiki page or read more for a local copy.


Here in the office we've got the Zenoss dashboard up on a large LCD on the wall so we can keep an eye on our servers. As a service to the people here that commute into Dallas on the way home I have added Google's traffic reports to the maps portlet on the dashboard.

Fortunately the traffic reports are already built into the Google

This is a pretty simple hack, but it does involved editing a javascript file in the template. The usual disclaimers apply, backup your files, and expect the hack to disappear when you upgrade zenoss.

Find geomap-2.1.js, it should be in Zenwidgets/skins/zenui/javascript/. It's exact location may vary depending on how you installed zenoss and which system you are using.

At the top add a new variable for the traffic overlay.

@@ -1,4 +1,6 @@
 var Class = YAHOO.zenoss.Class;
+var trafficOverlay = new GTrafficOverlay();
+

Then down in the doDraw function we need to update the overlay and add it to the map.

@@ -150,6 +152,8 @@
         for (j=0;j<linkdata.length;j++) {
             x.addPolyline(linkdata[j]);
         }
+        trafficOverlay = new GTrafficOverlay();
+        x.map.addOverlay(trafficOverlay);
         d = x.lock.acquire();
         d.addCallback(x.saveCache);

Browsers can be persistent at caching the javascript files. You may need to clear your cash and shift-reload the dashboard before you see the changes.

If it doesn't work check the js file in your browser and make sure it isn't cached:
http://YOUR.ZENOSS.SERVER:8080/zport/dmd/Locations/javascript/geomap-2.1.js

Here is how it looks on our monitor in the office:

One thought on “Zenoss Google Maps Traffic Monitor

  1. Pingback: Zenoss Blog » antonnolsen.com - Zenoss Google Maps Traffic Monitor

Leave a Reply

Your email address will not be published. Required fields are marked *