debian

如何用Filebeat监控Debian服务器

小樊
90
2025-02-14 20:37:57
栏目: 云计算
云服务器特惠,独享带宽,仅需0.96元/天! 查看>>

要使用Filebeat监控Debian服务器,您需要按照以下步骤进行操作:

安装Filebeat

  1. 下载并安装Filebeat
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
sudo apt-get update
sudo apt-get install -y filebeat
  1. 配置Filebeat
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/*.log

output.elasticsearch:
  hosts: ["localhost:9200"]
  1. 启动并启用Filebeat自启动
sudo systemctl start filebeat
sudo systemctl enable filebeat
  1. 验证配置
sudo filebeat -e -c /etc/filebeat/filebeat.yml -d

监控Filebeat本身

http.enabled: true
http.port: 5067

然后,您可以使用 curl 命令来获取Filebeat的状态信息:

curl -X GET "localhost:5067/stats?pretty"

注意事项

通过以上步骤,您可以在Debian服务器上成功部署和配置Filebeat,以监控服务器上的日志数据。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

相关推荐:如何用Filebeat监控CentOS服务器

0
看了该问题的人还看了