Command Examples & Usage

Detailed examples of all SmartOps commands with natural language variations and expected responses for EC2 management in Teams.

Command Categories

Instance Management

List Instances

Shows all EC2 instances with current status and basic metrics.

Natural Language Examples:

  • “What instances do I have?”
  • “Show me all EC2 instances”
  • “List my servers”

Direct Command:

$$@Ohlala SmartOps list instances$$

Response Format:

$$πŸ“Š EC2 Instance Summary Found 5 instances in us-east-1 βœ… web-server-01 (i-0abc123def) Type: t3.medium | State: running CPU: 45% | Memory: 62% | Disk: 38% ⚠️ database-01 (i-0def456ghi) Type: m5.large | State: running CPU: 78% | Memory: 85% | Disk: 72% [... more instances ...]$$

Get Instance Details

Detailed information about a specific instance.

Natural Language Examples:

  • “Tell me about instance i-0abc123def”
  • “Show details for web-server-01”
  • “What’s the configuration of my database server?”

Direct Command:

$$@Ohlala SmartOps describe instance $$

Response Format:

$$πŸ“‹ Instance Details: web-server-01 Instance ID: i-0abc123def Type: t3.medium (2 vCPU, 4 GB RAM) State: running (since 2024-03-15 10:30 UTC) Platform: Amazon Linux+ AZ: us-east-1a Private IP: 10.0.1.45 Public IP: 54.123.45.67 Tags: - Name: web-server-01 - Environment: production - Team: platform Monitoring: - CPU: 45% (avg last hour) - Memory: 62% (current) - Network In: 125 MB/hour - Network Out: 450 MB/hour$$

Health Monitoring

Health Report

Comprehensive health status of all instances.

Natural Language Examples:

  • “Show me the health report”
  • “How healthy are my instances?”
  • “Give me a status update”

Direct Command:

$$@Ohlala SmartOps health report$$

Response Format:

$$πŸ₯ Infrastructure Health Report Generated: 2024-03-20 14:30 UTC Overall Health: ⚠️ ATTENTION NEEDED Summary: βœ… Healthy: 12 instances ⚠️ Warning: 3 instances ❌ Critical: 1 instance Issues Requiring Attention: ❌ CRITICAL: app-server-03 - CPU: 95% (sustained for 30 min) - Action: Consider scaling or investigating process ⚠️ WARNING: database-01 - Disk: 85% full - Action: Clean up logs or expand storage ⚠️ WARNING: web-cache-02 - Memory: 88% utilized - Action: Monitor for OOM issues πŸ“ˆ Trends: - CPU usage up 15% from yesterday - 2 new instances added this week - Cost trending 8% over budget$$

Instance Health Check

Check health of specific instance.

Natural Language Examples:

  • “Is web-server-01 healthy?”
  • “Check the health of i-0abc123def”
  • “How is my database server doing?”

Direct Command:

$$@Ohlala SmartOps check health $$

Cost Optimization

Cost Analysis

Analyze EC2 costs and identify savings opportunities.

Natural Language Examples:

  • “Analyze my EC2 costs”
  • “Where can I save money?”
  • “Show me cost optimization opportunities”

Direct Command:

$$@Ohlala SmartOps cost analysis$$

Response Format:

$$πŸ’° EC2 Cost Analysis Report Period: Last 30 days Current Spending: - Total: $3,456.78 - On-Demand: $2,890.45 (84%) - Reserved: $566.33 (16%) - Spot: $0.00 (0%) Top Recommendations: 1. 🎯 Right-size Overprovisioned Instances Potential Savings: $456/month (13%) - web-server-01: t3.medium β†’ t3.small Current: 15% CPU avg β†’ Save $28/month - test-server-02: m5.xlarge β†’ m5.large Current: 8% CPU avg β†’ Save $95/month 2. πŸ’Ό Purchase Reserved Instances Potential Savings: $890/month (26%) - 5 instances running 24/7 - Recommend 1-year no upfront RIs 3. πŸŒ™ Implement Schedule-Based Scaling Potential Savings: $234/month (7%) - Dev/test instances can be stopped nights/weekends - 10 instances identified Total Potential Savings: $1,580/month (46%)$$

Rightsizing Recommendations

Get specific rightsizing suggestions.

Natural Language Examples:

  • “Which instances should I rightsize?”
  • “Show me oversized instances”
  • “Find underutilized servers”

Direct Command:

$$@Ohlala SmartOps rightsizing recommendations$$

Troubleshooting

Troubleshoot Instance

AI-guided troubleshooting for instance issues.

Natural Language Examples:

  • “My web server is slow”
  • “Help me troubleshoot i-0abc123def”
  • “Database connections are timing out”

Direct Command:

$$@Ohlala SmartOps troubleshoot $$

Interactive Response:

$$πŸ”§ Troubleshooting Assistant I'll help you troubleshoot web-server-01. Let me gather some information... Current Status: - Instance is running - CPU: 45% (normal) - Memory: 92% (HIGH) - Disk I/O: Normal - Network: Normal ⚠️ High memory usage detected! Let me check what's consuming memory... [Running diagnostic commands via SSM] Top Memory Consumers: 1. java process: 2.8 GB (70%) 2. mysql: 650 MB (16%) 3. nginx: 120 MB (3%) Recommendations: 1. Immediate: Restart the Java application 2. Short-term: Increase instance type to t3.large 3. Long-term: Investigate memory leak in application Would you like me to: A) Restart the Java application now B) Show application logs C) Create a snapshot before changes$$

Find Issues

Identify instances with problems.

Natural Language Examples:

  • “Which instances need attention?”
  • “Show me problematic servers”
  • “Find unhealthy instances”

Direct Command:

$$@Ohlala SmartOps find issues$$

Remote Execution

Execute Command

Run commands on instances via SSM.

Natural Language Examples:

  • “Run ‘df -h’ on web-server-01”
  • “Check disk space on all instances”
  • “Restart nginx on the web servers”

Direct Command:

$$@Ohlala SmartOps execute "" on $$

Safety Features:

  • Confirmation required for all SSM commands
  • Commands run with limited privileges
  • Audit trail maintained
  • Output limited to 24,000 characters

Response Format:

$$πŸ”¨ Command Execution Request Target: web-server-01 (i-0abc123def) Command: systemctl restart nginx ⚠️ This command will restart the nginx service. This may cause brief downtime. Type 'yes' to confirm execution [After confirmation] βœ… Command Executed Successfully Output: nginx.service - The nginx HTTP Server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled) Active: active (running) since Thu 2024-03-20 15:45:32 UTC Execution Time: 1.2 seconds Command ID: abc-def-ghi-123$$

Instance Control

Start Instance

Start stopped instances.

Natural Language Examples:

  • “Start web-server-01”
  • “Boot up the test environment”
  • “Turn on i-0abc123def”

Direct Command:

$$@Ohlala SmartOps start instance $$

Stop Instance

Stop running instances.

Natural Language Examples:

  • “Stop the dev server”
  • “Shut down test-instance-02”
  • “Turn off i-0abc123def”

Direct Command:

$$@Ohlala SmartOps stop instance $$

Safety Confirmation:

$$⚠️ Stop Instance Confirmation You're about to stop: prod-database-01 Environment: production Current connections: 45 This action will: - Terminate all active connections - Stop the instance (data on instance store volumes will be lost) - Incur no further hourly charges Type 'yes' to confirm stopping this instance$$

Reboot Instance

Restart instances gracefully.

Natural Language Examples:

  • “Reboot web-server-01”
  • “Restart my application server”
  • “Perform a soft reset on i-0abc123def”

Direct Command:

$$@Ohlala SmartOps reboot instance $$

Scheduling

Schedule Report

Set up automated daily reports.

Natural Language Examples:

  • “Send me a daily health report at 9 AM”
  • “Schedule cost reports every Monday”
  • “Set up morning status updates”

Direct Command:

$$@Ohlala SmartOps schedule daily report at

Help and Information

Get Help

Show available commands and usage.

Natural Language Examples:

  • “Help”
  • “What can you do?”
  • “Show me available commands”

Direct Command:

$$@Ohlala SmartOps help$$

Response Format:

$$πŸ€– Ohlala SmartOps - Command Reference I understand natural language! Just describe what you need. You can also use these commands: πŸ“Š Monitoring β€’ list instances - Show all EC2 instances β€’ health report - Comprehensive health status β€’ check health - Check specific instance πŸ’° Cost Optimization β€’ cost analysis - Analyze spending β€’ rightsizing recommendations - Find savings πŸ”§ Troubleshooting β€’ troubleshoot - AI-guided diagnostics β€’ find issues - Identify problems πŸ”¨ Remote Execution β€’ execute "" on - Run via SSM βš™οΈ Instance Control β€’ start/stop/reboot instance πŸ“… Scheduling β€’ schedule daily report at

Advanced Features

Bulk Operations

Execute commands across multiple instances:

$$@Ohlala SmartOps execute "sudo yum update -y" on tag:Environment=dev$$

Filtering

Filter instances by various criteria:

$$@Ohlala SmartOps list instances where cpu > 80% @Ohlala SmartOps find instances tagged Environment=production$$

Chaining Commands

Combine multiple operations:

$$@Ohlala SmartOps stop all dev instances then create ami backups$$

Next Steps

Need Help?