Jump to content
Bobs16

My Dashing HUD

Recommended Posts

Sharing my Dashing RMM HUD for my company. Big thanks to the install/initial set up guide.

P5x9PVZ.png

 

Job failures is for our managed backup (Shadow Protect). Information is gathered via sql queries from labtech.

Offline servers and ESET infections are gathered via sql queries from labtech.

Weekly Time and Open tickets are using Connectwise's API via Powershell. They are also posted to dashing using powershell.

 

I still have a few things I want to add to it.

Share this post


Link to post
Share on other sites

Here is what my board looks like now.

QAv1zgi.png

 

offlineserver.rb:

 require_relative 'my_db.rb'

       SCHEDULER.every '30s', :first_in => 0 do |job|
               db = MyDb.conn
               sql = "SELECT name,lastcontact FROM computers WHERE computers.`LastContact` < DATE_ADD(NOW(),INTERVAL - 300 SECOND) AND (computers.os LIKE '%server%')"
               results = db.query(sql)


               servers = results.map do |row|
               row = {
               :label => row['name'],
               :value => row['lastcontact'].strftime("%m-%d %H:%M")
}
end

               send_event('offlineserver', { items: servers } )




       db.close
       end

 

esetinfections.rb:

require_relative 'my_db.rb'

       SCHEDULER.every '300s', :first_in => 0 do |job|
               db = MyDb.conn
               sql = "SELECT computer_name,date_occurred,threat,action FROM plugin_eset_ra_threat WHERE plugin_eset_ra_threat.date_occurred > DATE_ADD(NOW(),INTERVAL - 24 HOUR)"
               results = db.query(sql)


               servers = results.map do |row|
               row = {
               :label => row['computer_name'],
               :value => row['date_occurred'].strftime("%m-%d %H:%M") + " | " + row['threat'] + " | " + row['action']
}
end

               send_event('esetinfections', { items: servers } )




       db.close
       end

 

backupfailure.rb:

 

require_relative 'my_db.rb'

       SCHEDULER.every '300s', :first_in => 0 do |job|
               db = MyDb.conn
               sql = "SELECT name,nextruntime FROM (spjobs JOIN computers ON spjobs.computerid=computers.computerid ) WHERE spjobs.laststatus = 7"
               results = db.query(sql)


               servers = results.map do |row|
               row = {
               :label => row['name'],
               :value => row['nextruntime'].strftime("%m-%d %H:%M")
}
end

               send_event('backupfailure', { items: servers } )




       db.close
       end

 

 

For the widgets which are populated by powershell all you need is a

inside of your dashboard file. Such as:

    



 

And then use powershell to post the data. Here is one example for the CW employee billable time. This runs on a timer of 300 seconds.

 

$password = @{
    'CompanyId' = 'insertcompanyname';
   'IntegratorLoginId' = 'inserintergratorloginid';
   'IntegratorPassword' = 'insertpw'
}
$TimeEntry ="https://yourcompany.com/v4_6_release/apis/2.0/TimeEntryApi.asmx?wsdl"
function Add-CWService {
[CmdletBinding()]
param(
[string]$api
)

New-WebServiceProxy -Uri $api

}

   $api = Add-CWService $TimeEntry

   $date = Get-Date -Hour 0 -Minute 0 -Second 0 
   Switch ($date.DayOfWeek){
       Sunday {$TimeObj = $date.AddDays(-6); break}
       Monday {$TimeObj = $date; break}
       Tuesday {$TimeObj = $date.AddDays(-1); break}
       Wednesday {$TimeObj = $date.AddDays(-2); break}
       Thursday {$TimeObj = $date.AddDays(-3); break}
       Friday {$TimeObj = $date.AddDays(-4); break}
       Saturday {$TimeObj = $date.AddDays(-5); break}

   }
   $Employees = "Name one","Name two", "Name Three"
   $items = @()
   foreach ($Employee in $Employees){
       $TimeEntries = $api.FindTimeEntries($password,"MemberName = '$Employee' AND Startdate >= [$TimeObj]",$null,$null,$null,$null) | select -ExpandProperty HoursBilled
       if ($TimeEntries){
           $hours = $TimeEntries | Measure-Object -Sum | select -ExpandProperty sum
       } else {
           $hours = 0
       }
       $items += @{label = "$Employee"; value = "$hours"}
   }
   $props = [ordered] @{
       auth_token = "YOUR_AUTH_TOKEN"
       items = $items
   }
   $body = New-Object -TypeName psobject -Property $props
   $JSONObj = Convertto-json -InputObject $body

   Invoke-RestMethod -Uri "http://172.20.11.113:3030/widgets/employeetime" -Method Post -Body $JSONObj -ContentType "application/json"

Share this post


Link to post
Share on other sites

Looking good! I'm new to this one. Used to use the plugin but i'm working on a seperate ubuntu dash.

 

Would you be able to post some more jobs? I'm still looking for a way to get the Graph, Meter and Number widget to work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×