AWS SSM(Systems Manager)Run Command
Collect AWS SSM (Systems Manager) Run Command Metrics
Configuration¶
Permissions¶
For AWS cloud collection permissions, see AWS cloud integration role authorization. The read-only permissions required by this integration are listed below.
ssm:ListCommands: Get SSM Run Command records without executing commands.cloudwatch:ListMetrics: Discover CloudWatch monitoring metrics and dimensions.cloudwatch:GetMetricData: Read in batches: CloudWatch monitoring metric data.
Install Func¶
We recommend enabling hosted Func under Integration - Extensions in Guance. All prerequisites are installed automatically; continue with the script installation.
If deploying Func manually, refer to Manual Deployment of Func
Install Script¶
Prepare AWS AK in advance and authorize access as described in Permissions.
Activate Scripts in Hosted Func¶
- Log in to the Guance console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
- Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
- Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
- Click 【Integration】 on the cloud account details page, find
AWS SSM(Systems Manager)Run Commandin theNot Installedlist and click 【Install】 to open the installation form.
Manual Activation Script¶
-
Log in to the Func console, click 【Script Market】, open the Guance script market and search for
integration_aws_ssm_run_command. -
Click 【Install】, then enter the corresponding parameters: AWS AK ID, AK Secret, and account name.
-
Click 【Deploy Startup Script】 to create the
Startupscript set and configure the corresponding startup scripts automatically. -
After enabling the script, open 【Management / Automatic Trigger Configuration】 to view its automatic trigger configuration. Click 【Execute】 to run it immediately without waiting for the scheduled time. After a short wait, review the task records and logs.
Verification¶
- Under 【Management / Automatic Trigger Configuration】, confirm that the task has an automatic trigger configuration. Review its task records and logs for errors.
- In Guance, check 【Infrastructure - Resource Catalog】 for asset information.
- In Guance, check 【Metrics】 for the corresponding monitoring data.
Metrics¶
Configure Amazon CloudWatch to collect more metrics. Amazon CloudWatch Metrics Details
AWS SSM (Systems Manager) Run Command metrics are under the aws_ssm_run_command measurement. The description column includes the description, unit, and statistics of each metric.
| Metric | Description | Unit |
|---|---|---|
CommandsDeliveryTimedOut |
Number of commands with a terminal status of Delivery Timed Out | count |
CommandsFailed |
Number of commands with a terminal status of Failed | count |
CommandsSucceeded |
Number of commands with a terminal status of Success | count |
Object¶
The collected AWS SSM (Systems Manager) Run Command object data structure can be seen in "Infrastructure - Resource Catalog".
{
"measurement": "aws_ssm_run_command",
"tags": {
"command_id" : "91d10100-89c4-4077-a2ce-89fb90d1f566",
"document_name" : "AWS-RunShellScript",
"RegionId" : "ap-southeast-1"
},
"fields": {
"document_version" : "1",
"expires_after" : "2025-08-05T14:14:19.774000+08:00",
"parameters" : "{[Command Document]}",
"instance_ids" : "xxxx-0b8b6fee9ef5426d7",
"targets" : "{[Json Data]}",
"requested_date_time" : "2025-08-05T13:04:19.774000+08:00",
"status" : "Success",
"status_details" : "Success",
"cloud_watch_output_config" : "{}",
"alarm_configuration" : "{}",
"triggered_alarms" : "[]",
"timeout_seconds" : "600",
"output_s_3_region" : "ap-southeast-1"
}
}
Note: The fields in
tagsandfieldsmay change with subsequent updates