Elastic Stack 8 : Metricbeat स्थापित करें2023/09/26 |
|
Metricbeat इंस्टॉल करें जो सिस्टम या सेवाओं से मेट्रिक्स एकत्र करता है।
Metricbeat विवरण के लिए, आधिकारिक साइट देखें।
⇒ https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-modules.html |
|
| [1] | Metricbeat स्थापित करें। इससे पहले Elasticsearch रिपॉजिटरी कॉन्फ़िगर करें।. |
|
root@dlp:~# apt -y install metricbeat
|
| [2] | बुनियादी सेटिंग्स कॉन्फ़िगर करें और Metricbeat प्रारंभ करें। |
|
root@dlp:~#
vi /etc/metricbeat/metricbeat.yml # पंक्ति 67 : यदि K@ibana का उपयोग करें, तो टिप्पणी हटाएं और आउटपुट होस्ट निर्दिष्ट करें # यदि Kibana पर SSL सक्षम है, तो होस्टनाम प्रमाणपत्रों में होस्टनाम के समान होना चाहिए # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # यदि स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो निर्दिष्ट करें [ssl.verification_mode: none] setup.kibana: ..... host: "https://dlp.srv.world:5601" protocol: "https" username: "elastic" password: "password" ssl.enabled: true ssl.verification_mode: none # पंक्ति 98: Elasticsearch का आउटपुट निर्दिष्ट करें # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # [ssl.certificate_authorities] Elasticsearch इंस्टालेशन द्वारा उत्पन्न कैसर्ट है output.elasticsearch: # Array of hosts to connect to. hosts: ["https://dlp.srv.world:9200"] protocol: "https" username: "elastic" password: "password" ssl.certificate_authorities: "/etc/elasticsearch/certs/http_ca.crt" ..... .....
root@dlp:~#
vi /etc/metricbeat/metricbeat.reference.yml # पंक्ति 61 : डेटा एकत्र करने के लिए आइटम सेट करें # टिप्पणी करने और टिप्पणी हटाने के लिए सक्षम और अक्षम करें
- module: system
metricsets:
- cpu # CPU usage
- load # CPU load averages
- memory # Memory usage
- network # Network IO
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
#- core # Per CPU core usage
#- diskio # Disk IO
#- filesystem # File system usage for each mountpoint
#- fsstat # File system summary metrics
#- raid # Raid
#- socket # Sockets and connection info (linux only)
#- service # systemd service information
enabled: true
period: 10s
processes: ['.*']
# लाइन 2677 : यदि Kibana का उपयोग करें, तो टिप्पणी हटाएं और आउटपुट होस्ट निर्दिष्ट करें # यदि Kibana पर SSL सक्षम है, तो SSL संबंधित पंक्तियों पर टिप्पणी हटाएँ # [username] और [password] व्यवस्थापक उपयोगकर्ता का है # यदि स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो निर्दिष्ट करें [ssl.verification_mode: none] setup.kibana: # Kibana Host # Scheme and port can be left out and will be set to the default (http and 5601) # In case you specify and additional path, the scheme is required: http://localhost:5601/path # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601 host: "https://dlp.srv.world:5601" # Optional protocol and basic auth credentials. protocol: "https" username: "elastic" password: "password" # Optional HTTP path #path: "" # Optional Kibana space ID. #space.id: "" # Use SSL settings for HTTPS. ssl.enabled: true ..... ..... # after very careful consideration. It is primarily intended as a temporary # diagnostic mechanism when attempting to resolve TLS errors; its use in # production environments is strongly discouraged. # The default value is full. ssl.verification_mode: noneroot@dlp:~# systemctl enable --now metricbeat
|
| [3] | स्थिति सत्यापित करें कि डेटा सामान्य रूप से एकत्र किया गया है। |
|
# सूचकांक सूची root@dlp:~# curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/_cat/indices?v Enter host password for user 'elastic' health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open .ds-metricbeat-8.5.0-2022.11.09-000001 MRfmgqLxSGCLapOAJDDZww 1 1 6412 0 9.1mb 9.1mb yellow open test_index Yw-_PdilSIueIBLM9KmihQ 1 1 1 0 6.4kb 6.4kb # सूचकांक पर दस्तावेज़ सूची root@dlp:~# curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/.ds-metricbeat-8.5.0-2022.11.09-000001/_search?pretty
Enter host password for user 'elastic'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 6526,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : ".ds-metricbeat-8.5.0-2022.11.09-000001",
"_id" : "aUMPW4QBQ1Dwm2jJ_ye1",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2022-11-09T06:24:45.003Z",
"system" : {
"load" : {
"15" : 0.06,
"norm" : {
"1" : 0.09,
"5" : 0.075,
"15" : 0.03
.....
.....
|
| [4] | यदि Kibana चल रहा है, नमूना डैशबोर्ड में डेटा आयात करना संभव है। |
|
root@dlp:~# metricbeat setup --dashboards Loading dashboards (Kibana must be running and reachable) Loaded dashboards |
|
| Sponsored Link |
|
|