Installation
Running the Server
STDIO Transport Mode
HTTP Streaming Transport Mode
Available Tools
The server provides the following tools for managing instance agent commands:| Tool Name | Description |
|---|---|
list_instance_agent_commands | List all instance agent commands |
get_instance_agent_command | Get detailed information about a specific command by ID |
create_instance_agent_command | Create and execute a new instance agent command |
list_instance_agent_command_executions | List command executions for an instance agent command |
Usage Examples
List Instance Agent Commands
Create and Execute a Command
Get Command Details
Check Command Execution Status
Understanding Instance Agent Commands
The Instance Agent is a lightweight process that runs on compute instances and enables:- Remote Command Execution - Run shell commands without SSH access
- Automated Scripts - Execute maintenance and configuration scripts
- Monitoring & Diagnostics - Collect system information remotely
- Patch Management - Apply updates and patches programmatically
Command Types
Supported command types include:- Shell commands (bash, sh)
- PowerShell scripts (Windows instances)
- Custom scripts with arguments
Command Lifecycle
- Created - Command is defined and submitted
- Accepted - Instance agent receives the command
- In Progress - Command is executing
- Succeeded - Command completed successfully
- Failed - Command encountered an error
- Canceled - Command was canceled before completion
Authentication
The server uses OCI CLI configuration from~/.oci/config. Ensure you have:
- OCI CLI installed and configured
- Valid API credentials
- Appropriate IAM permissions for instance agent operations
Required Permissions
Your OCI user or instance principal needs these IAM permissions:Instance Agent Requirements
For commands to execute successfully:- Instance Agent Must Be Running - The agent is pre-installed on Oracle-provided images
- Network Connectivity - Instance needs internet access to reach OCI services
- Service Enablement - Instance agent plugin must be enabled
Verify Instance Agent Status
You can check if the instance agent is running through the OCI Console or CLI:Common Use Cases
System Administration
- Check disk space and system resources
- Restart services and applications
- Clear caches and temporary files
- Update configuration files
Monitoring & Diagnostics
- Collect system logs
- Check process status
- Gather performance metrics
- Run diagnostic scripts
Automation
- Deploy application updates
- Execute maintenance scripts
- Configure system settings
- Manage users and permissions
Compliance & Security
- Run security scans
- Verify compliance configurations
- Collect audit information
- Update security patches
Example Commands
Check Disk Usage
List Running Processes
Restart a Service
Collect Logs
Troubleshooting
Command Not Executing
Possible causes:- Instance agent is not running
- Instance lacks internet connectivity
- Insufficient permissions
- Invalid command syntax
- Verify instance agent status in OCI Console
- Check instance internet gateway and NAT gateway configuration
- Review IAM policies
- Test command syntax manually via SSH
Command Timed Out
Long-running commands may timeout. Consider:- Breaking commands into smaller steps
- Running commands asynchronously
- Increasing timeout values if supported
Permission Denied Errors
Commands run as the oracle-cloud-agent user. For privileged operations:- Use
sudoin your commands - Ensure sudo is properly configured
- Check file and directory permissions
Related Services
- Compute - Manage compute instances
- Monitoring - Monitor instance metrics
- Logging - Collect and analyze logs
