Command documentation sourced from the linux-command project This comprehensive command reference is part of the linux-command documentation project.
dris - Device Resource Information System
The dris command is a comprehensive device resource information system that provides detailed information about system hardware, device resources, and their current utilization. It enables system administrators and developers to monitor, analyze, and manage device resources efficiently. The tool offers real-time monitoring capabilities, resource allocation analysis, and detailed hardware profiling for troubleshooting and system optimization purposes.
Basic Syntax
dris [COMMAND] [OPTIONS] [DEVICE_SPECIFIERS]
Common Commands
list- List all available devices and their statusinfo- Show detailed information about specific devicesmonitor- Real-time monitoring of device resourcesstats- Display statistical information about resource usagecheck- Perform device health checksanalyze- Analyze resource allocation and bottlenecksreport- Generate comprehensive resource reports
Common Options
Device Selection
-a, --all- Show all devices including inactive ones-t {TYPE}- Filter by device type (cpu, memory, disk, network, gpu)-d {DEVICE}- Specify device name or ID-p {PATH}- Specify device path-i {ID}- Specify device ID
Output Options
-f {FORMAT}- Output format (table, json, xml, csv)-v, --verbose- Enable verbose output-q, --quiet- Suppress non-error output-c, --compact- Compact output format--color- Enable colored output--no-color- Disable colored output
Monitoring Options
-r {RATE}- Refresh rate in seconds-n {COUNT}- Number of samples to collect-l, --live- Live monitoring mode-s, --summary- Show summary only
Analysis Options
--deep- Perform deep analysis--quick- Quick analysis mode--history- Include historical data--compare- Compare with baseline--threshold {VAL}- Set alert threshold values
Usage Examples
Basic Device Information
Listing Devices
# List all active devices
dris list
# List all devices including inactive
dris list -a
# List specific device types
dris list -t cpu
dris list -t memory
dris list -t disk
dris list -t network
dris list -t gpu
# List devices in specific format
dris list -f json
dris list -f table
dris list -f csv
Getting Device Details
# Show detailed information about all CPUs
dris info -t cpu
# Show information about specific device
dris info -d /dev/sda
dris info -d eth0
# Show verbose information
dris info -v -t memory
# Show information in JSON format
dris info -f json -a
Real-time Monitoring
Live Monitoring
# Monitor all devices in real-time
dris monitor -l
# Monitor specific device type
dris monitor -t cpu -l
dris monitor -t memory -l
# Monitor with custom refresh rate
dris monitor -r 2 -l
# Monitor for specific duration
dris monitor -n 60 -r 1
# Monitor specific device
dris monitor -d /dev/sda -l
Resource Usage Tracking
# Monitor CPU usage
dris monitor -t cpu -v -r 1 -n 30
# Monitor memory utilization
dris monitor -t memory -r 5 -n 24
# Monitor disk I/O
dris monitor -t disk -v -l
# Monitor network statistics
dris monitor -t network -r 1 -l
Performance Analysis
System Analysis
# Perform comprehensive system analysis
dris analyze --deep
# Quick performance check
dris analyze --quick
# Analyze specific resources
dris analyze -t cpu --deep
dris analyze -t memory --history
dris analyze -t disk --compare
# Analyze with threshold alerts
dris analyze --threshold cpu:80 --threshold memory:90
Bottleneck Detection
# Detect system bottlenecks
dris analyze --bottleneck
# Analyze resource allocation
dris analyze --allocation
# Compare with baseline
dris analyze --compare --baseline baseline_2023.json
# Generate bottleneck report
dris analyze --bottleneck -f json > bottleneck_report.json
Health Checks
Device Health Monitoring
# Perform health check on all devices
dris check
# Check specific device types
dris check -t disk
dris check -t network
# Health check with detailed output
dris check -v
# Check specific device
dris check -d /dev/sda1
# Continuous health monitoring
dris check --continuous -r 300
SMART and Diagnostics
# Run SMART tests on disks
dris check -t disk --smart
# Perform network diagnostic tests
dris check -t network --diagnostic
# Memory integrity check
dris check -t memory --integrity
# CPU stress test
dris check -t cpu --stress
Statistical Analysis
Usage Statistics
# Display usage statistics
dris stats
# Statistics for specific period
dris stats --period 24h
dris stats --period 7d
# Statistics by device type
dris stats -t cpu
dris stats -t memory
# Export statistics
dris stats -f csv > usage_stats.csv
dris stats -f json > usage_stats.json
Historical Analysis
# Show historical trends
dris stats --history
# Historical data for specific device
dris stats --history -d /dev/sda
# Generate trend report
dris stats --trend --period 30d
Practical Examples
System Administration
Daily System Monitoring
#!/bin/bash
# Daily system health report
DATE=$(date +%Y%m%d)
REPORT_DIR="/var/reports/dris"
# Create report directory
mkdir -p "$REPORT_DIR"
# Generate comprehensive system report
dris analyze --deep -f json > "$REPORT_DIR/system_analysis_$DATE.json"
# Generate device summary
dris list -a -f table > "$REPORT_DIR/device_summary_$DATE.txt"
# Perform health checks
dris check -v > "$REPORT_DIR/health_check_$DATE.txt"
# Generate statistics
dris stats --history --period 24h -f csv > "$REPORT_DIR/usage_stats_$DATE.csv"
echo "Daily system report generated in $REPORT_DIR"
Resource Monitoring Script
#!/bin/bash
# Continuous resource monitoring
THRESHOLD_CPU=80
THRESHOLD_MEM=90
THRESHOLD_DISK=85
ALERT_EMAIL="admin@example.com"
while true; do
# Monitor CPU
CPU_USAGE=$(dris monitor -t cpu -n 1 -f json | jq '.usage_percent')
if (( $(echo "$CPU_USAGE > $THRESHOLD_CPU" | bc -l) )); then
echo "High CPU usage: $CPU_USAGE%" | mail -s "CPU Alert" "$ALERT_EMAIL"
fi
# Monitor Memory
MEM_USAGE=$(dris monitor -t memory -n 1 -f json | jq '.usage_percent')
if (( $(echo "$MEM_USAGE > $THRESHOLD_MEM" | bc -l) )); then
echo "High memory usage: $MEM_USAGE%" | mail -s "Memory Alert" "$ALERT_EMAIL"
fi
# Monitor Disk
DISK_USAGE=$(dris monitor -t disk -n 1 -f json | jq '.usage_percent')
if (( $(echo "$DISK_USAGE > $THRESHOLD_DISK" | bc -l) )); then
echo "High disk usage: $DISK_USAGE%" | mail -s "Disk Alert" "$ALERT_EMAIL"
fi
sleep 300 # Check every 5 minutes
done
Performance Optimization
Baseline Creation
#!/bin/bash
# Create performance baseline
BASELINE_FILE="/opt/dris/baselines/system_baseline.json"
DATE=$(date +%Y%m%d_%H%M%S)
# Generate comprehensive baseline
dris analyze --deep -f json > "/opt/dris/baselines/baseline_$DATE.json"
# Create symlink to latest baseline
ln -sf "baseline_$DATE.json" "$BASELINE_FILE"
# Generate device-specific baselines
for device in $(dris list -a -f json | jq -r '.devices[].name'); do
dris info -d "$device" -f json > "/opt/dris/baselines/${device}_baseline_$DATE.json"
done
echo "Performance baseline created: $DATE"
Performance Comparison
#!/bin/bash
# Compare current performance with baseline
BASELINE="/opt/dris/baselines/system_baseline.json"
REPORT_DIR="/var/reports/performance"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p "$REPORT_DIR"
# Generate current analysis
dris analyze --deep -f json > "$REPORT_DIR/current_$DATE.json"
# Compare with baseline
dris analyze --compare --baseline "$BASELINE" -f json > "$REPORT_DIR/comparison_$DATE.json"
# Generate human-readable report
dris analyze --compare --baseline "$BASELINE" -f table > "$REPORT_DIR/comparison_$DATE.txt"
echo "Performance comparison report generated"
Troubleshooting
Problem Diagnosis
#!/bin/bash
# System problem diagnosis
ISSUE_DATE=$(date +%Y%m%d_%H%M%S)
DIAG_DIR="/tmp/dris_diagnosis_$ISSUE_DATE"
mkdir -p "$DIAG_DIR"
echo "Collecting system diagnostic information..."
# System overview
dris list -a -v > "$DIAG_DIR/device_list.txt"
dris info -a -v > "$DIAG_DIR/device_details.txt"
# Performance analysis
dris analyze --deep -f json > "$DIAG_DIR/performance_analysis.json"
# Health checks
dris check -v > "$DIAG_DIR/health_check.txt"
# Resource monitoring snapshot
dris monitor -n 10 -r 1 -a -f json > "$DIAG_DIR/resource_monitoring.json"
# Recent statistics
dris stats --history --period 1h > "$DIAG_DIR/recent_stats.txt"
echo "Diagnostic information collected in: $DIAG_DIR"
echo "Review the files to identify potential issues"
Advanced Usage
Custom Queries
Complex Device Filtering
# Filter by device capabilities
dris list --filter "capability=ssd"
dris list --filter "interface=pcie"
# Filter by resource usage
dris list --filter "usage>50"
dris list --filter "temperature>60"
# Multiple filters
dris list --filter "type=network" --filter "status=active" --filter "speed>1000"
# Custom filtering
dris analyze --filter "name~nvme" --filter "size>500GB"
Advanced Monitoring
# Monitor with custom alerts
dris monitor --alert cpu:85,memory:90,disk:80 --live
# Monitor specific metrics
dris monitor --metrics usage,temperature,throughput -t cpu
# Conditional monitoring
dris monitor --condition "usage>70" --action "notify"
# Monitor with logging
dris monitor --log-file /var/log/dris_monitor.log --live
Integration with Other Tools
JSON Processing Integration
# Extract specific information using jq
dris info -a -f json | jq '.devices[] | select(.type=="disk") | {name, size, usage}'
dris monitor -t cpu -n 1 -f json | jq '.usage_percent'
# Generate custom reports
dris stats --history -f json | jq -r '.timeline[] | "\(.timestamp): \(.cpu_usage)%, \(.memory_usage)%"'
# Filter and process data
dris list -f json | jq -r '.devices[] | select(.status=="active") | .name' | xargs -I {} dris info -d {}
Database Integration
# Store monitoring data in database
dris monitor -n 1440 -r 60 -f json | \
jq -c '. + {timestamp: now}' | \
while read -r line; do
# Insert into database (example with sqlite)
sqlite3 /var/db/dris_monitoring.db "INSERT INTO monitoring (data) VALUES ('$line');"
done
# Query historical data
sqlite3 /var/db/dris_monitoring.db "SELECT data FROM monitoring WHERE timestamp > datetime('now', '-1 day');"
Automation and Scripting
Scheduled Tasks
Cron Jobs for Regular Monitoring
# Add to crontab for hourly monitoring
0 * * * * /usr/local/bin/dris_hourly_check.sh
# Add to crontab for daily reports
0 6 * * * /usr/local/bin/dris_daily_report.sh
# Add to crontab for weekly analysis
0 2 * * 0 /usr/local/bin/dris_weekly_analysis.sh
Systemd Service
# /etc/systemd/system/dris-monitor.service
[Unit]
Description=DRIS Resource Monitoring Service
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/dris monitor --live --systemd
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
# Enable and start the service
systemctl enable dris-monitor
systemctl start dris-monitor
systemctl status dris-monitor
Troubleshooting
Common Issues
Permission Issues
# Check if running with sufficient privileges
sudo dris list -a
# Set appropriate permissions
sudo chmod +s /usr/bin/dris
sudo usermod -a -G dris $USER
# Run with elevated privileges for full access
sudo dris analyze --deep
Device Access Problems
# Check device accessibility
dris list --check-access
# Fix permissions for specific devices
sudo chmod 660 /dev/device_name
sudo chown $USER:dris /dev/device_name
# Add user to appropriate groups
sudo usermod -a -G disk,input,dialout $USER
Performance Issues
# Use quick analysis instead of deep analysis
dris analyze --quick
# Reduce monitoring frequency
dris monitor -r 30 -l
# Filter to specific devices only
dris monitor -t cpu -l
# Use compact output
dris list --compact
Resource Overhead
# Monitor dris's own resource usage
dris self-monitor
# Reduce resource consumption
dris monitor --low-power
# Use batch mode for large datasets
dris analyze --batch
# Optimize for embedded systems
dris analyze --embedded
Related Commands
lshw- Hardware listerlscpu- CPU informationlsblk- Block device informationlsusb- USB device informationlspci- PCI device informationfree- Memory usage informationdf- Disk space informationiostat- I/O statisticsmpstat- CPU statisticsvmstat- Virtual memory statisticstop- Running processes and resource usagehtop- Interactive process viewernethogs- Network monitoring by processiotop- I/O monitoring by processsar- System activity reporterdmesg- Kernel ring buffer messages
Best Practices
- Regular monitoring - Set up continuous monitoring for critical systems
- Baseline creation - Create performance baselines during normal operation
- Threshold alerts - Configure appropriate alert thresholds for resources
- Historical data - Keep historical data for trend analysis
- Permission management - Ensure proper permissions for device access
- Resource planning - Use analysis data for capacity planning
- Documentation - Document normal operating parameters
- Automation - Automate regular checks and reports
- Backup configurations - Back up custom configurations and baselines
- Regular updates - Keep dris updated for latest features and bug fixes
Performance Tips
- Use filters - Filter to specific devices or types to reduce overhead
- Adjust refresh rates - Use appropriate refresh rates for different scenarios
- Batch processing - Use batch mode for large-scale analysis
- Compact output - Use compact output formats for scripts
- Parallel processing - Enable parallel processing when available
- Caching - Use caching for frequently accessed information
- Sampling - Use appropriate sampling intervals for monitoring
- Resource limits - Set resource limits for long-running processes
- Output format - Choose efficient output formats (JSON for processing)
- Selective monitoring - Monitor only what's necessary for your needs
The dris command provides a comprehensive solution for device resource monitoring and analysis, offering detailed insights into system hardware utilization and performance characteristics. Its extensive filtering capabilities, real-time monitoring features, and analysis tools make it an essential utility for system administrators, developers, and IT professionals managing complex computing environments.