Skip to content

Commit

Permalink
Merge pull request #27 from jhoblitt/feature/megaraid_facts
Browse files Browse the repository at this point in the history
add `-NoLog` flag to all invocations of `megacli`
  • Loading branch information
Joshua Hoblitt committed May 16, 2014
2 parents 11010b0 + ea4af30 commit c870d59
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 10 deletions.
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Puppet smartd Module
* [Parameters](#parameters)
* [Pedantic Example](#pedantic-example)
* [Hiera Data Bindings](#hiera-data-bindings)
* [Facts](#facts)
4. [Limitations](#limitations)
* [Tested Platforms](#tested-platforms)
5. [Versioning](#versioning)
Expand Down Expand Up @@ -277,6 +278,87 @@ smartd::devices:
options: '-a -o on -S on -s (S/../.././18|L/../../3/20|C/../.././19)'
```
### Facts
#### `megacli`

Path to the `MegaCli` executable. Example:

megacli => /usr/bin/MegaCli

#### `megacli_version`

Version string of the `MegaCli` executable. Example:

megacli_version => 8.07.07

#### `megaraid_adapters`

The count of LSI MegaRAID adapters detected in the system. *Note that this
module presently only supports a single adapter per system.* Example:

megaraid_adapters => 1

#### `megaraid_fw_package_build`

The LSI MegaRAID adapter firmware package string. Example:

megaraid_fw_package_build => 23.22.0-0012

#### `megaraid_fw_version`

The LSI MegaRAID adapter firmware version string. Example:

megaraid_fw_version => 3.340.05-2939

#### `megaraid_physical_drives`

The LSI MegaRAID unique device ID(s) for all attached disks. Example:

megaraid_physical_drives => 116,117,120,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207

#### `megaraid_physical_drives_sas`

The LSI MegaRAID unique device ID(s) for only attached ####SAS* disks. Example:

megaraid_physical_drives_sas => 116,117,120,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207

#### `megaraid_physical_drives_sata`

The LSI MegaRAID unique device ID(s) for only attached ####SATA* disks. Example:

megaraid_physical_drives_sata => 141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186

#### `megaraid_product_name`

The LSI MegaRAID product name string. Example:

megaraid_product_name => LSI MegaRAID SAS 9286CV-8e

#### `megaraid_serial`

The LSI MegaRAID serial number string. Example:

megaraid_serial => SV22925366

#### `megaraid_virtual_drives`

A listing of `/dev/<foo>` devices exported by a LSI MegaRAID controller. Example:

megaraid_virtual_drives => sda,sdb,sdc,sdd,sde,sdf,sdg,sdh,sdk,sdl

#### `smartd`

Path to the `smartd` executable. Example:

smartd => /usr/sbin/smartd

#### `smartmontools_version`

Version of the install `smartmontools` package. Example:

smartmontools_version => 5.43


Limitations
-----------
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/megacli_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setcode do
unless megacli.nil?
output = Facter::Util::Resolution.exec("#{megacli} -Version -Cli -aALL")
output = Facter::Util::Resolution.exec("#{megacli} -Version -Cli -aALL -NoLog")
next if output.nil?
m = output.match(/MegaCLI SAS RAID Management Tool Ver ([\d\.]+)/)
next unless m.size == 2
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/megaraid_fw_package_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setcode do
unless megacli.nil?
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL")
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL -NoLog")
next if output.nil?
m = output.match(/Fw Package Build : ([\d\.\-]+)\s*$/)
next unless m.size == 2
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/megaraid_fw_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setcode do
unless megacli.nil?
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL")
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL -NoLog")
next if output.nil?
m = output.match(/FW Version : ([\d\.\-]+)\s*$/)
next unless m.size == 2
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/megaraid_product_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setcode do
unless megacli.nil?
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL")
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL -NoLog")
next if output.nil?
m = output.match(/Product Name : (.+)\s*$/)
next unless m.size == 2
Expand Down
2 changes: 1 addition & 1 deletion lib/facter/megaraid_serial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setcode do
unless megacli.nil?
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL")
output = Facter::Util::Resolution.exec("#{megacli} -Version -Ctrl -aALL -NoLog")
next if output.nil?
m = output.match(/Serial No : (\S+)\s*$/)
next unless m.size == 2
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facts/megacli_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'should get the version string' do
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Cli -aALL').
with('/usr/bin/MegaCli -Version -Cli -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-cli-aall-8.07.07')))
Facter.fact(:megacli_version).value.should == '8.07.07'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facts/megaraid_fw_package_build_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'should get the version string' do
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL').
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_fw_package_build).value.should == '23.22.0-0012'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facts/megaraid_fw_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'should get the version string' do
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL').
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_fw_version).value.should == '3.340.05-2939'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facts/megaraid_product_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'should get the version string' do
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL').
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_product_name).value.should == 'LSI MegaRAID SAS 9286CV-8e'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facts/megaraid_serial_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'should get the version string' do
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL').
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_serial).value.should == 'SV22925366'
end
Expand Down

0 comments on commit c870d59

Please sign in to comment.