In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, the company has launched several new mongodb projects (stand-alone MongoDB), which need to sit down and monitor. There was a monitoring template before, but it didn't work well. So I went to google again and got the following record.
Reference https://github.com/oscm/zabbix/tree/master/mongodb for stand-alone version
Experimental environment:
CentOS6.8 X86_64
Percona-server-mongodb-3.2.9
Steps:
1. Copy the script mongodb.sh to / etc/zabbix/scripts and modify the environment that suits you.
(our online mongodb does not set a password, and the relevant code is commented out in the script), and chmod adds execution permission.
#! / bin/bash
# # #
# AUTHOR: Neo
# WEBSITE: http://www.netkiller.cn
# Description £ozabbix mongodb monitor
# Note £oZabbix 3.2
# DateTime: 2016-11-23
# # #
# the mongodb of my online environment does not have a password configured, but only the IP that restricts access through iptables
HOST=localhost
PORT=27017
# USER=monitor
# PASS=chen
Index=$ (echo$@ | tr ".")
# status=$ (echo "db.serverStatus (). ${index}" | mongo-u ${USER}-p ${PASS} admin--port ${PORT} | sed-n '3p')
Status=$ (echo "db.serverStatus (). ${index}" | / usr/local/mongodb/bin/mongo admin--port ${PORT} | sed-n '3p')
# checkif the output contains "NumberLong"
If [["$status" = ~ "NumberLong"]; then
Echo $status | sed-n 's/NumberLong (/ / p' | sed-n 's /) / / p'
Else
Echo $status
Fi
2. Copy userparameter_mongodb.conf to / etc/zabbix/zabbix_agentd.d, as shown below:
UserParameter=mongodb.status [*], / etc/zabbix/scripts/mongodb.sh$1 $2 $3 $4 $5
3. Import the monitoring template in the web backend of zabbix, and associate the mongodb host with the template.
The attachment is a package of the three files mentioned above.
The configured monitoring is as shown below:
The monitoring template of the copy set version of MongoDB is in the experiment, no problem and then post it.
Attachment: http://down.51cto.com/data/2366564
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.