grufocom / vee-mail

Simple Script to get Mails from Free Veeam Agent for Linux
GNU Affero General Public License v3.0
48 stars 14 forks source link

vee-mail and old distros #3

Closed KlugFR closed 4 years ago

KlugFR commented 4 years ago

Hello, me again 8)

I've tried vee-mail with CentOS6 and I had issues.

The first one is about sqlite: needed version is 3.7 while the OS version is 3.6. Maybe you could add is in the readme file?

Work around is simple: download sqlite3.7 and set it up.

What I did:

Second issue is about the template: I'm getting a blank mail (but headers). After digging in debug mode (see #4), I ended up with finding a sed error: sed: -e expression #30, char 19: unknown option tos'` It's about the last expression, it seems to be related to sed 4.2.1 and expression (because of the percentage in the remplacement). I don't have a work around (yet) for this.

If you remove the last expression, the email is OK except the Disk Use% (not replaced).

KlugFR commented 4 years ago

Actually, not sure it's really about last expression (and the percentage).

Once the last expression is disabled (removed), here's the email content: veemail

"Disk size" should be "30 T" (that's not true but that's what "df -h" sees). "Disk used" should be "55 G" "Disk available" should be "30 T" "Disk used" should be "x%"

The problem might be in parsing the mountpoint.

grufocom commented 4 years ago

tried to fix that with the latest version. what does "df -h" of your mountpoint look like?

grufocom commented 4 years ago

I added the comment for sqlite 3.7 to the readme file - thx!

KlugFR commented 4 years ago

Hello.

"df -h" looks normal on this old server. Except... One line is actually two lines!

CentOS6 server:

[root@centos6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_quitelongtrueservername-lv_root
                       50G   42G  5.3G  89% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/sda1             477M  139M  313M  31% /boot
/dev/sdb1              99G   68G   26G  73% /home2

CentOS7 server:

[user@server ~]$ df -h
Sys. de fichiers                 Taille Utilisé Dispo Uti% Monté sur
devtmpfs                           908M       0  908M   0% /dev
tmpfs                              919M       0  919M   0% /dev/shm
tmpfs                              919M     97M  823M  11% /run
tmpfs                              919M       0  919M   0% /sys/fs/cgroup
/dev/mapper/centos_servername-root    17G    4,1G   13G  24% /
/dev/sda1                         1014M    192M  823M  19% /boot
tmpfs                              184M       0  184M   0% /run/user/1000
grufocom commented 4 years ago

your "dh -h" does not show the backup mountpoint - does it? that's the one I am interested in ;-)

KlugFR commented 4 years ago

Ah ah, right. I forgot to mount it before "df -h".

However, it seems to be the same two lines thingy (because mountpoint is long).

[root@server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_quitelongtrueservername-lv_root
                       50G   42G  5.2G  89% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/sda1             477M  139M  313M  31% /boot
/dev/sdb1              99G   59G   35G  63% /home2
192.168.xx.yyy:/mnt/Backup/VM/Veeam/server.domain.tld
                       30T   62G   30T   1% /mnt
grufocom commented 4 years ago

Thank you - can you reproduce the problem with the latest version?

KlugFR commented 4 years ago

The problem is slightly different with 0.5.15, no more sed error.

Debug and the mail show: DEVUSEP: /tmp/tmp.AjzxD MQvke I guess this is the temporary mont path.

grufocom commented 4 years ago

So we are getting closer ;-) 0.5.16 should give you the used percent and not the mountpoint. Could you please test this version!?

KlugFR commented 4 years ago

Unfortunately dfdoesn't support --outputin CentOS6.

But I might have found a way: df -hP forces the output on one line. It works at least with CentOS6, CentOS7, Ubuntu 18.04.

[root@server ~]# df -hP
Filesystem                                             Size  Used Avail Use% Mounted on
/dev/mapper/vg_quitelongtrueservername-lv_root          50G   40G  7.5G  85% /
tmpfs                                                  7.8G     0  7.8G   0% /dev/shm
/dev/sda1                                              477M  139M  313M  31% /boot
/dev/sdb1                                               99G   59G   35G  63% /home2
192.168.xx.yyy:/mnt/Backup/VM/Veeam/server.domain.tld   30T   62G   30T   1% /mnt

(Found here: https://www.unix.com/linux/264381-how-get-df-h-output-one-line.html)

grufocom commented 4 years ago

changed it back and added "-P" flag to "df" command - please try it again!

KlugFR commented 4 years ago

It works!

Every field is at its right place with the correct value.

Thanks.

----- Mail original -----

De: "Manfred Larcher" notifications@github.com À: "grufocom/vee-mail" vee-mail@noreply.github.com Cc: "David Touitou" david@network-studio.com, "Author" author@noreply.github.com Envoyé: Mercredi 2 Septembre 2020 21:28:21 Objet: Re: [grufocom/vee-mail] vee-mail and old distros (#3)

changed it back and added "-P" flag to "df" command - please try it again!

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/grufocom/vee-mail/issues/3#issuecomment-685949383

grufocom commented 4 years ago

thanks a lot for debugging!