In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about how zabbix monitors mongodb. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
I haven't tidied up zabbix for a long time, and found that some things can't be used. Today, I reorganized zabbix and re-monitored mongodb. Here's the deployment process:
The first step is to append the following to the zabbix_agentd.conf, mainly by calling the tool mongo to obtain the status of the mongodb through the db.serverStatus () function. It is important to note that the connected IP and port cannot be configured incorrectly. It is best to check whether the IP and port in the configuration file of mongodb are consistent:
# monitor mongodbUserParameter=mongo.service,ps-ef | grep mongo | grep-v grep | wc-lUserParameter=mongo.mem_resident,echo "db.serverStatus (). Mem" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 cut 27017 | grep resident | cut-d ":"-f 2 | cut-d ","-f 1 | cut-d "- f 2UserParameter=mongo.mem_virtual Echo "db.serverStatus (). Mem" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 mem 27017 | grep virtual | cut-d ":"-f 2 | cut-d ","-f 1 | cut-d "- f 2UserParametercircle mongo.memapped mapped grep 27017 | grep'\ bmapped\ b' | cut-d": "- f 2 | cut-d" "- F1 | cut-d"- f 2UserParameter=mongo.network [*], echo" db.serverStatus () .network "| / data/mongodb/mongodb/bin/mongo 127.0.0.1 network 27017 | grep $1 | cut-d": "- f 2 | cut-d", "- F1 | cut-d"- f 2UserParameter=mongo.index [*] Echo "db.serverStatus (). IndexCounters" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 indexCounters 27017 | grep $1 | cut-d ":"-f 2 | cut-d ","-F1 | cut-d "- f 2UserParameteranomalmongo.connectioncurrentcurrent 2UserParameter=mongo.connection_available echo" db.serverStatus (). Connections "| / data/mongodb/mongodb/bin/mongo 127.0.0.1 grep current | grep current | cut-d": "- f 2 | cut-d", "- F1 | cut-d"-f 2UserParameter=mongo.connection_available Echo "db.serverStatus (). Connections" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 connections 27017 | grep current | cut-d ":"-f 3 | cut-d ","-f 1 | cut-d "- f 2UserParameter=mongo.opcounters [*], echo" db.serverStatus (). Opcounters "| / data/mongodb/mongodb/bin/mongo 127.0.0.1 db.serverStatus 27017 | grep $1 | cut-d": "- f 2 | cut-d", "- f 1 | cut-d"-f 2UserParameter=mongo.rpstatus Echo "rs.status ()" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 data/mongodb/mongodb/bin/mongo 27017 | grep myState | cut-d ":"-f 2 | cut-d ","-f 1 | cut-d "- f 2UserParameterwriting mongo. Queuewriting write echo" db.serverStatus (). GlobalLock.currentQueue.writers "| / data/mongodb/mongodb/bin/mongo 127.0.0.1 sed 27017 | sed-n 3pUserParameter=mongo.queue_reader Echo "db.serverStatus () .globalLock.currentQueue.readers" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 globalLock.currentQueue.readers 27017 | sed-n 3pUserParametercircle mongo.backgroundFlush.backgroundFlushMagneEcho "db.serverStatus (). BackgroundFlushing.last_ms" | / data/mongodb/mongodb/bin/mongo 127.0.0.1VOV 27017 | sed-n 3pUserParametercircle mongo.curosorority TotalopenMagol echo "db.serverStatus (). Cursors.totalOpen" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 data/mongodb/mongodb/bin/mongo 27017 | sed-n 3pUserParameter=mongo.curospr_timedOu Echo "db.serverStatus (). Cursors.timedOut" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 cursors.timedOut 27017 | sed-n 3pUserParameterkeeper mongo.pagefaultssed-d "(). Extra_info.page_faults" | / data/mongodb/mongodb/bin/mongo 127.0.0.1Rose 27017 | sed-n 3pUserParameterroommongo.oplogstoretimeaid echo "db.printReplicationInfo ()" | / data/mongodb/mongodb/bin/mongo 127.0.0.1 sed 27017 | sed-n 4p | cut-d "("-f 2 | cut-d "h"-f 1
Restart zabbix_agentd after the append is completed, and then use zabbix_get on the zabbix_server side to see if the data can be obtained. If the data can be obtained, it means that the client has been configured, then configure the server, import the template provided below, and then add the corresponding host to the template.
This is how zabbix monitors mongodb shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.