Jump to content
[[Template core/front/profile/profileHeader is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Community Reputation

0 Neutral

My Information

  • Agent Count
    500+
  1. With the help of LabTechRob's post: viewtopic.php?f=8&t=393 I used a remote monitor and powershell to accomplish basic Hyper-V Replication and StoragePool monitoring in Server 2012. *This is a high level monitor which parses for any error - Not per VM or Pool granularity. Configured searches / groups for 2012 HyperVisors / 2012 Physicals, and applied Remote Monitors to those groups. ** I did notice when creating the exe check monitor, and configuring the check case to NotContains - String (In the Monitor Wizard) - the resulting Remote Monitor's Condition is set to Equals - OK ... (not NotContains - String) ... Had to manually go in and reconfigure monitor ** When configuring the Monitors, I used these parameters: EXE: %windir%\System32\WindowsPowerShell\v1.0\powershell.exe ARGS: -noprofile "& { get-vmreplication|fl State }" Condition: NotContains (one per monitor) Suspended Replicating Error ARGS: -noprofile "& { get-vmreplication|fl Health }" Condition: NotContains Critical Warning ARGS: -noprofile "& { Get-StoragePool|fl OperationalStatus }" Condition: NotContains Degraded ARGS: -noprofile "& { Get-StoragePool|fl HealthStatus }" Condition: NotContains Warning
  2. I noticed this defaulted all tiles to be clickable... To get around this, I added an if check (below), then in the div, added data-url=1 if I wanted it to be clickable (As well as data-link="http://your-url-here")
  3. Colin

    Slack Notifier

    Register at Slack.com Create a channel for your Team Configure a Custom Incoming WebHooks Integration Install the app on your phone (Optional, but it will receive push notifications) ##Replace Your Unique Webhook URL accordingly (In @@uri)! root@mikrodash:/opt/dashing/rmm_hud# cat jobs/SlackNotifier.rb require 'net/http' require 'json' require 'uri' class SlackNotifier @@uri = URI.parse("PASTE_URI_HERE") @@header = {'Content-Type' => "text/json"} def notifySlack(notification) # Create the HTTP objects @http = Net::HTTP.new(@@uri.host, @@uri.port) @http.use_ssl = true @request = Net::HTTP::Post.new(@@uri.request_uri, @@header) @request.body = notification.to_json # Send the request @http.request(@request) end end ##Basic example of Use root@mikrodash:/opt/dashing/rmm_hud# cat jobs/offlineservercount.rb require_relative 'my_db.rb' require_relative 'SlackNotifier.rb' current_offlineservercount = 0 firstRun = true SCHEDULER.every '30s', :first_in => 0 do |job| db = MyDb.conn sn = SlackNotifier.new sql = "SUPER SQL!" notif = "New Offline Server!!\n" results = db.query(sql) if results.count > current_offlineservercount results.each do|row| name = row['name'] notif = notif + name + "\n" end tmpNotif = {'text' => notif} if !firstRun then sn.notifySlack(tmpNotif) end end current_offlineservercount = results.count firstRun = false db.close send_event('offlineservercount', { value: current_offlineservercount } ) end Yay!!
×
×
  • Create New...