This repository provides a Monitoring system of M-CMP.
A sub-system of M-CMP platform to deploy and manage Multi-Cloud Infrastructures.
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli docker-compose-plugin
git clone https://github.com/m-cmp/mc-observability.git
cd mc-observability/java-module
cp .env.sample .env
sudo mkdir -p /docker/opensearch
sudo chown -R 1000:1000 /docker/opensearch
sudo docker compose up -d
sudo ss -nltp | grep docker 12:03:20 PM
LISTEN 0 4096 0.0.0.0:1024 0.0.0.0:* users:(("docker-proxy",pid=21828,fd=4))
LISTEN 0 4096 0.0.0.0:1324 0.0.0.0:* users:(("docker-proxy",pid=18004,fd=4))
LISTEN 0 4096 0.0.0.0:1325 0.0.0.0:* users:(("docker-proxy",pid=17943,fd=4))
LISTEN 0 4096 0.0.0.0:1323 0.0.0.0:* users:(("docker-proxy",pid=18311,fd=4))
LISTEN 0 4096 0.0.0.0:3306 0.0.0.0:* users:(("docker-proxy",pid=21737,fd=4))
LISTEN 0 4096 0.0.0.0:5601 0.0.0.0:* users:(("docker-proxy",pid=22105,fd=4))
LISTEN 0 4096 0.0.0.0:8086 0.0.0.0:* users:(("docker-proxy",pid=21771,fd=4))
LISTEN 0 4096 0.0.0.0:8082 0.0.0.0:* users:(("docker-proxy",pid=21805,fd=4))
LISTEN 0 4096 0.0.0.0:8888 0.0.0.0:* users:(("docker-proxy",pid=21951,fd=4))
LISTEN 0 4096 0.0.0.0:9200 0.0.0.0:* users:(("docker-proxy",pid=22183,fd=4))
LISTEN 0 4096 0.0.0.0:9600 0.0.0.0:* users:(("docker-proxy",pid=22160,fd=4))
LISTEN 0 4096 0.0.0.0:18080 0.0.0.0:* users:(("docker-proxy",pid=21915,fd=4))
LISTEN 0 4096 0.0.0.0:18081 0.0.0.0:* users:(("docker-proxy",pid=21863,fd=4))
LISTEN 0 4096 [::]:1024 [::]:* users:(("docker-proxy",pid=21834,fd=4))
LISTEN 0 4096 [::]:1324 [::]:* users:(("docker-proxy",pid=18012,fd=4))
LISTEN 0 4096 [::]:1325 [::]:* users:(("docker-proxy",pid=17950,fd=4))
LISTEN 0 4096 [::]:1323 [::]:* users:(("docker-proxy",pid=18322,fd=4))
LISTEN 0 4096 [::]:3306 [::]:* users:(("docker-proxy",pid=21745,fd=4))
LISTEN 0 4096 [::]:5601 [::]:* users:(("docker-proxy",pid=22111,fd=4))
LISTEN 0 4096 [::]:8086 [::]:* users:(("docker-proxy",pid=21778,fd=4))
LISTEN 0 4096 [::]:8082 [::]:* users:(("docker-proxy",pid=21812,fd=4))
LISTEN 0 4096 [::]:8888 [::]:* users:(("docker-proxy",pid=21959,fd=4))
LISTEN 0 4096 [::]:9200 [::]:* users:(("docker-proxy",pid=22189,fd=4))
LISTEN 0 4096 [::]:9600 [::]:* users:(("docker-proxy",pid=22167,fd=4))
LISTEN 0 4096 [::]:18080 [::]:* users:(("docker-proxy",pid=21922,fd=4))
LISTEN 0 4096 [::]:18081 [::]:* users:(("docker-proxy",pid=21873,fd=4))
git clone https://github.com/m-cmp/mc-observability.git
cd cb-tumblebug
Initialize CB-Tumblebug to configure Multi-Cloud info
curl -u default:default -X 'POST' \
'http://127.0.0.1:1323/tumblebug/ns' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"description": "First namespace",
"name": "ns01"
}'
curl -u default:default -X 'POST' \
'http://127.0.0.1:1323/tumblebug/ns/ns01/mciDynamic' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"description": "Made in CB-TB",
"installMonAgent": "no",
"label": "DynamicVM",
"name": "mci01",
"systemLabel": "",
"vm": [
{
"commonImage": "azure+koreacentral+ubuntu22.04",
"commonSpec": "azure+koreacentral+standard_b4ls_v2",
"connectionName": "azure-koreacentral",
"description": "Description",
"label": "DynamicVM",
"name": "g1-1",
"rootDiskSize": "default",
"rootDiskType": "default",
"subGroupSize": "3",
"vmUserPassword": "string"
}
]
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-1' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"description": "vm1",
"aliasName": "g1"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-2' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"description": "vm2",
"aliasName": "g2"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-3' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"description": "vm3",
"aliasName": "g3"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target' \
--header 'Accept: */*' | jq
g1-1-1 example)
echo -e ' files = ["/var/log/syslog"]
from_beginning = false
watch_method = "inotify"
# Data format to parse syslog entries
data_format = "grok"
grok_patterns = ["%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{PROG:program}: %{GREEDYDATA:message}"]
# Add these fields if you want to tag the logs
[inputs.tail.tags]
vm_id = "g1-1-1"
mci_group_id = "mci01"' | base64 -w 0
curl -u default:default -X 'GET' \
'http://observability_VM_PUBLIC_IP:1323/tumblebug/ns/ns01/mci/mci01/vm/g1-1-1' \
-H 'accept: application/json' | jq | grep publicIP
curl --location 'g1-1-1_VM_PUBLIC_IP:18081/api/o11y/monitoring/ns01/mci01/target/g1-1-1/item' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"name": "tail",
"pluginSeq": "7",
"pluginConfig": "ICBmaWxlcyA9IFsiL3Zhci9sb2cvc3lzbG9nIl0KICBmcm9tX2JlZ2lubmluZyA9IGZhbHNlCiAgd2F0Y2hfbWV0aG9kID0gImlub3RpZnkiCgogICMgRGF0YSBmb3JtYXQgdG8gcGFyc2Ugc3lzbG9nIGVudHJpZXMKICBkYXRhX2Zvcm1hdCA9ICJncm9rIgogIGdyb2tfcGF0dGVybnMgPSBbIiV7U1lTTE9HVElNRVNUQU1QOnRpbWVzdGFtcH0gJXtTWVNMT0dIT1NUOmhvc3RuYW1lfSAle1BST0c6cHJvZ3JhbX06ICV7R1JFRURZREFUQTptZXNzYWdlfSJdCgogICMgQWRkIHRoZXNlIGZpZWxkcyBpZiB5b3Ugd2FudCB0byB0YWcgdGhlIGxvZ3MKICBbaW5wdXRzLnRhaWwudGFnc10KICAgIHZtX2lkID0gImcxLTEtMSIKICAgIG1jaV9ncm91cF9pZCA9ICJtY2kwMSIK"
}'
g1-1-1 example)
echo -e ' urls = ["http://observability_VM_PUBLIC_IP:9200"]
index_name = "telegraf-test"
template_name = "telegraf-*"' | base64 -w 0
curl --location 'g1-1-1_VM_PUBLIC_IP:18081/api/o11y/monitoring/ns01/mci01/target/g1-1-1/item' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"name": "opensearch",
"pluginSeq": "10",
"pluginConfig": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/opensearch' \
--header 'Accept: */*' | jq
g1-1-1 example)
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/opensearch/1/logs' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
"range": "1d/d",
"limit": "3"
}' | jq
g1-1-1 cpu_usage example)
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-1/csp/cpu_usage' \
--header 'Accept: */*' | jq
sequenceDiagram
participant M-CMP User
participant MC-O11y-Manager
participant MC-O11y-Agent-Manager
participant CB-Tumblebug
participant MariaDB
participant MC-O11y-Agent
Note over M-CMP User: run docker-image
M-CMP User ->> MC-O11y-Manager: Request install agent<br>param: nsId, targetId
MC-O11y-Manager ->> MC-O11y-Agent-Manager: Check installed target
alt Already install target?
MC-O11y-Agent-Manager ->> MC-O11y-Manager: Response installed
MC-O11y-Manager ->> M-CMP User: Response installed
else
MC-O11y-Agent-Manager ->> CB-Tumblebug: Request target connection info
CB-Tumblebug ->> MC-O11y-Agent-Manager: Response connection info
MC-O11y-Agent-Manager ->> MC-O11y-Agent: Connect target
MC-O11y-Agent-Manager ->> MC-O11y-Agent: Install agent
MC-O11y-Agent ->> MariaDB: Regist managed target
MC-O11y-Agent ->> MC-O11y-Agent-Manager: Installation complete
MC-O11y-Agent-Manager ->> MC-O11y-Manager: Installation complete
MC-O11y-Manager ->> M-CMP User: Installation complete
end