Sensu Windows Plugins
PowerShell Ruby
Clone or download
Latest commit 6d8e567 May 11, 2018

README.md

Sensu-Plugins-Windows

Build Status Gem Version Code Climate Test Coverage Dependency Status Appveyor status Community Slack

Functionality

These files provide basic Checks and Metrics for a Windows system.

Files

Ruby

  • bin/check-windows-cpu-load.rb
  • bin/check-windows-disk.rb
  • bin/check-windows-process.rb
  • bin/check-windows-processor-queue-length.rb
  • bin/check-windows-ram.rb
  • bin/check-windows-service.rb
  • bin/metric-windows-cpu-load.rb
  • bin/metric-windows-disk-usage.rb
  • bin/metric-windows-network.rb
  • bin/metric-windows-processor-queue-length.rb
  • bin/metric-windows-ram-usage.rb
  • bin/metric-windows-uptime.rb
  • bin/powershell_helper.rb

Powershell

  • bin/powershell/check-windows-cpu-load.ps1
  • bin/powershell/check-windows-disk.ps1
  • bin/powershell/check-windows-disk-writeable.ps1
  • bin/powershell/check-windows-pagefile.ps1
  • bin/powershell/check-windows-process.ps1
  • bin/powershell/check-windows-processor-queue-length.ps1
  • bin/powershell/check-windows-ram.ps1
  • bin/powershell/check-windows-service.ps1
  • bin/powershell/metric-windows-cpu-load.ps1
  • bin/powershell/metric-windows-disk-usage.ps1
  • bin/powershell/metric-windows-network.ps1
  • bin/powershell/metric-windows-processor-queue-length.ps1
  • bin/powershell/metric-windows-ram-usage.ps1
  • bin/powershell/metric-windows-uptime.ps1
  • bin/powershell/check-windows-directory.ps1
  • bin/powershell/check-windows-event-log.ps1
  • bin/powershell/check-windows-log.ps1

Usage

Example 1:

Execute Powershell functions using the helper (No copy needed), see example below:

  {
    "checks": {
      "cpu_percent": {
        "command": "c:\\opt\\sensu\\embedded\\bin\\ruby C:\\opt\\sensu\\embedded\\bin\\powershell_helper.rb check-windows-ram.ps1 90 95",
        "interval": 30,
        "type": "check",
        "handler": "win_metrics",
        "subscribers": ["win_metrics"]
      }
    }
  }
Example 2:
  • Copy either the Ruby or Powershell files on a Sensu Client, typically under C:\etc\sensu\plugins.

  • You should also include the full escaped path to the ruby interpreter in the check's command configuration, see example below:

  {
    "checks": {
      "cpu_percent": {
        "command": "c:\\opt\\sensu\\embedded\\bin\\ruby C:\\opt\\sensu\\etc\\plugins\\metric-windows-cpu-load.rb",
        "interval": 30,
        "type": "metric",
        "handler": "win_metrics",
        "subscribers": ["win_metrics"]
      }
    }
  }

You should also include the full escaped path to the ruby interpreter in the check's command configuration, see example below:

{
  "checks": {
    "cpu_percent": {
      "command": "c:\\opt\\sensu\\embedded\\bin\\ruby C:\\opt\\sensu\\etc\\plugins\\metric-windows-cpu-load.rb",
      "interval": 30,
      "type": "metric",
      "handler": "win_metrics",
      "subscribers": ["win_metrics"]
    }
  }
}

Dependencies

  • Powershell checks require Powershell version 3.0 or higher.

Installation

Installation and Setup