AA-2893: Implement Alert mechanism using Postfix

Review Request #896 — Created June 3, 2025 and submitted

apoorva.sn
AMP
amp_4_0
AA-2893
pmurugaiyan, prajesh, shuinvy

Problem

Implement Alert mechanism using Postfix

Solution

Have written 2 scripts:

install_postfix.sh- Installed postfix, snail and related dependencies and creating cron for executing send_alert_cpu_memory_stats.sh
send_alert_cpu_memory_stats.sh- checks the system config every few min(30min) and sends mail with the configuration details of the system.
The mail format and what need to be sent can be improvised later depending for which scenario to send the mail and also the frequency

Tested changes on my Rocky Linux setup

Description From Last Updated

Why GMail ? May be need to fix the comment?

prajeshprajesh

Can this be part of InfluxDB itself?

pmurugaiyanpmurugaiyan

Where is this tables - settings & notifications (use smallcase for table names to align with other tables.

pmurugaiyanpmurugaiyan

Use 127.0.0.1 instead of localhost

pmurugaiyanpmurugaiyan

remove this crontab, and can it be configured as a task from InfluxDB?

pmurugaiyanpmurugaiyan
shuinvy
  1. Ship It!
  2. 
      
prajesh
  1. 
      
  2. Why GMail ? May be need to fix the comment?

    1. Yes initially tested with Gmail and dint change the comment back. Have updated

  3. 
      
apoorva.sn
pmurugaiyan
  1. 
      
  2. Can this be part of InfluxDB itself?

    1. This script we can remove later depending on how we want trigger the mail.

  3. Where is this tables - settings & notifications (use smallcase for table names to align with other tables.

    1. included init_db.sql.. Tables names are not case sensitive it will always be created in lowercase.

    2. It is, for better readability I was mentioning. Only these 2 table names look odd.

    3. Done

  4. Use 127.0.0.1 instead of localhost

    1. any reason.. 127.0.0.1 is localhist right ?

    2. localhost can be IPv4 or IPv6. We have the firewall rules based on IPv4, and 127.0.0.1 referred in other places.

  5. remove this crontab, and can it be configured as a task from InfluxDB?

    1. We can modify both the scripts after we decide on how we will be actually triggering the mail.
      With both the scripts have created a template on what needs to be done.
      We can probably move the code away from Shell script to python in case it will be better option.

  6. 
      
apoorva.sn
shuinvy
  1. Ship It!
  2. 
      
apoorva.sn
apoorva.sn
pmurugaiyan
  1. Ship It!
  2. 
      
apoorva.sn
Review request changed

Status: Closed (submitted)

Loading...