logicminds / rubyipmi Goto Github PK
View Code? Open in Web Editor NEWCommand line wrapper for ipmitool and freeipmi
License: GNU Lesser General Public License v2.1
Command line wrapper for ipmitool and freeipmi
License: GNU Lesser General Public License v2.1
I know that freeipmi does not have user-manipulating ability, but ipmitool does and that's why it is an IPMI provider of choice for many organizations.
This functionality needs to be added to rubyipmi so subsequently that could be exposed as a proper RESTful API in Foreman Smart-Proxy, etc.
Please, add a BMC user manipulation ability to rubyipmi library so it can be exposed through Foreman BMC smart-proxy, for example.
freeipmi provider does not have this ability at all, so it is only ipmitool that can help with this.
Thanks!
Is anyone working on this already?
Could we please get a new release out? There's a patch fixing annoying issue causing deadlock ares@8c10192 which was merged 4 years ago. No release since then :-( I'm happy to help with that if you give me permissions on the repo and at rubygems.org. Thanks.
Its a fact. Vendor supplied firmware for controlling BMC devices is buggy. We simply cannot rely on vendors to supply working solutions that actual use the IPMI spec.
As a workaround we can create some rspec tests that uses rubyipmi to certify BMC devices.
The idea here is to ensure a baseline for each server that is being used can conform to a specific set of IPMI tasks.
If the test doesn't pass, don't buy the hardware!
@korekhov - I know you would really enjoy something like this since you gave me the idea. Do you have any spare cycles to detail what these tests should look like?
When I attempt to do a fru listing of an IBM x3650 M4, I get the following error:
irb(main):004:0> conn.fru.list
ArgumentError: invalid byte sequence in UTF-8
from .rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/fru.rb:82:in `block in parse'
from .rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/fru.rb:81:in `each'
from .rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/fru.rb:81:in `parse'
from .rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/fru.rb:53:in `list'
I'm using the following to connect to the system:
conn = Rubyipmi.connect("username", "password", "ip address", "freeipmi", {:driver => "lan20"} )
Oddly enough, if I run it again after the first attempt, it will return the expected values.
Please, add an ability to get the details from a particular sensor - "get " where "name" can be taken from either an output of "list" subcommand or "names".
Thanks!
In a7d5cd7 a task was added that depends on highline, but that dependency isn't used anywhere else. Does it really need to be a dependency or can it be a soft dependency?
Hi.
I'm using rubyipmi
and am troubled.
At a certain environment, Rubyipmi::Ipmitool::Sensors#getsensors
returns the data like below.
Ambient | 27.500 | degrees C | ok | na | 1.000 | 6.000 | 37.000 | 42.000 | na
Systemboard | 32.000 | degrees C | ok | na | na | na | 60.000 | 65.000 | na
CPU1 | 42.000 | degrees C | ok | na | na | na | 93.000 | 97.000 | na
CPU2 | 39.000 | degrees C | ok | na | na | na | 93.000 | 97.000 | na
DIMM-1A | 30.000 | degrees C | ok | na | na | na | 78.000 | 82.000 | na
...(snip)...
Ambient | 0x1 | discrete | 0x0280| na | na | na | na | na | na
CPU1 | 0x0 | discrete | 0x8080| na | na | na | na | na | na
CPU2 | 0x0 | discrete | 0x8080| na | na | na | na | na | na
DIMM-1A | 0x0 | discrete | 0x0280| na | na | na | na | na | na
...(snip)...
When I execute Rubyipmi::Ipmitool::Sensors#list
at this environment, only "discrete" values are returned. (0x1, 0x0, 0x0, ...)
Because Rubyipmi::Ipmitool::Sensors#parse
overwrites Sensor
that have same name.
I want to get both of "threshold data" (the former in above example) and "discrete data" by Rubyipmi::Ipmitool::Sensors#list
.
Do you have the plan improving this?
Thanks!
I remember there were some conversations on supporting SOL in rubyipmi, but don't see anything coming out of that. Is this still on a radar?
I'd love to have this functionality, but because of interactive nature of this particular feature, I'd like to understand the limitations. Maybe at least an ability to open read-only sessions that a user can redirect to a file or something?
Hi,
Since this is library like source code it would be better to have the license code to LGPL.
If all are in agreement I will switch to this to LGPL.
For those who have contributed, please respond to so that we all agree to this license change. (yes/no) is all that is needed.
@kiyohara
@lzap
@crhan
@spkane
Thanks everyone for the contributions thus far.
Both ipmitool and freeipmi support the use of /dev/ipmi to access the ipmi interface for the host that the command is being run on - i.e no host is specified on the command-line (-H/-h option).
Would it be possible to make the host argument to the connect method optional, so that these tools would then connect in this way instead of using a remote host?
Previously we were using travis. Since github actions came out we need to switch and also test supported ruby versions.
Its been an issue for a while and this is a difficult decision because folks with older servers now have to do more work but since 80% of the folks are using lan20 it now makes sense to go ahead and make this the default.
I consider this to be a breaking change but most users will welcome it. Additionally, this will reduce the number of calls made on the command line by 50% which is good.
In reference to #17 we need to refactor the runcmd to include a timeout.
Something like this, I'd imagine (very simplified version, but even that does not work for me, so looking for your guidance here):
module Rubyipmi::Ipmitool
class Raw < Rubyipmi::Ipmitool::BaseCommand
def initialize(opts = ObservableHash.new)
super("ipmitool", opts)
end
def raw_cmd(opt)
@options["cmdargs"] = "raw #{opt}"
value = runcmd
@options.delete_notify("cmdargs")
if value
@result
end
end
def test
raw_cmd("0x00")
end
end
end
WIth the following added to lib/rubyipmi/ipmitool/connection.rb
def raw
@raw ||= Rubyipmi::Ipmitool::Raw.new(@options)
end
I get the following output:
# irb
irb(main):001:0> require 'rubyipmi'
=> true
irb(main):002:0> conn = Rubyipmi.connect("root", "root", "<IP>", "ipmitool")
=> #<Rubyipmi::Ipmitool::Connection:0x000000011b2898 @options={"H"=>"<IP>", "U"=>"root", "P"=>"root", "I"=>"lanplus"}>
irb(main):003:0>
irb(main):004:0* conn.raw.test
=> nil
irb(main):005:0>
In addition to add gitlab-ci file, also create ability to auto deploy to rubygems.org.
Please, add SEL support into rubyipmi - useful monitoring and troubleshooting tool.
These are supported subcommands in ipmitool, but not all of them required, IMHO:
SEL Commands: info clear delete list elist get add time save readraw writeraw interpret
I think, these RO command must be exposed: info, list, elist, get , time
Plus, "clear", "delete " and "time " as RW ones.
The manpage is missing the description of "interpret" subcommand though :(
The gemspec says that the library is under GPLv3, but the LICENSE.txt looks more like MIT.
Could you clarify this?
Both ipmitool and freeipmi assume a default privilege level for the connection (administrator and operator respectively). This will result in an error if the user isn't at this level.
Both toolsets have a flag to pass in a specific priv (-L and -l) - can rubyipmi be extended to support setting the privilege level in the connection object?
Thanks!
I am using rubyipmi through foreman for ipmi power operations. I am able to successfully perform a power cycle on a Dell R720 via the iDRAC interface when using this command:
ipmipower -D LAN_2_0 -h hostname -u root -p --stat
I configured my /etc/freeipmi.conf file to reflect the LAN_2_0 driver so that option will be passed every time ipmipower is ran but this still doesn't seem to help rubyipmi.
Any help would greatly be appreciated.
Justin
when using:
/usr/sbin/ipmi-sensors --hostname=fox02 --driver-type=LAN_2_0 --no-header-output --output-sensor-state --entity-sensor-names --config-file=/tmp/20151102-15221-ce12l
the following is observed:
logs
4 | System Board 1 SEL Fullness | Event Logging Disabled | Nominal | N/A | N/A | 'OK'
5 | System Board 1 12V Standby | Voltage | Nominal | 12.16 | V | 'OK'
6 | System Board 1 5V Standby | Voltage | Nominal | 5.08 | V | 'OK'
7 | System Board 1 5V | Voltage | Nominal | 5.03 | V | 'OK'
8 | System Board 1 3.3V Standby | Voltage | Nominal | 3.43 | V | 'OK'
9 | System Board 1 3.3V | Voltage | Nominal | 3.35 | V | 'OK'
11 | System Board 1 MEZZ1 TEMP | Temperature | Nominal | 41.00 | C | 'OK'
2 | Processor 2 P2 ThermalTrip | Processor | N/A | N/A | N/A | N/A
1 | Processor 1 P1 ThermalTrip | Processor | N/A | N/A | N/A | N/A
3 | Processor 1 CPU ERR2 | Processor | N/A | N/A | N/A | N/A
12 | Processor 1 CPU1 Temp | Temperature | Nominal | 44.00 | C | 'OK'
13 | Processor 1 CPU2 Temp | Temperature | N/A | N/A | C | N/A
14 | Processor 1 DIMM ZONE 1 Temp | Temperature | Nominal | 35.00 | C | 'OK'
15 | Processor 1 DIMM ZONE 2 Temp | Temperature | N/A | N/A | C | N/A
18 | Processor 1 PCH Temp | Temperature | Nominal | 43.00 | C | 'OK'
19 | System Board 2 Watchdog | Watchdog 2 | Nominal | N/A | N/A | 'OK'
22 | Power Supply 1 AC lost | Power Unit | N/A | N/A | N/A | N/A
23 | Memory Module Memory | Memory | N/A | N/A | N/A | N/A
25 | Power Supply 2 Sys Pwr Monitor | System ACPI Power State | N/A | N/A | N/A | N/A
26 | Battery Battery low | Battery | Nominal | N/A | N/A | 'OK'
29 | Processor 1 M2090 Temp 1 | Temperature | N/A | N/A | C | N/A
30 | Processor 1 M2090 PWR 1 | Other Units Based Sensor | N/A | N/A | W | N/A
31 | Processor 1 M2090 Temp 2 | Temperature | N/A | N/A | C | N/A
32 | Processor 1 M2090 PWR 2 | Other Units Based Sensor | N/A | N/A | W | N/A
35 | Power Supply 2 M2090 STATUS 1 | OEM Reserved | N/A | N/A | N/A | N/A
36 | Power Supply 2 M2090 STATUS 2 | OEM Reserved | N/A | N/A | N/A | N/A
38 | Add-in Card GPGPU Insert | Add In Card | N/A | N/A | N/A | N/A
39 | Processor 1 MIC Temp 1 | Temperature | N/A | N/A | C | N/A
40 | Processor 1 MIC PWR 1 | Other Units Based Sensor | N/A | N/A | W | N/A
48 | Processor 1 MIC Temp 2 | Temperature | N/A | N/A | C | N/A
16 | Processor 1 MIC PWR 2 | Other Units Based Sensor | N/A | N/A | W | N/A
45 | Power Supply 2 MIC STATUS 1 | OEM Reserved | N/A | N/A | N/A | N/A
46 | Power Supply 2 MIC STATUS 2 | OEM Reserved | N/A | N/A | N/A | N/A
42 | Chassis Specific NPDB Status | Power Unit | N/A | N/A | N/A | N/A
53 | Chassis Specific SC FW Status | Management Subsystem Health | Nominal | N/A | N/A | 'OK'
49 | Air Inlet Inlet Temp | Temperature | Nominal | 26.00 | C | 'OK'
51 | Power Management Input Voltage | Voltage | Nominal | 11.97 | V | 'OK'
52 | Power Management Input Current | Current | Nominal | 3.00 | A | 'OK'
54 | Chassis Specific PSU 1 Status | Power Supply | Critical | N/A | N/A | 'Presence detected' 'Power Supply Failure detected' 'Power Supply input lost (AC/DC)'
96 | Fan 96 FAN_1 | Fan | Nominal | 6790.00 | RPM | 'OK'
97 | Fan 97 FAN_2 | Fan | Nominal | 6790.00 | RPM | 'OK'
98 | Fan 98 FAN_3 | Fan | Nominal | 6790.00 | RPM | 'OK'
99 | Fan 99 FAN_4 | Fan | Nominal | 6860.00 | RPM | 'OK'
112 | Chassis Specific PSU Mismatch | Power Supply | Nominal | N/A | N/A | 'OK'
113 | Chassis Specific PSU Redundancy | Power Supply | Nominal | N/A | N/A | 'OK'
E, [2015-11-02T17:44:10.262389 #15221] ERROR -- : undefined method `gsub' for nil:NilClass
D, [2015-11-02T17:44:10.262490 #15221] DEBUG -- : /home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:93:in `normalize'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:88:in `initialize'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:76:in `new'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:76:in `block in parse'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:74:in `each'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:74:in `parse'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:15:in `list'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:30:in `fanlist'
this is using dell PowerEdge C6220
I noticed there is no support for the BMC remote shell.
ipmitool -H {YOUR BMC IP} -U {YOUR USER} -I lanplus sol activate
or
ipmiconsole -h {YOUR BMC IP} -u {YOUR USER} -p {YOUR PASSWORD}
on freeipmi are both ways to get it.
I'd be happy to do it and submit a pull request if you give me a few pointers on the right direction. Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.