nagios-plugin-mongodb | A Nagios plugin to check the status of MongoDB | Monitoring library
kandi X-RAY | nagios-plugin-mongodb Summary
kandi X-RAY | nagios-plugin-mongodb Summary
This is a simple Nagios check script to monitor your MongoDB server(s).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Check replication set
- Prints a critical error
- Connect to MongoDB
- Checks if a parameter is in the critical level
- R Check memory usage
- Get server status
- Set read preference
- Calculate the checks
- This function is called when an exception is raised
- Check database size
- Check replset quorum
- Check the collection storage size
- Check global lock
- Check all databases sizes
- Check the total index of a collection
- Check the index of the database
- Check if a background flush is available
- Check pages of pages
- Check if the primary server has changed
- Check connection to primary server
- Check replica state
- Get index miss ratio
- Checks the oplog for consistency
- Calculate the balance of the chunks in MongoDB
- Check the number of queries per second
- Check for memory usage
nagios-plugin-mongodb Key Features
nagios-plugin-mongodb Examples and Code Snippets
Community Discussions
Trending Discussions on Monitoring
QUESTION
I need to get the IP numbers that are connecting to the EC2 instance then add them to AWS security group as a security group rule. So only those machines will have the permission to connect to instance. I don't need the port number that they're connecting to instance.
I installed iptraf-ng but app is very slow on the instance. Any other suggestions to capture the connecting IP's to instance so I can add them faster to security group rule?
...ANSWER
Answered 2022-Apr-08 at 16:12You can use VPC Flow logs to monitor the traffic to the VPC (which will include the traffic that is going to the EC2 instance).
QUESTION
I have a problem with checking my service on other windows or Linux servers.
My problem is that I have to make a request from one server to the other servers and check if the vital services of those servers are active or disabled.
I wrote Python code to check for services, which only works on a local system.
...ANSWER
Answered 2022-Mar-08 at 17:46As far as I know, psutil
can only be used for gathering information about local processes, and is not suitable for retrieving information about processes running on other hosts. If you want to check whether or not a process is running on another host, there are many ways to approach this problem, and the solution depends on how deep you want to go (or need to go), and what your local situation is. From the top of my head, here are some ideas:
If you are only dealing with network services with exposed ports:
A very simple solution would involve using a script and a port scanner (nmap); if a port that a service is listening behind, is open, then we can assume that the service is running. Run the script every once in a while to check up on the services, and do your thing.
If you want to stay in Python, you can achieve the same end result by using Python's
socket
module to try and connect to a given host and port to determine whether or not the port that a service is listening behind, is open.A Python package or tool for monitoring network services on other hosts like this probably already exists.
If you want more information and need to go deeper, or you want to check up on local services, your solution will have to involve a local monitor process on each host, and connecting to that process to gather information.
- You can use your code to implement a server that lets clients connect to it, to check up on the services running on that host. (Check the
socket
module's official documentation for examples on how to implement clients and servers.)
Here's the big thing though. Based on your question and how it was asked, I would assume that you do not have the experience nor the insight to implement this in a secure way yet. If you're using this for a simple hobby/student project, roll out your own solution, and learn. Otherwise, I would recommend that you check out an existing solution like Nagios, and follow the security recommendations very closely.
QUESTION
I am trying to set up a dashboard on Datadog that will show me the streaming metrics for my streaming job. The job itself contains two tasks one task has 2 streaming queries and the other has 4 (Both tasks use the same cluster). I followed the instructions here to install Datadog on the driver node. However when I go to datadog and try to create a dashboard there is no way to differentiate between the 6 different streaming queries so they are all lumped together (none of the tags for the metrics are different per query).
...ANSWER
Answered 2022-Mar-11 at 18:18After some digging I found there is an option you can enable via the init script called enable_query_name_tag which is disabled by default as it can cause there to be a ton of tags created when you are not using query names.
The modification is shown here:
QUESTION
I have a metric with 2 labels. Both labels can have 2 values A or B.
I'd like to sum all the values and exclude the case when Label1=A and Label2=B.
...ANSWER
Answered 2022-Mar-02 at 17:51Try the following query:
QUESTION
I'm trying to set up Prometheus-to-Prometheus metrics flow, I was able to do it by flag --enable-feature=remote-write-receiver
.
However I need to have mTLS there, can someone advice a manual or post a config sample?
Appreciate you help
...ANSWER
Answered 2022-Feb-24 at 06:08There is a second config file with experimental options related to HTTP server, and it has options to enable TLS:
QUESTION
I have the following docker-compose file:
...ANSWER
Answered 2022-Feb-19 at 17:59The solution to this problem is to use an actual service discovery instead of static targets. This way Prometheus will scrape each replica during each iteration.
If it is just docker-compose (I mean, not Swarm), you can use DNS service discovery (dns_sd_config) to obtain all IPs belonging to a service:
QUESTION
I'm new to monitoring the k8s cluster with prometheus, node exporter and so on.
I want to know that what the metrics exactly mean for though the name of metrics are self descriptive.
I already checked the github of node exporter, but I got not useful information.
Where can I get the descriptions of node exporter metrics?
Thanks
...ANSWER
Answered 2022-Feb-10 at 08:34There is a short description along with each of the metrics. You can see them if you open node exporter in browser or just curl http://my-node-exporter:9100/metrics
. You will see all the exported metrics and lines with # HELP
are the description ones:
QUESTION
Say I have two metrics in Prometheus, both counters:
Ok:
...ANSWER
Answered 2022-Feb-08 at 18:32You need the following query:
QUESTION
It may be a vague question but I couldn't find any documentation regarding the same. Does Google cloud platform have provision to integrate with OpsGenie?
Basically we have set up few alerts in GCP for our Kubernetes Cluster monitoring
and we want them to be feeded to OpsGenie
for Automatic call outs in case of high priority incidents.
Is it possible?
...ANSWER
Answered 2022-Jan-26 at 08:39QUESTION
I’ve a PVC in RWX. 2 pods use this PVC. I want to know which pods ask volume to the PVC and when. How can I manage that?
...ANSWER
Answered 2021-Dec-03 at 15:33As far as i know there is no direct way to figure out a PVC is used by which pod To get that info possible workaround is grep through all the pods for the respective pvc :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nagios-plugin-mongodb
Edit your commands.cfg and add the following. (add -D to the command if you want to add perfdata to the output) Then you can reference it like the following. This is is my services.cfg. This will check each host that is listed in the Mongo Servers group. It will issue a warning if the connection to the server takes 2 seconds and a critical error if it takes over 4 seconds. This is a test that will check the percentage of free connections left on the Mongo server. In the following example it will send out an warning if the connection pool is 70% used and a critical error if it is 80% used. This is a test that will test the replication lag of Mongo servers. It will send out a warning if the lag is over 15 seconds and a critical error if its over 30 seconds. Please note that this check uses 'optime' from rs.status() which will be behind realtime as heartbeat requests between servers only occur every few seconds. Thus this check may show an apparent lag of < 10 seconds when there really isn't any. Use larger values for reliable monitoring. This is a test that will test the replication lag percentage of Mongo servers. It will send out a warning if the lag is over 50 percents and a critical error if its over 75 percents. Please note that this check gets oplog timeDiff from primary and compares it to replication lag. When this check reaches 100 percent full resync is needed. This is a test that will test the memory usage of Mongo server. In my example my Mongo servers have 32 gigs of memory so I'll trigger a warning if Mongo uses over 20 gigs of ram and a error if Mongo uses over 28 gigs of memory. This is a test that will check the mapped memory usage of Mongo server. This is a test that will test the lock time percentage of Mongo server. In my example my Mongo I want to be warned if the lock time is above 5% and get an error if it's above 10%. When you start to have lock time it generally means your db is now overloaded. This is a test that will check the average flush time of Mongo server. In my example my Mongo I want to be warned if the average flush time is above 100ms and get an error if it's above 200ms. When you start to get a high average flush time it means your database is write bound. This is a test that will check the last flush time of Mongo server. In my example my Mongo I want to be warned if the last flush time is above 200ms and get an error if it's above 400ms. When you start to get a high flush time it means your server might be needing faster disk or its time to shard. This is a test that will check the status of nodes within a replicaset. Depending which status it is it sends a waring during status 0, 3 and 5, critical if the status is 4, 6 or 8 and a ok with status 1, 2 and 7. Note the trailing 2 0's keep those 0's as the check doesn't compare to anything.. So those values need to be there for the check to work. This is a test that will check the ratio of index hits to misses. If the ratio is high, you should consider adding indexes. I want to get a warning if the ratio is above .005 and get an error if it's above .01. These tests will count the number of databases and the number of collections. It is usefull e.g. when your application "leaks" databases or collections. Set the warning, critical level to fit your application. This will check the size of a database. This is useful for keeping track of growth of a particular database. Replace your-database with the name of your database. This will check the index size of a database. Overlarge indexes eat up memory and indicate a need for compaction. Replace your-database with the name of your database. This will check the index size of a collection. Overlarge indexes eat up memory and indicate a need for compaction. Replace your-database with the name of your database and your-collection with the name of your collection. This will check the primary server of a replicaset. This is useful for catching unexpected stepdowns of the replica's primary server. Replace your-replicaset with the name of your replicaset. This will check the number of queries per second on a server. Since MongoDB gives us the number as a running counter, we store the last value in the local database in the nagios_check collection. The following types are accepted: query|insert|update|delete|getmore|command. This command will check updates per second and alert if the count is over 200 and warn if over 150. This will check each host that is listed in the Mongo Servers group. It will issue a warning if the connection to the primary server of current replicaset takes 2 seconds and a critical error if it takes over 4 seconds. This will check each host that is listed in the Mongo Servers group. It can be useful to check availability of a critical collection (locks, timeout, config server unavailable...). It will issue a critical error if find_one query failed.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page