Sample python script for monitoring Rocketchat database and get statistics of users.

Overview

rocketchat-DB-monitoring

Sample python script for monitoring Rocketchat database and get statistics of users.

1. Update python:

yum check-update && yum install python3 -y
pip3 install pymongo
pip3 install dotenv
pip3 install "python-dotenv[cli]"

2. Update the .env file with your appropriate MongoDB replicaset IP and port.

3. Go to the directory where script placed and run it.

python3 rocketchat_db_query.py

Grafana Dashboard Grafana Dashboard Grafana Dashboard

You might also like...
Osu statistics right on your desktop, made with pyqt
Osu statistics right on your desktop, made with pyqt

Osu!Stat Osu statistics right on your desktop, made with Qt5 Credits Would like to thank these creators for their projects and contributions. ppy, osu

Statistics Calculator module for all types of Stats calculations.

Statistics-Calculator This Calculator user the formulas and methods to find the statistical values listed. Statistics Calculator module for all types

Performance monitoring and testing of OpenStack

Browbeat Browbeat is a performance tuning and analysis tool for OpenStack. Browbeat is free, Open Source software. Analyze and tune your Cloud for opt

Linux Security and Monitoring Scripts

Linux Security and Monitoring Scripts These are a collection of security and monitoring scripts you can use to monitor your Linux installation for sec

Script to quickly get the metrics from Github repos to analyze.

commit-prefix-analysis Script to quickly get the metrics from Github repos to analyze. Setup Install the Github CLI. You'll know its working when runn

This script can be used to get unlimited Gb for WARP.

Warp-Unlimited-GB This script can be used to get unlimited Gb for WARP. How to use Change the value of the 'referrer' to warp id of yours You can down

Stock Monitoring
Stock Monitoring

Stock Monitoring Description It is a stock monitoring script. This repository is still under developing. Getting Started Prerequisites & Installing pi

Monitoring of lake dynamics

Monitoring of lake dynamics This is a program that uses multi-source remote sensing data to monitor the dynamic changes of lakes. The detailed introdu

InverterApi - This project has been designed to take monitoring data from Voltronic, Axpert, Mppsolar PIP, Voltacon, Effekta

InverterApi - This project has been designed to take monitoring data from Voltronic, Axpert, Mppsolar PIP, Voltacon, Effekta

Comments
  • The script

    The script "rocketchat_db_query.py" run once and fail

    i dont know why, i can run the script once, and cannot run latter root@web-srv2:/opt/rocketchat_mongoDB_monitoring-main# ll /var/lib/node_exporter/ total 36 drwxr-xr-x 2 root root 4096 Jun 6 10:18 ./ drwxr-xr-x 31 root root 4096 Jun 6 10:18 ../ -rw-r--r-- 1 root root 21 Jun 6 10:18 away_users.prom -rw-r--r-- 1 root root 20 Jun 6 10:18 busy_users.prom -rw-r--r-- 1 root root 26 Jun 6 10:18 offline_users.prom -rw-r--r-- 1 root root 23 Jun 6 10:18 online_users.prom -rw-r--r-- 1 root root 19 Jun 6 10:18 total_rooms.prom -rw-r--r-- 1 root root 30 Jun 6 10:18 total_sent_msgs.prom -rw-r--r-- 1 root root 34 Jun 6 10:18 total_uploade_docs.prom root@web-srv2:/opt/rocketchat_mongoDB_monitoring-main# python3 rocketchat_db_query.py Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/pymongo/common.py", line 784, in get_validated_options value = validator(opt, value) File "/usr/local/lib/python3.10/dist-packages/pymongo/common.py", line 159, in raise_config_error raise ConfigurationError("Unknown option %s" % (key,)) pymongo.errors.ConfigurationError: Unknown option replsetname

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/opt/rocketchat_mongoDB_monitoring-main/rocketchat_db_query.py", line 176, in main() File "/opt/rocketchat_mongoDB_monitoring-main/rocketchat_db_query.py", line 156, in main onlineUsers = _countOnlineUsers() File "/opt/rocketchat_mongoDB_monitoring-main/rocketchat_db_query.py", line 110, in _countOnlineUsers QUERY = _mongoConnection("USERS").count_documents({"status": "online"}) #Count Online Users File "/opt/rocketchat_mongoDB_monitoring-main/rocketchat_db_query.py", line 92, in _mongoConnection MONGO_CLIENT = MongoClient(MONGODB_URI) File "/usr/local/lib/python3.10/dist-packages/pymongo/mongo_client.py", line 704, in init res = uri_parser.parse_uri( File "/usr/local/lib/python3.10/dist-packages/pymongo/uri_parser.py", line 511, in parse_uri options.update(split_options(opts, validate, warn, normalize)) File "/usr/local/lib/python3.10/dist-packages/pymongo/uri_parser.py", line 348, in split_options options = validate_options(options, warn) File "/usr/local/lib/python3.10/dist-packages/pymongo/uri_parser.py", line 306, in validate_options return get_validated_options(opts, warn) File "/usr/local/lib/python3.10/dist-packages/pymongo/common.py", line 787, in get_validated_options earnings.warn(str(exc)) NameError: name 'earnings' is not defined. Did you mean: 'warnings'? root@web-srv2:/opt/rocketchat_mongoDB_monitoring-main#

    opened by heroes1412 4
Owner
Mojtaba Taleghani
Mojtaba Taleghani
This is sample project needed for security course to connect web service to database

secufaku This is sample project needed for security course to "connect web service to database". Why it suits alignment purpose It connects to postgre

Mark Nicholson 6 May 15, 2022
Islam - This is a simple python script.In this script I have written all the suras of Al Quran. As a result, by using this script, you can know the number of any sura at the moment.

Introduction: If you want to know sura number of al quran by just typing the name of sura than you can use this script. Usage in termux: $ pkg install

Fazle Rabbi 1 Jan 2, 2022
A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

null 1 Dec 19, 2021
Library for Memory Trace Statistics in Python

Memory Search Library for Memory Trace Statistics in Python The library uses tracemalloc as a core module, which is why it is only available for Pytho

Memory Search 1 Dec 20, 2021
Cloud Native sample microservices showcasing Full Stack Observability using AppDynamics and ThousandEyes

Cloud Native Sample Bookinfo App Observability Bookinfo is a sample application composed of four Microservices written in different languages.

Cisco DevNet 13 Jul 21, 2022
This is a far more in-depth and advanced version of "Write user interface to a file API Sample"

Fusion360-Write-UserInterface This is a far more in-depth and advanced version of "Write user interface to a file API Sample" from https://help.autode

null 4 Mar 18, 2022
A python script to get your activity

activities A python script to get your activity Not complete Requirements Python (>=3.7) Pip (for python >= 3.7) Git Pip packages psutil asyncio aioht

StarNumber 3 Nov 7, 2021
skimpy is a light weight tool that provides summary statistics about variables in data frames within the console.

skimpy Welcome Welcome to skimpy! skimpy is a light weight tool that provides summary statistics about variables in data frames within the console. Th

null 267 Dec 29, 2022
Sample microservices application demo

Development mode docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d or export COMPOSE_FILE='docker-compose.yml:docker-compose.dev.ym

Konstantinos Bairaktaris 1 Nov 14, 2021
Korg Volca Sample uploader for linux.

GnuVolca Korg Volca Sample uploader for linux. GnuVolca Usage Installation Via virtualenv Usage Store all the samples you want to upload on an empty d

Gonzalo Rafuls 12 Oct 11, 2022