背景

用户想通过 AWS CloudWatch 来监控 f5 业务日志情况,要求 f5 需要将日志发送到 CloudWatch 来完成对接。

一、F5 配置部分

1、下载 F5 Telemetry RPM 包

2、安装 F5 Telemetry RPM 包

导航至路径 iApps >> Package Management LX 点击 Import 导入 RMP 包。

image-20220704152945246

选择文件,点击 Upload 进行上传。

image-20220704153253621

[quote color=“primary”]注意:如果您使用的是 14.0 之前的 BIG-IP 版本,则必须先使用 BIG-IP 命令行启用框架,然后才能使用配置实用程序。在 CLI 中键入以下命令:
touch /var/config/rest/iapps/enable[/quote]

3、配置 AWS 安全密钥组

导航至路径 System >> Configuration : AWS : Global Settings ,输入 Access KeySecret Key

image-20220704153926307

二、AWS CloudWatch 配置部分

1、日志组创建

导航至路径 CloudWatch > Log Groups ,点击 Create log group 进行日志组创建。

image-20220704155038738

2、日志流创建

在日志组(my_log_group)里面创建一个日志流(my_log_stream)

image-20220704155125721

三、配置 Telemetry Streaming

这里使用 Posteman 客户端进行演示,其他 RESTful API 客户端也可。

1、获取 F5 Telemetry 信息

此步骤用于获取 F5 Telemetry Streaming 信息,确保正常运行。

向 F5 发送 Get 请求,收到版本信息等返回值,说明 Telemetry Streaming 正常运行。URL格式如下:

1
https://{{host}}/mgmt/shared/telemetry/info

image-20220704161733856

2、配置 F5 Telemetry Streaming

向 F5 发送 POST 提交 Telemetry Streaming 配置。URL格式如下:

1
https:///mgmt/shared/telemetry/declare

image-20220704161652237

提交内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"class": "Telemetry",
"My_System": {
"class": "Telemetry_System",
"systemPoller": {
"interval": 60
}
},
"My_Listener": {
"class": "Telemetry_Listener",
"port": 6514
},
"My_Consumer": {
"class": "Telemetry_Consumer",
"type": "AWS_CloudWatch",
"region": "cn-northwest-1",
"logGroup": "my_log_group",
"logStream": "my_log_stream",
"username": "AKIAQMD22WCK",
"passphrase": {
"cipherText": "8YYgkI6r5jhxpmDgNXqwJsj+UgPrH0"
}
}
}

需要参数修改部分如下:

  • Type:因为我们使用的是 aws 所以为 aws cloudwatch

  • Region: cn-northwest 为宁夏区域

  • Loggroup:为日志组名字

  • Logstream:为日志组下里面的日志流的名字

  • Username:为 iam 安全访问密钥(access key)

  • CipherText:为 ima 安全访问密钥 key (secret key)

如下图所示,配置提交后如果返回 message success ,则代表 Telemetry Streaming 配置提交成功。

image-20220704162307861

查看配置日志,路径为 /var/log/restnoded/restnoded.log

image-20220704162347098

四、配置验证

登录AWS,在 AWS Cloudwatch 查看是否可以看到 F5 发送来的日志。

image-20220704163724393

由上图所示:F5 日志已经发送到 AWS CloudWatch ,实验配置成功!

五、致谢

人员致谢

👦 Xinyu Zhang

文档致谢

1️⃣F5 Telemetry Streaming (TS) to AWS CloudWatch

2️⃣Downloading and installing Telemetry Streaming (f5.com)

3️⃣Releases · F5Networks/f5-telemetry-streaming (github.com)