
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
eaton
Advanced tools
A Ruby gem and CLI for managing Eaton Rack PDU G4 devices via REST API. Provides comprehensive power monitoring and management capabilities.
Add to your Gemfile:
gem 'eaton'
Or install directly:
gem install eaton
For development:
git clone https://github.com/usiegj00/eaton.git
cd eaton
bundle install
# Get overall power consumption
eaton power \
--host pdu.example.com \
--username admin \
--password your_password
# Get active outlets only (text mode)
eaton outlets \
--host pdu.example.com \
--username admin \
--password your_password
# Get all outlets as JSON
eaton outlets \
--host pdu.example.com \
--username admin \
--password your_password \
--format json
All commands support these options:
--host - PDU hostname or IP (required)--port - PDU port (default: 443)--username - PDU username (required)--password - PDU password (required)--host-header - Custom Host header for SSH tunneling (optional)--verify-ssl - Verify SSL certificates (default: false)--format - Output format: text or json (default: text)| Command | Description |
|---|---|
eaton auth | Test authentication |
eaton info | Display PDU device information |
eaton power | Get overall power consumption (watts) |
eaton outlets | Get per-outlet power consumption |
eaton branches | Get per-branch power distribution |
eaton detailed | Get detailed power metrics |
Text Mode (default):
JSON Mode (--format json):
eaton info --host pdu.example.com --username admin --password secret
Output:
PDU Device Information:
============================================================
id: 1
name: PDU
model: Eaton Rack PDU G4
serial_number: ABC123
vendor: Eaton
firmware_version: 2.9.2
status: in service
health: ok
nominal_power: 19800
nominal_current: 55
nominal_voltage: 208
eaton power --host pdu.example.com --username admin --password secret
Output:
Overall Power:
============================================================
watts: 1542.3
eaton outlets --host pdu.example.com --username admin --password secret
Shows only outlets currently drawing power.
eaton outlets \
--host pdu.example.com \
--username admin \
--password secret \
--format json > outlets.json
When connecting through an SSH tunnel:
# SSH tunnel to remote PDU
ssh -L 5000:192.168.1.100:443 user@jumphost
# Connect via tunnel with custom host header
eaton power \
--host localhost \
--port 5000 \
--username admin \
--password secret \
--host-header 192.168.1.100
Use the gem programmatically in your Ruby code:
require 'eaton'
# Create client
client = Eaton::Client.new(
host: 'pdu.example.com',
username: 'admin',
password: 'secret',
verify_ssl: true
)
# Get PDU info
info = client.info
puts "#{info[:model]} - #{info[:serial_number]}"
# Get overall power
power = client.power
puts "Current draw: #{power} watts"
# Get active outlets
outlets = client.outlets
outlets.select { |o| o[:watts] > 0 }.each do |outlet|
puts "#{outlet[:name]}: #{outlet[:watts]}W"
end
# Get branch distribution
branches = client.branches
branches.each do |branch|
puts "#{branch[:name]}: #{branch[:current]}A @ #{branch[:voltage]}V"
end
# Get detailed metrics
detailed = client.detailed
puts "Power Factor: #{detailed[:overall][:power_factor]}"
puts "Frequency: #{detailed[:overall][:frequency]} Hz"
# Clean up
client.logout
The gem interfaces with these REST API endpoints:
/powerDistributions/1 - PDU device information/powerDistributions/1/inputs/1 - Overall power input/powerDistributions/1/outlets/{id} - Individual outlet data/powerDistributions/1/branches/{id} - Branch distribution dataTested and verified with:
/rest/mbdetnrs/2.0Should work with other Eaton PDU models using the same API version.
Uses OAuth2 bearer token authentication:
/oauth2/token/Authorization: Bearer {token} header# Clone repository
git clone https://github.com/usiegj00/eaton.git
cd eaton
# Install dependencies
bundle install
# Run tests
bundle exec rspec
# Install locally
bundle exec rake install
git checkout -b feature/my-feature)git commit -am 'Add some feature')git push origin feature/my-feature)MIT License - see LICENSE file for details
Developed for managing Eaton Rack PDU G4 devices via REST API.
FAQs
Unknown package
We found that eaton demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.