Phần 4 Monitoring trên MongoDB

Phần 4 Monitoring trên MongoDB

1./ Free Monitoring trên MongoDB

db.enableFreeMonitoring()

#

rs0:PRIMARY> db.enableFreeMonitoring()

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645613943, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645613943, 1)

}

 

db.enableFreeMonitoring()

rs0:PRIMARY> db.enableFreeMonitoring()

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645614111, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645614111, 1)

}

Để kiểm tra

rs0:PRIMARY> db.getFreeMonitoringStatus()​​ 

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "Free Monitoring URL:\nhttps://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645614185, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645614185, 1)

}

Truy cập

https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE

https://docs.mongodb.com/manual/reference/method/db.enableFreeMonitoring/#mongodb-method-db.enableFreeMonitoring

 

#

2./ Tool Monitor MongoDB Performance

2.1/ Mongostat

mongostat -u "root" -p '=@!#@%$admin1' --authenticationDatabase "admin"

 

#​​ mongostat -u "mgadmin" -p 'mgpass1234321'​​ --authenticationDatabase "admin"

2.2/ Mongotop

#​​ mongotop​​ -u "mgadmin" -p 'mgpass1234321'​​ --authenticationDatabase "admin"

 

 

 

 

 

Tham khảo

https://www.tecmint.com/monitor-mongodb-performance/

BÀI VIẾT CÙNG CHUYÊN MỤC

Critical - CVE 2026 98432 - Nguy cơ tấn công từ xa vào Linux - Ubuntu, Centos, Debian
Critical - CVE 2026 98432 - Nguy cơ tấn công từ xa vào ...

Critical - CVE 2026 98432 - Nguy cơ tấn công từ xa vào Linux - Ubuntu, Centos, ...

CXMT và DRAM 4F² cho thấy Trung Quốc tiến nhanh nhưng chưa thể kết luận Mỹ thua cuộc
CXMT và DRAM 4F² cho thấy Trung Quốc tiến nhanh nhưng ...

CXMT và DRAM 4F² cho thấy Trung Quốc tiến nhanh nhưng chưa thể kết luận Mỹ thua ...

Cảnh báo NAS Synology, XPEnology bị mã hóa dữ liệu: Vì sao bị tấn công và cách xử lý?
Cảnh báo NAS Synology, XPEnology bị mã hóa dữ liệu: Vì ...

Cảnh báo NAS Synology, XPEnology bị mã hóa dữ liệu: Vì sao bị tấn công và cách ...

Cảnh báo Telegram trên iPhone: Nguy cơ bị hacker tấn công qua sticker và cách phòng tránh
Cảnh báo Telegram trên iPhone: Nguy cơ bị hacker tấn ...

Cảnh báo Telegram trên iPhone: Nguy cơ bị hacker tấn công qua sticker và cách ...

PHP2Shell làm Nhật Bản “khốn đốn”: Vì sao nhiều dịch vụ tạm dừng, còn thế giới chịu ảnh hưởng ra sao?
PHP2Shell làm Nhật Bản “khốn đốn”: Vì sao nhiều dịch ...

PHP2Shell làm Nhật Bản “khốn đốn”: Vì sao nhiều dịch vụ tạm dừng, còn thế giới ...

PHP2Shell: Hai lỗ hổng nghiêm trọng đe dọa hàng triệu website – Cách kiểm tra và khắc phục
PHP2Shell: Hai lỗ hổng nghiêm trọng đe dọa hàng triệu ...

PHP2Shell: Hai lỗ hổng nghiêm trọng đe dọa hàng triệu website – Cách kiểm tra ...