Home Set up alerts in Proxmox before it's too late!
Post
Cancel

Set up alerts in Proxmox before it's too late!

Setting up alerts in Proxmox is important and critical to making sure you are notified if something goes wrong with your servers. It’s so easy, I should have done this years ago! In this tutorial, we’ll set up email notifications using SMTP with Gmail or G Suite that send email alerts when there are disk errors, ZSF Issues, or when backup jobs run. We’ll then test the alerts to make sure they are working by yoinking a drive from my ZFS pool (and hopefully it doesn’t fail).

📺 Watch Video

Huge THANK YOU to Micro Center for Sponsoring Today’s video!

New Customer Exclusive – Free 256GB SDD: https://micro.center/24c

Check out Micro Center’s PC Builder: https://micro.center/1wk

Submit your build to Micro Center’s Build Showcase: https://micro.center/tvv

Shop Micro Center’s Top Deals: https://micro.center/jb4

Configuring Alerts

install dependencies

1
2
apt update
apt install -y libsasl2-modules mailutils

Configure app passwords on your Google account

https://myaccount.google.com/apppasswords

Configure postfix

1
echo "smtp.gmail.com [email protected]:YourAppPassword" > /etc/postfix/sasl_passwd

update permissions

1
chmod 600 /etc/postfix/sasl_passwd

hash the file

1
postmap hash:/etc/postfix/sasl_passwd

check to to be sure the db file was create

1
cat /etc/postfix/sasl_passwd.db

edit postfix config

1
nano /etc/postfix/main.cf
1
2
3
4
5
6
7
8
9
10
# google mail configuration

relayhost = smtp.gmail.com:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s

reload postfix

1
postfix reload

send a test emails

1
echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" [email protected]

fix from name in email

install dependency

1
2
apt update
apt install postfix-pcre

edit config

1
nano /etc/postfix/smtp_header_checks

add the following text

1
/^From:.*/ REPLACE From: pve1-alert <pve1-alert@something.com>

hash the file

1
postmap hash:/etc/postfix/smtp_header_checks

check the contents of the file

1
cat /etc/postfix/smtp_header_checks.db

add the module to our postfix config

1
nano /etc/postfix/main.cf

add to the end of the file

1
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

reload postfix service

1
postfix reload

Chapters

00:00 - Why you should set up alerts in Proxmox

01:42 - Micro Center / Free SSD (Sponsor)

02:56 - Where can I find the documentation

03:07 - Installing and configuring dependencies

03:54 - Google Email address configuration

08:43 - Configuring postfix and customizing the email alert

11:47 - Changing the mail sender name with pcre

14:20 - Configure where email alerts are sent

15:01 - Backup Alerts

17:33 - SMART alerts

18:53 - ZFS Alerts

19:52 - Testing in Production

24:03 - How Proxmox alerts could be better

25:30 - Stream Highlight - “Just some flashing lights & music”

Join the conversation

⚙️ See all the hardware I recommend at https://l.technotim.live/gear

🚀 Don’t forget to check out the 🚀Launchpad repo with all of the quick start source files

This post is licensed under CC BY 4.0 by the author.

Automated NUT Server Install

Techno Tim HomeLab Server Room Tour! (Late 2022)