What sold it for me was the fact that Geckoboard have a Push API that would allow me to push data to the dashboard widgets, thus avoiding the need to create some sort of webservice that I have to open ports on the firewall to. The other thing with a webservice is that it’s usually run with compiled code, which isn’t as flexible to maintain or for other team members to pick up.
The Geckoboard Push API uses JSON, which is easy to work with in PowerShell. I’d already worked on getting data out of Spiceworks using PowerShell for my email reports, so I had that part of it covered also. The rest was just a matter of wiring together the right queries to extract the data that I wanted to monitor.
The prerequisites for this are the same as in the previous blog post about Spiceworks and data extraction; .NET 4.5 & WMF 4.0, and the SQLite PowerShell Provider.
The basic gist of the process is this:
- Create a dashboard on Geckoboard
- Add a custom widget of your choosing. The documentation for each widget describes how the JSON data should look. Make sure you set its method to Push, and grab the Push URL and Widget key whilst you’re at it. These are used in the script in step 4.
- Work out the SQL query that you need to extract the data. See this blog post for how I normally do it.
- Write a PowerShell script that uses the query from step 3, and then posts the data to the widget
- Run the script in a scheduled task to push the data to Geckoboard.
Since there is one script per widget, I’ve currently got 14 scripts. What I’ve done is created a wrapper script that contains common code. This script then goes and runs all of the widget-specific scripts. The wrapper script is the one that I run in a scheduled task. Ours runs every minute.
The wrapper script:
Here’s the code for a simple widget, “Tickets Open”:
Here’s an example of a more complex widget update script that populates a list widget:
I can provide code for the other widgets if anyone’s interested in implementing a similar solution.
We’ve been running this for over 6 months now. It’s a great way of keeping on top of the helpdesk workload, and making sure that everyone’s delivering the service that they should.