1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| #当前连接数,包括当前的shell会话,副本集成员连接,mongos实例连接 #(4.0version)connections.current[*],echo "db.serverStatus().connections.current"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=connections.current[*],echo "db.serverStatus().connections.current"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#当前可用的连接数,数据库上的连接负载的值 #(4.0version)connections.available[*],echo "db.serverStatus().connections.available"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=connections.available[*],echo "db.serverStatus().connections.available"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#服务器所有的连接,包括已经关闭的连接 #(4.0version)connections.totalCreated[*],echo "db.serverStatus().connections.totalCreated"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=connections.totalCreated[*],echo "db.serverStatus().connections.totalCreated"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p|cut -d '(' -f2|cut -d ')' -f1
#因锁而造成排队等待的总数 #(4.0version)UserParameter=globalLock.currentQueue.total[*],echo "db.serverStatus().globalLock.currentQueue.total"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=globalLock.currentQueue.total[*],echo "db.serverStatus().globalLock.currentQueue.total"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p #因读锁而造成排队等待的数量 #(4.0version)UserParameter=globalLock.currentQueue.readers[*],echo "db.serverStatus().globalLock.currentQueue.readers"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=globalLock.currentQueue.readers[*],echo "db.serverStatus().globalLock.currentQueue.readers"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p #因写锁而造成排队等待的数量 #(4.0version)UserParameter=globalLock.currentQueue.writers[*],echo "db.serverStatus().globalLock.currentQueue.writers"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p #3.0version UserParameter=globalLock.currentQueue.writers[*],echo "db.serverStatus().globalLock.currentQueue.writers"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#当前数据库进程占用内存情况 #(4.0version)mem.resident[*],echo "db.serverStatus().mem.resident"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=mem.resident[*],echo "db.serverStatus().mem.resident"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#当前数据库进程占用虚拟内存的大小 #(4.0version)mem.virtual[*],echo "db.serverStatus().mem.virtual"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=mem.virtual[*],echo "db.serverStatus().mem.virtual"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#流入mongodb数据库的总量 #(4.0version)network.bytesIn[*],echo "db.serverStatus().network.bytesIn"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh| grep NumberLong |cut -d '(' -f2|cut -d ')' -f1 #3.0version UserParameter=network.bytesIn[*],echo "db.serverStatus().network.bytesIn"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#数据库流出总量 #(4.0version)network.bytesOut[*],echo "db.serverStatus().network.bytesOut"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh| grep NumberLong |cut -d '(' -f2|cut -d ')' -f1|cut -d '"' -f2|cut -d '"' -f1 #3.0version UserParameter=network.bytesOut[*],echo "db.serverStatus().network.bytesOut"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#数据库总请求数 #(4.0version)network.numRequests[*],echo "db.serverStatus().network.numRequests"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh| grep NumberLong |cut -d '(' -f2|cut -d ')' -f1 #3.0version UserParameter=network.numRequests[*],echo "db.serverStatus().network.numRequests"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#当前副本集状态,为1代表为主节点,为2代表为从节点 #(4.0version)rs.status.myState[*],echo "rs.status().myState"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=rs.status.myState[*],echo "rs.status().myState"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
#页错误总数,当数据库性能不佳、内存限制、或者数据库较大会导致该值增加 #(4.0version)extra_info.page_faults[*],echo "db.serverStatus().extra_info.page_faults"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 4p #3.0version UserParameter=extra_info.page_faults[*],echo "db.serverStatus().extra_info.page_faults"|sh /usr/local/zabbix/script/zabbix_monitor_mongodb.sh|sed -n 3p
|