获取主机+端口

request.getScheme()+"://"+((ServletRequest) request).getServerName()+":"+request.getServerPort()
Node Exporter 可以通过收集系统内核网络和文件句柄的信息来获取主机监听端口信息。具体来说,Node Exporter 会读取 `/proc/net/tcp` 和 `/proc/net/tcp6` 文件来获取 TCP 监听端口的信息,同时也会读取 `/proc/net/udp` 和 `/proc/net/udp6` 文件来获取 UDP 监听端口的信息。 Node Exporter 收集到的端口信息会作为 `node_network_*` 和 `node_filehandle_*` 系列指标的一部分,其中 `node_network_*` 指标包含 TCP 和 UDP 监听端口的信息,而 `node_filehandle_*` 指标包含每个进程打开的文件句柄数量信息。 例如,可以使用以下命令来列出 Node Exporter 收集到的所有网络相关的指标信息: ``` curl http://node-exporter-ip:9100/metrics | grep node_network ``` 您将看到类似于以下内容的输出: ``` # HELP node_network_address_translation_table_entries Number of address translation table entries. # TYPE node_network_address_translation_table_entries gauge node_network_address_translation_table_entries 0 # HELP node_network_active_opens Number of times TCP connections have made a direct transition to the SYN-SENT state from the CLOSED state. # TYPE node_network_active_opens gauge node_network_active_opens 5 # HELP node_network_attempt_fails Number of times TCP connections have made a direct transition to the CLOSED state from either the SYN-SENT state or the SYN-RCVD state, plus the number of times TCP connections have made a direct transition to the LISTEN state from the SYN-RCVD state. # TYPE node_network_attempt_fails gauge node_network_attempt_fails 0 ... ``` 其中 `node_network_*` 指标中的 `local_address` 和 `local_port` 字段表示监听的本地IP地址和端口
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

8一天不

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值