

We want the above output to be pushed to our mobile phone immediately. The output verbosity of the captured query is informative enough. You should see the following output: Date: Thu Oct 31 03:13: Now, run a query that would take more than 30 seconds to complete on the database node. OUTPUT=$(mysql -A -Bse "SELECT * FROM information_schema.processlist WHERE command = 'Query' AND time > $QUERY_TIMEG")Ĭreate an option file so we can automate the user login via “mysql” client: $ vim ~/.my.cnfīefore running the script, give the script an execution permission beforehand: $ chmod 755 detect_long_query.sh The following bash script should do the job: #!/bin/bash We will utilize information_schema for this purpose where we can populate the needed result using SQL query. Suppose we are having a MySQL database server, and we would like to detect all queries that have been running for more than 30 seconds by scanning the MySQL processlist every 10 seconds. This script will query some stuff, check something and present an output if the conditions are met. Create a Detection Scriptįirstly, we have to create a detection script.

In our example, we’ll show you howyou can get notified on your cell phone in case a query takes more than 30 seconds to complete.
#Free rss bot telegram mac#
Telegram apps can be downloaded from the Apple App Store, Google Play Store, as well as for the desktop version on Windows, Mac and Linux. The basic idea is to detect something and send a push notification via Telegram. This is a very useful trick to get notified in real-time when a problem happens, especially when the issue occurs randomly and you can’t see a pattern.
#Free rss bot telegram how to#
In this blog post, we are going to show you how to send push notifications to your mobile via Telegram from the database server. Quite often, it can be useful to send stuff to yourself. A bot allows automated systems and servers to send telegram messages to users.

Users can interact with bots by sending them messages, commands and inline requests and it can be controlled by using HTTPS requests to Telegram’s bot API. One of the great features of Telegram is its bot platform.
