In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How to use zabbix to monitor mongod, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
1 the monitored end writes mongodb.sh
Note: the path inside and your port depend on your actual situation.
Case $# in 1) output=$ (/ bin/echo "db.serverStatus (). $1" | / usr/local/mongodb/bin/mongo admin-- port 27017 | sed-n '3p'); 2) output=$ (/ bin/echo "db.serverStatus (). $1.3p' | / usr/local/mongodb/bin/mongo admin-- port 27017 | sed-n' 3p') 3) output=$ (/ bin/echo "db.serverStatus (). $1.3p3" | / usr/local/mongodb/bin/mongo admin-- port 27017 | sed-n '3p');; esac # check if the output contains "NumberLong" if [["$output" = ~ "NumberLong"]]; then echo $output | sed-n' s/NumberLong (/ / p' | sed-n's /) / / p'else echo $outputfi
2 Edit zabbix_agentd.conf configuration file
Add the following
UserParameter=MongoDB.Status [*], / usr/local/zabbix/script/mongodb.sh $1 $2 $3
3 Import the template and restart the zabbix_agentd service
Refer to annex
4 server testing
/ home/usr/local/zabbix/bin/zabbix_get-s ip-kMongoDB.Status [network,bytesIn]
40667759
#
Mongodb monitoring item MongoDB.Status [opcounters,delete] MongoDB.Status [opcounters,getmore] # # number of getMore performed on cursors since instance startup MongoDB.Status [opcounters,insert] # # number of insert execution MongoDB.Status [opcounters,query] # # since instance startup, number of query execution MongoDB.Status [opcounters,command] # # since instance startup Number of other operations performed MongoDB.Status [network,numRequests] MongoDB.Status [mem,virtual] MongoDB.Status [backgroundFlushing,average_ms] # # average time per refresh execution MongoDB.Status [network,bytesOut] MongoDB.Status [opcounters,update] MongoDB.Status [opcountersRepl,command] MongoDB.Status [process] # # the current instance is mongod Or mongosMongoDB.Status [uptime] # # continuous uptime of instance, used_connections_percentageused_memory_percentageMongoDB.Status [opcountersRepl,update] MongoDB.Status [opcountersRepl,query] MongoDB.Status [opcountersRepl,delete] MongoDB.Status [opcountersRepl,getmore] MongoDB.Status [opcountersRepl,insert] MongoDB.Status [mem,resident] MongoDB.Status [network,bytesIn] MongoDB.Status [running _ info,heap_usage_bytes] # # current instance heap size Number of page errors that occurred while loading disk contents MongoDB.Status [mem,mapped] MongoDB.Status [globalLock,activeClients,total] current active connections MongoDB.Status [cursors,totalOpen] MongoDB.Status [cursors,timedOut] MongoDB.Status [connections,available] # # how much is left to connect MongoDB.Status [connections,current] # # the number of connections currently active to the machine MongoDB.Status [connections] TotalCreated] MongoDB.Status [globalLock,activeClients,writers] current active write connections MongoDB.Status [globalLock,activeClients,readers] current active read connections MongoDB.Status [indexCounters,mi***atio] MongoDB.Status [globalLock,currentQueue,readers] # currently waiting for the queue MongoDB.Status [mem,bits] MongoDB.Status [indexCounters,misses] to access the index The index is not the number of hits in memory MongoDB.Status [indexCounters,resets] the number of times the index counter is reset when MongoDB.Status [indexCounters,hits] accesses the index The number of hits of the index in memory MongoDB.Status [indexCounters,accesses] MongoDB.Status [globalLock,currentQueue,total] # queue currently waiting to acquire locks MongoDB.Status [globalLock,currentQueue,writers] # queues currently waiting to acquire write locks the answer to the question on how to use zabbix to monitor mongod is shared here. I hope the above content can be of some help to you, if you still have a lot of doubts unsolved. You can follow the industry information channel for more related knowledge.
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.