更新时间
:2017/03/18Write By
:BrianICMP (v4 and v6)
DNS
HTTP
AMQP 0.9.1
Cassandra
Mysql
PostgreSQL
Redis
Thrift-RPC
MongoDB
Memcache
sudo apt-get install libpcap0.8
curl -L -O https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-5.2.2-amd64.deb
sudo dpkg -i packetbeat-5.2.2-amd64.deb
sudo yum install libpcap
curl -L -O https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-5.2.2-x86_64.rpm
sudo rpm -vi packetbeat-5.2.2-x86_64.rpm
/etc/packetbeat/packetbeat.yml
# 配置用于捕获数据包的网络设备,any表示所有设备
#
packetbeat.interfaces.device: any
# 配置你需要监控的网络协议及端口,如果端口是标准的,则允许不配置
packetbeat.protocols.dns:
ports: [53]
include_authorities: true
include_additionals: true
#
packetbeat.protocols.http:
ports: [80, 8080, 8081, 5000, 8002]
#
packetbeat.protocols.memcache:
ports: [11211]
#
packetbeat.protocols.mysql:
ports: [3306]
#
packetbeat.protocols.pgsql:
ports: [5432]
#
packetbeat.protocols.redis:
ports: [6379]
#
packetbeat.protocols.thrift:
ports: [9090]
#
packetbeat.protocols.mongodb:
ports: [27017]
#
packetbeat.protocols.cassandra:
ports: [9042]
## 配置数据端,默认为ES输出
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
hosts: ["192.168.1.42:9200"]
username: "elastic"
password: "BBDelastic123"
# 若需要发送至logstash,请注释ES输出配置,配置logstash路径
#----------------------------- Logstash output --------------------------------
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
PS
:更多详细信息ES官网文档
output.elasticsearch:
hosts: ["localhost:9200"]
template.name: "packetbeat"
template.path: "packetbeat.template.json"
template.overwrite: false
template.overwrite: true
curl -XPUT 'http://localhost:9200/_template/packetbeat' -d@/etc/packetbeat/packetbeat.template.json
deb:
sudo /etc/init.d/packetbeat start
rpm:
sudo /etc/init.d/packetbeat start
cd /usr/share/packetbeat/
#
./scripts/import_dashboards -es http://192.168.33.60:9200
OR
./scripts/import_dashboards -es https://xyz.found.io -user user -pass password
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.2.2-amd64.deb
sudo dpkg -i filebeat-5.2.2-amd64.deb
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.2.2-x86_64.rpm
sudo rpm -vi filebeat-5.2.2-x86_64.rpm
vim /etc/filebeat/filebeat.yml
#
filebeat.prospectors:
- input_type: log
paths:
- /var/log/*.log
#- c:\programdata\elasticsearch\logs\*
output.elasticsearch:
hosts: ["192.168.1.42:9200"]
username: "elastic"
password: "BBDelastic123"
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
PS
:需要了解更多资料点击lostash配置
output.elasticsearch:
hosts: ["localhost:9200"]
template.name: "filebeat"
template.path: "filebeat.template.json"
template.overwrite: false
template.overwrite: true
curl -XPUT 'http://localhost:9200/_template/filebeat' -d@/etc/filebeat/filebeat.template.json
sudo /etc/init.d/filebeat start
sudo /etc/init.d/filebeat start
cd /usr/share/packetbeat/
#
./scripts/import_dashboards -es http://192.168.33.60:9200
OR
./scripts/import_dashboards -es https://xyz.found.io -user user -pass password
Apache
HAProxy
MongoDB
MySQL
Nginx
PostgreSQL
Redis
System
Zookeeper
...and so on...
curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-5.2.2-amd64.deb
sudo dpkg -i metricbeat-5.2.2-amd64.deb
curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-5.2.2-x86_64.rpm
sudo rpm -vi metricbeat-5.2.2-x86_64.rpm
metricbeat.modules:
- module: system
metricsets:
- cpu
- filesystem
- memory
- network
- process
enabled: true
period: 10s
processes: ['.*']
cpu_ticks: false
## apache配置样例
- module: apache
metricsets: ["status"]
enabled: true
period: 1s
hosts: ["http://127.0.0.1"]
output.elasticsearch:
hosts: ["192.168.1.42:9200"]
username: "elastic"
password: "BBDelastic123"
或
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
sudo /etc/init.d/metricbeat start
sudo /etc/init.d/metricbeat start
cd /usr/share/packetbeat/
#
./scripts/import_dashboards -es http://192.168.33.60:9200
OR
./scripts/import_dashboards -es https://xyz.found.io -user user -pass password
ICMP
TCP
HTTP
curl -L -O https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-5.2.2-amd64.deb
sudo dpkg -i heartbeat-5.2.2-amd64.deb
curl -L -O https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-5.2.2-x86_64.rpm
sudo rpm -vi heartbeat-5.2.2-x86_64.rpm
heartbeat.monitors:
- type: icmp
schedule: '*/5 * * * * * *'
hosts: ["myhost"]
- type: tcp
schedule: '@every 5s'
hosts: ["myhost:12345"]
mode: any
output.elasticsearch:
hosts: ["192.168.1.42:9200"]
username: "elastic"
password: "BBDelastic123"
或
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
PS
:更多信息查阅:heartbeat配置
sudo /etc/init.d/ start
sudo /etc/init.d/heartbeat start