Skip to content

weetech-software/alert_threshold

Repository files navigation

What is alert_threshold?

Active metrics monitoring triggers an alert if the monitored metric exceeds a predefined threshold.

Install python 3.13.0

This app requires Python. Please install Python. For the Python install script, see here.

Environment setup

This application will run in a Python virtual environment.

/opt/weetech/python-3.13.0/bin/python3.13 -m venv alert_threshold_env
source alert_threshold_env/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt

How to run this app?

This assumes that alert_threshold is installed in /app.

$ cd /app/alert_threshold/;
$ source alert_threshold_env/bin/activate;
$ python3 alert_threshold_metric.py --log_dir /var/log/monitor
                                    --check_config_dir /app/alert_threshold/conf/
                                    --state_file_dir /var/lib/monitoring-weetech-ch/state
                                    --ssh_username john
                                    --ssh_port 22
                                    --ssh_private_key /app/alert_threshold/key.pem
                                    --ssh_host_script_dir /app/monscript/
                                    --alert_email_recipient root
                                    --alert_email_from [email protected]
                                    --alert_email_smtp_host localhost
                                    --alert_email_smtp_port 25
                                    --alert_telegram_token <my_bot_token>
                                    --alert_telegram_api_key <my_api_key>
                                    --alert_telegram_chat_id <my_chat_id>;

Integration alert_threshold with Jenkins

To run this application periodically and ensure system admins/support receive timely alerts, a Jenkins installation is required.

  1. Make sure you have already run this app as described in the How to run this app section.
  2. Download and install Jenkins. While Jenkins setup is outside the scope of this document, more information can be found here.
  3. Create a Freestyle Project in Jenkins and apply the appropriate settings. The minimum required settings are:
  • Build periodically
  • Execute Shell

4. That’s it! Check the console output for any errors. A YouTube video has also been created to briefly demonstrate this integration: Integration of alert_threshold with Jenkins

About

Active metrics monitoring if the monitored metric exceed a predefined threshold

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages