mirror of
https://github.com/aljazceru/zabbix.git
synced 2025-12-17 16:44:22 +01:00
MongoDB for Zabbix 3.2
This commit is contained in:
23
mongodb/mongodb.sh
Normal file
23
mongodb/mongodb.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
##################################################
|
||||
# AUTHOR: Neo <netkiller@msn.com>
|
||||
# WEBSITE: http://www.netkiller.cn
|
||||
# Description<6F><6E>zabbix mongodb monitor
|
||||
# Note<74><65>Zabbix 3.2
|
||||
# DateTime: 2016-11-23
|
||||
##################################################
|
||||
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')
|
||||
|
||||
#check if the output contains "NumberLong"
|
||||
if [[ "$status" =~ "NumberLong" ]];then
|
||||
echo $status|sed -n 's/NumberLong(//p'|sed -n 's/)//p'
|
||||
else
|
||||
echo $status
|
||||
fi
|
||||
11
mongodb/userparameter_mongodb.conf
Normal file
11
mongodb/userparameter_mongodb.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
############################################################
|
||||
# MongoDB - statistics
|
||||
#
|
||||
# Author: Neo Chen <netkiller@msn.com>
|
||||
# Website: http://www.netkiller.cn
|
||||
############################################################
|
||||
|
||||
# Discovery
|
||||
|
||||
# Return Redis statistics
|
||||
UserParameter=mongodb.status[*],/srv/zabbix/libexec/mongodb.sh $1 $2 $3 $4 $5
|
||||
1346
mongodb/zbx_export_templates.xml
Normal file
1346
mongodb/zbx_export_templates.xml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user