Multi-Report

This can only mean that the value Is getting overwritten during the send, i suspect something going wrong when grabbing the value from config, i will send you in private a version with more debugging to run when i come to a pc, i’m not able to reproduce It now Is working for me

1 Like

I can add anything that makes sense. As a quick fix:
On line 11159 (right after the load_config)
Add
FromName=$From

Whala!

It is a little more difficult to actually make the change because you have to consider the multi_report_config.txt file would also need to be updated, and the rest of the script.

Let me know if adding that one line solves the problem for the moment.

EDIT: Crap, I read what I wrote. That new line needs to be directly after load_config otherwise when the config file loads, it will overwrite the default values.

@GrimmReaperNL i tried to send you a private message but the forum just stuck on sending… don’t think you received it i post there
First, sorry for the effort :grimacing:

  • grab this file: mr_sendemail.txt (17.3 KB) it just print 2 variable directly respect the release
  • put it into your multi report folder
  • delete the mr_sendemail.py file
  • rename the new file with the correct extension .py instead of .txt
  • log into the shell, cd into the multi report folder
  • run this simple command to trigger an email
./mr_sendemail.py --subject "TEST" --to_address "CHANGEME@gmail.com" --mail_body_html "<h1>Hello World!</h1><p>Test Email</p>"
  • you must see printed in the console the FromName (surely blank) and the From resulted from the mr config file read. This value is what we need to understand what’s going on, must be just the email address you put in the config, without anything else (like comment, space, ecc ecc).

Let me know

Man no need to rush :smiling_face_with_three_hearts:
Actually, this is the first improvement from sendemail switching, we are giving “gmail oauth” users the possibility to setting a specific name as sender, like we do for the “smtp users”

Updated to version 3.12 and now the script just doesn’t run at all. No output when run from the CLI, and a Cron job fails with:

Error: sudo: process 1421194 unexpected status 0x57f
Killed
Executed CronTask - /mnt/Applications/Scripts/multi_report.sh > /dev/null: sudo: process 1421194 unexpected status 0x57f
Killed

3.0.7 and 3.1 previously ran fine, albeit not sending emails every time (might’ve been just coincidence, but it felt like when I ran the script manually from the CLI it worked fine, but when ran as a cron job the script ran, but the email wasn’t getting sent, with nothing even in the sendemail_log folder).

Considering how very much in rapid development the current version seems to be, I’m considering just leaving it be for a bit until the situation stabilizes.

@Vitosi4ek how are you running the script? I see sudo which I do not use. I run using root or truenas_admin.

The cron job is set up to run it as root. From the CLI I tried with sudo or without (logged in as admin), the result is the same - no output.

Again, on 3.1 the script ran fine, barring the email weirdness that I don’t yet understand. Then this evening I updated to 3.12 and this started to happen.

What version of truenas are you running?

Scale 24.10.1. Updated to it just as 3.0.7 came out.

I assume you meant 3.1, since 3.07 does not work with 24.10.1. The hardening that iXsystems is doing is causing all kinds of problems, hence v3.1 and a new email python script.

I don’t blame you for waiting it out. But if we can communicate via message on the forum, maybe I can figure out why it is failing to work on your system. Maybe tomorrow?

I’m afraid I won’t be particularly helpful here. I’d send a log if I had it, but there’s literally nothing happening aside from the cron message I shared. And considering how active the development is ATM, I think it’s most prudent to just leave it for a few weeks. Don’t want to waste your time trying to diagnose an issue that can easily be on my end, too. I’m not experienced enough to provide good feedback yet.

When run from cron, do you run the multi report before have cd into the folder? Because if not you can face this issue

When running from cron, no, but I do usually cd into the folder when running it from the CLI. Will try to do it in cron too once I can get it to at least execute at all :slight_smile:

@oxyde
Did all the things. changed ‘changeme@gmail.com’ to ‘grimmreapernl+truenas.sendemail@gmail.com’.
Following happened:

root@truenas[/mnt/TrueNAS/scripts/multi_report]# ./mr_sendemail.py --subject "TEST" --to_address "grimmreapernl+truenas.sendemail@gmail.com" --mail_body_html "<h1>Hello World!</h1><p>Test Email</p>"
zsh: event not found: </h1><p>Test
root@truenas[/mnt/TrueNAS/scripts/multi_report]#

bit anti-climactic. haha

Changed the command and this happened:

root@truenas[/mnt/TrueNAS/scripts/multi_report]# ./mr_sendemail.py --subject "TEST" --to_address "grimmreapernl+truenas.sendemail@gmail.com" --mail_body_html "test"
FromName:
From: TrueNAS@local.com
{"error": false, "detail": ">> All is Good <<", "logfile": "/mnt/TrueNAS/scripts/multi_report/sendemail_log/20250119_221118.txt", "total_attach": 0, "ok_attach": 0}
root@truenas[/mnt/TrueNAS/scripts/multi_report]#

I got an email from my gmail address.

@joeschmuck
I just grabbed the latest version of github and ran a report. I noticed it doesn’t list a version number for the drive test for me

root@truenas[/mnt/TrueNAS/scripts/multi_report]# ./multi_report.sh
TrueNAS does not support sendmail function, using sendemail.py to send you your email.
Multi-Report v3.12 dtd:2025-01-18 (TrueNAS Scale 24.10.1)
Checking for Updates
   1. Multi-Report - Installed:  3.12, GitHub:  3.12
No Update
   2. Drive_Selftest - Installed: , GitHub: 1.02
No Update
   3. Sendemail - Installed: 0.09, GitHub: 0.09
No Update
NO UPDATES AVAILABLE
Running Drive Self-test Script: /mnt/TrueNAS/scripts/multi_report/drive_selftest.sh

Joe's SMART Drive Self-test Script - Run: 19 January 10:16:18 PM
Script Version: 1.0 (10 January 2025), TrueNAS Scale 24.10.1

It does know there’s no update though.

Updated manually to Multi-Report v3.12 and works fine. Thank you

Btw, figured it out. The built-in updater simply downloaded an empty file (0KB). Manually replaced it with the file from the Github and now it runs.

That’s life of a beginner :slight_smile:

The ! destroied everything :see_no_evil:

This Is the default value of the config file if im not wrong. Can you check It into your multi_report_config.txt?

This wasn’t necessary before, when sendemail working, but now this step Is needed or the .py will fail.

Correct, this is the default and what is set in my config file as the ‘from’ address.