Big thanks to Martyn for allowing me to update his guide.
I've recently started a project using dashing & it's worked well so far. So I thought I'd update his guide as it's been a bit fiddly recently & I've had to go through a lot of troubleshooting, so I've placed this guide here for anyone who wants to get started with dashing & are fed up with the standard LT HUD's.
I was advised there were resource issues with the dashing plugin for Labtech, so I've used this method intead & it works great.
Here's one of our dashboards for example:
This guide requires a PLAIN BUILD of Ubuntu 14.04 LTS 64 bit Server. The only software dependency you need on it is openssh so that you can 'Putty' in to it! It might also be a good idea, before the dashing installation to update/upgrade all current components of your Ubuntu VM.
- Due to the way in which the dashboard works (mainly 'send event' based), it will NOT WORK in Internet Explorer. (So, use a REAL browser like Chrome or Firefox!)
- All development takes place on Ubuntu 14.04 LTS, and there may be issues with other platforms. No assistance will be given for installations not using Ubuntu 14.04 LTS.
- I am going to install dashing with an instance name of rmm_hud. Please feel free to name your name whatever you want, but just be sure to change all instances of rmm_hud to your own preference
- All command lines are in green!
- The guide assumes that you already have 'some' experience in a linux environment!
- You will need an SSH client to access your linux environment with ease.
First off... let's install Ruby and obtain the necessary gems, and a couple of extra bits we will need:
Tip: Make yourself a cup of coffee whilst this is performing its configuration.
Tip: If you have problems with this, try running as “sudo”. Sometimes it can throw up a warning.
NOTE: Be patient with the roo gem install, it can take a few minutes to install. Do NOT cancel this.
Tip: Make another coffee or four, this takes a while.
Next up, we will change directories and Install Dashing:
NOTE: **** denote random characters. Be sure to replace the *****'s in the guide with what is on your system! To find out what 'the characters are' then do a ls -l command while in the /opt directory.
NOTE: This installs the 'Hotness Widget'.
NOTE: This installs the 'Weather Widget'. (Optional Step!)
NOTE: This installs the 'RSS/News Widget'. (Optional Step!)
NOTE: This installs the 'Server Status Widget'. (Optional Step!)
NOTE: This actually compiles the dashing install and creates the dashboard.
Use CTRL + C to stop dashing.
OK... So at this point, you should be able to navigate to http://ip.of.ubuntu.vm:3030 and see a dashboard! If you don't then carefully go over steps one more time, making sure you have not missed anything out. If you DO see your dashboard, let’s set dashing up as a service first, then we will start on getting your data in there!
Now that we have the base dashboard set up, next step is to make sure that it will run as a Service, so the process won’t end when you exit your putty session. To do this, we need to create a service file, and a folder so that it store its logs. One of Dashing's dependencies is 'thin'. This is a really lightweight web-service that the dashboard will run on. We can get this setup in just a few steps.
Reminder: If you chose not to use rmm_hud as your dashing instance name, be sure to change it on line 6!
Now that you have created the service that the dash will run on. Now we can start it!
NOTE: To RESTART the 'thin' service (i.e.: your dashboard) at ANY time, then the command for that is: sudo stop thin && sudo start thin
Now, let’s get the SQL set up and get some data in your dashboard!
Next up, we are going to create an 'odbc connection' to our LabTech server, to port 3306. This is done by creating a my_db.rb file.
If you want to create a READ-ONLY account in your LT Database, to use (almost like a service account) for this, then that can be done by running the following query in SqlYog:
Now, we will create another '.rb' file for a SQL query. Each query needs to be in it's own '.rb' file, and overtime you will have lots of these, so be sure to name appropriately and try and avoid spaces in your filenames!! For the purposes of the How-To Guide, we will create an agentcount.rb file. This will return the number of agents installed in your LT system. Please also consider when writing your queries (in your '.rb' files, make sure that they bring back a valid result in SQLyog first!!
The last thing we need to do in order for this result to show on your dashboard is program a widget to present the data. We will first need to create our own dashboard, which we call 'home' (by copying one that is already included) and then replacing an existing widget (or 'tile') with one that will show your query result.
Now, if everything works correctly, you should see the below image on your dashboard:
NOTE 1: Ensure that 'data-warm' value represents YOUR Total LT License count.
NOTE 2: Feel free to give your dash 'page' a new name - on Line 11.
NOTE 3: Every time you make a change to the home.erb file, you will need to restart dashing for change to take effect. (sudo stop thin && sudo start thin).
TIP 1: Change the default image in /assets/images/logo.png for the image widget (I’ve found the easiest way to get the file on there is to rename the old file ‘sudo mv logo.png logo2.png’ then download the new logo.png using ‘sudo wget http://url-to-download-image.png’)
TIP 2: Favicon change, same method used above & favicon is located in the /public directory.
TIP 3: Want more than 5 colums or the formatting is messed up? Add the below script to the top of your home.erb file.
Dashing.widget_base_dimensions = [370, 340]
Dashing.numColumns = 5
TIP 4: Test things, use your SQL code to get what you want.
TIP 5: if the page doesn’t load, or you get a timeout, or none of the tiles appear, remove or change back to whatever you just made a change to
TIP 6: when making large changes, always ensure to ‘sudo cp’ to make a backup copy of the file you are editing.