Alert emails

Hello all!

Something changed in an update, hoping looking for help figuring this out. Under Alert Settings > Applications > “Application Update Available” set to Immediately to send an email as I would like to get an email when updates are available for my apps.

When I run those updates, I get an email saying it was cleared, and that was it. I have an email filter to filter those but if someone knows how to not get those either that would be great.

This uses to work, sorry I don’t know what update changed it. Now after each update runs, I get another email saying updates are available for the remainder apps. So if I have 10 updates, I get an update showing 10. Then I run those and after each one is updated I get one that shows 9, then 8, then 7 and so on. At the end of this, I would get about 30+ emails for 10 app updates.

Anyone know how to set this so that I can just get one email that there are updates and not when the alerts are cleared or for each one remaining?

How about spending a whole extra 2 minutes to PROPERLY explain your issue!?

Which SPECIFIC update?
WHEN?

Specific examples, instead of stuff that makes zero sense??

Thanks for coming in hot.

If you get off your high horse, take an extra two minutes to PROPERLY read I said APPLICATION UPDATE AVAILABLE. As in the apps. Docker apps. Which is what that entire section of alert management is for. If that is not enough, having 10 updates at a time makes it pretty clear what I’m talking about.

I even took out the time to say, step by step where I was at. “Alert Settings > Applications > “Application Update Available””

If none of that was clear to you then maybe you’re not able to help me.

If I sound rude it’s only because you are. I match energy, so thanks.

I think you’re stuck getting an email for every alarm that get cleared :frowning: Might be an idea as a “Feature Request”, but I wouldn’t hold my breath. Only work-around I could think of, would be prior to updating the apps, go to the alert settings, disable the email alarm for updates, then update, then re-enable.

At best it is a hacky workaround that involves some extra clicks.

Edit: If you’re solid at the TrueNAS api, I could imagine a script could be made that disables the alarms, updates the apps, waits until they are updated, then re-enabled the alarms in a single command. Beyond me to make though.

Some time ago i have made a little snipplet to run once a day, that call the app api to retrieve upgrade availables, and send an email accordingly.
I’m not using It anymore because i literally have only Portainer as app from catalogue :smile: but if you are interested i’m sure to have It somewhere saved on my notes

1 Like

@Fleshmauler @oxyde thanks for your help! I was thinking, I might be able to change the frequency to hourly? Not ideal but might just be the easiest solution. Was just thinking if someone smarter had my issue and OCD and came up with something.

I believe this is the same issue you’re talking about?

Fix is due in 26, so you may still want to look into a workaround in the meantime.

2 Likes

My suggestion was more to bypass completely the internal notification system, and now we know that this behaviour will be fixed (so can be IMHO a valid workaround :smile: )

Maybe give it a try, i dusted off the snipplet

if [ $(midclt call app.query | jq '[.[] | select(.upgrade_available == true)] | length') -gt 0 ]; then cd /mnt/CHANGEME && python3 sendemail.py --subject "🔷 App Upgrade" --to_address "CHANGEME@EMAIL.COM" --mail_body_html "&nbsp;" --use_template "UT_table_5col" --template_var "$(midclt call app.query | jq -c '{col1:"&nbsp;", col2:"App", col3:"State", col4:"Version", col5:"Upgrade Available", containers: [.[] | select(.upgrade_available == true) | {col1: ((.metadata.icon // "") | if length>0 then ("<img src=\"" + . + "\" alt=\"icon\" style=\"width:30px;vertical-align:middle\">") else "-" end), col2: (.name // "-"), col3: (.state // "-"), col4: (.human_version // "-"), col5: (.upgrade_available // "-")}]}')"; fi

you need the sendemail script, and change script path/email address… then add it as command of a cron job in your nas.
The template was made to show all the apps, i just repurpose it for this scope :smile:
The need to run it only once a day is because it doesn’t keep track of past executions.

1 Like

Getting spammed with those “cleared” alerts is honestly the most annoying part of that setup. Feels like the system is just reacting to every state change instead of grouping them. From what I’ve seen, there’s no clean way to suppress those individually, so the disable-update-reenable trick or a small API script is probably the only realistic path right now

1 Like

Yeah that is exactly what I am talking about! Sounds like they are working on it, so that is all I need. thanks!