File manager - Edit - /usr/lib64/nagios/plugins/check_jetbackup_mongodb
Back
#!/bin/bash if [ ! -f "/usr/local/jetapps/etc/.mongod.auth" ]; then echo "[OK]: JetBackup is not installed on this server" exit 0 fi PASS=$(cat /usr/local/jetapps/etc/.mongod.auth | grep '^PASS=' | awk -F'=' '{print $2}') if [[ -x /usr/local/jetapps/usr/bin/mongo ]]; then bin_jetmongocli=/usr/local/jetapps/usr/bin/mongo elif [[ -x /usr/local/jetapps/usr/bin/mongosh ]]; then bin_jetmongocli=/usr/local/jetapps/usr/bin/mongosh else echo "CRITICAL: mongo cli not found" exit 2 fi OK=$(${bin_jetmongocli} --port 27217 --username=root --password="$PASS" --authenticationDatabase=admin --quiet jetbackup --eval "printjson(db.stats().ok)") if [ "$?" != "0" ]; then echo 'CRITICAL: Failed to connect to jetmongo'; exit 2; fi if [ "$OK" != "1" ]; then echo 'CRITICAL: jetmongo is not working'; exit 2; fi echo 'OK: jetmongo is working'; exit 0;
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings