forked from ewilhelm/panoptimon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# 0.5.3 | ||
|
||
* collectors/fma - solaris faults collector | ||
|
||
# 0.5.2 | ||
|
||
* collectors/service - solaris (smf) implementation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Description | ||
|
||
Report solaris FMA faults. Specifically, `fmadm faulty -r`. | ||
|
||
# Configuration | ||
|
||
* `fmadm` — path to fmadm command (or array with arguments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
echo 'fmd:///module/ses-log-transport degraded | ||
fmd:///module/eft degraded | ||
' | ||
# fmd:///module/just-pretending not working' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
# Copyright (C) 2014 Cisco, Inc. | ||
|
||
require 'json' | ||
class Array; def to_h; Hash[self]; end; end | ||
|
||
opt = JSON::parse(ARGV[0], {symbolize_names: true}) | ||
|
||
cmd = [opt[:fmadm] || 'fmadm'].flatten | ||
|
||
faults = IO.popen(cmd + ['faulty', '-r']) {|fh| fh.readlines("\n") }. | ||
map {|fault| fault.chomp.split(/\s+/, 2)}.to_h | ||
raise "fmadm error - #{$?.exitstatus}" unless $?.success? | ||
|
||
# SmartOS-specific bug | ||
skip = %w( | ||
fmd:///module/ses-log-transport | ||
fmd:///module/eft | ||
).map {|n| [n, true]}.to_h | ||
|
||
faults.keys.each {|k| faults.delete(k) if skip[k]} | ||
|
||
metrics = { | ||
faults: faults.keys.count, | ||
} | ||
metrics[:_info] = faults if faults.keys.count > 0 | ||
|
||
puts JSON::generate(metrics) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Copyright (C) 2012-2014 Cisco, Inc. | ||
|
||
module Panoptimon | ||
VERSION = "0.5.2" | ||
VERSION = "0.5.3" | ||
end |