RedHat 8 系になってから systemctl status コマンドを実行するとデフォルトでページャー(pager)が有効になっています。
■デフォルト
以下のようにログの最後が切れています。
[ec2-user@Test ~]$ systemctl status amazon-ssm-agent ● amazon-ssm-agent.service – amazon-ssm-agent
Loaded: loaded (/etc/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-06-30 05:41:26 UTC; 16min ago
Main PID: 1400 (amazon-ssm-agen)
Tasks: 8 (limit: 5003)
Memory: 11.9M
CGroup: /system.slice/amazon-ssm-agent.service
mq1400 /usr/bin/amazon-ssm-agent
Jun 30 05:45:04 Test amazon-ssm-agent[1400]: 2019-06-30 05:45:04 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:46:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:46:53 INFO [HealthCheck] HealthCheck reporting a>
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 INFO [MessageGatewayService] Setting up we>
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:51:29 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:29 INFO [MessagingDeliveryService] [Associati>
Jun 30 05:51:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:53 INFO [HealthCheck] HealthCheck reporting a>
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 INFO [MessageGatewayService] Setting up we>
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:56:26 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:26 INFO [LongRunningPluginsManager] There are>
Jun 30 05:56:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:53 INFO [HealthCheck] HealthCheck reporting a>
lines 1-19/19 (END)
[ec2-user@Test ~]$ systemctl status amazon-ssm-agent -l
● amazon-ssm-agent.service – amazon-ssm-agent
Loaded: loaded (/etc/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-06-30 05:41:26 UTC; 19min ago
Main PID: 1400 (amazon-ssm-agen)
Tasks: 8 (limit: 5003)
Memory: 12.0M
CGroup: /system.slice/amazon-ssm-agent.service
mq1400 /usr/bin/amazon-ssm-agent
Jun 30 05:45:04 Test amazon-ssm-agent[1400]: 2019-06-30 05:45:04 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:46:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:46:53 INFO [HealthCheck] HealthCheck reporting a>
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 INFO [MessageGatewayService] Setting up we>
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:51:29 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:29 INFO [MessagingDeliveryService] [Associati>
Jun 30 05:51:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:53 INFO [HealthCheck] HealthCheck reporting a>
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 INFO [MessageGatewayService] Setting up we>
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 ERROR [MessageGatewayService] Failed to ge>
Jun 30 05:56:26 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:26 INFO [LongRunningPluginsManager] There are>
Jun 30 05:56:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:53 INFO [HealthCheck] HealthCheck reporting a>
lines 1-19/19 (END)
「–no-pager」オプションを付けることでログを全部表示でき、且つプロンプトが返ってきます。
[ec2-user@Test ~]$ systemctl status amazon-ssm-agent -l –no-pager ● amazon-ssm-agent.service – amazon-ssm-agent
Loaded: loaded (/etc/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-06-30 05:41:26 UTC; 21min ago
Main PID: 1400 (amazon-ssm-agen)
Tasks: 8 (limit: 5003)
Memory: 12.0M
CGroup: /system.slice/amazon-ssm-agent.service
mq1400 /usr/bin/amazon-ssm-agent
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 INFO [MessageGatewayService] Setting up websocket for controlchannel for instance: i-09c6efd0fd52a9db4, requestId: 070ebaf4-51c3-4309-806b-25e0ecb9be35
Jun 30 05:48:49 Test amazon-ssm-agent[1400]: 2019-06-30 05:48:49 ERROR [MessageGatewayService] Failed to get controlchannel token, error: CreateControlChannel failed with error: createControlChannel request failed: unexpected response from the service <BadRequest xmlns=””>Unauthorized request.
Jun 30 05:51:29 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:29 INFO [MessagingDeliveryService] [Association] Schedule manager refreshed with 0 associations, 0 new associations associated
Jun 30 05:51:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:51:53 INFO [HealthCheck] HealthCheck reporting agent health.
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 INFO [MessageGatewayService] Setting up websocket for controlchannel for instance: i-09c6efd0fd52a9db4, requestId: 6494ee8f-f553-4af9-a994-a2c82f03a9cb
Jun 30 05:56:19 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:19 ERROR [MessageGatewayService] Failed to get controlchannel token, error: CreateControlChannel failed with error: createControlChannel request failed: unexpected response from the service <BadRequest xmlns=””>Unauthorized request.
Jun 30 05:56:26 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:26 INFO [LongRunningPluginsManager] There are no long running plugins currently getting executed – skipping their healthcheck
Jun 30 05:56:53 Test amazon-ssm-agent[1400]: 2019-06-30 05:56:53 INFO [HealthCheck] HealthCheck reporting agent health.
Jun 30 06:01:30 Test amazon-ssm-agent[1400]: 2019-06-30 06:01:30 INFO [MessagingDeliveryService] [Association] Schedule manager refreshed with 0 associations, 0 new associations associated
Jun 30 06:01:53 Test amazon-ssm-agent[1400]: 2019-06-30 06:01:53 INFO [HealthCheck] HealthCheck reporting agent health.
[ec2-user@Test ~]$
コメント