Projet

Général

Profil

Actions

Demande #6542

ouvert

/usr/lib/nagios/plugins/check_borgmatic: ouvre /var/log/borgmatic.log.1 mais /var/log/borgmatic.log-$(date +%Y%m%d -d yesterday) existe

Ajouté par Pierre-Louis Bonicoli il y a environ un mois.

Statut:
Nouveau
Priorité:
Normale
Assigné à:
-
Catégorie:
-
Version cible:
Début:
24/11/2024
Echéance:
% réalisé:

0%

Temps estimé:

Description

Quand /var/log/borgmatic.log est vide, le script /usr/lib/nagios/plugins/check_borgmatic échoue:

Traceback (most recent call last):
  File "/usr/lib/nagios/plugins/check_borgmatic", line 24, in <module>
    check_backup ("/var/log/borgmatic.log")
  File "/usr/lib/nagios/plugins/check_borgmatic", line 11, in check_backup
    stats = list(re.finditer(r'\[\{"archives":.*\}\]$', logs, re.MULTILINE))[-1]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/nagios/plugins/check_borgmatic", line 26, in <module>
    check_backup ("/var/log/borgmatic.log.1")
  File "/usr/lib/nagios/plugins/check_borgmatic", line 9, in check_backup
    with open(filename) as f:
         ^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/borgmatic.log.1'
=(^-^)=root@bastion:~# ls -l /var/log/borgmatic.log*
-rw-r----- 1 root adm     0 24 nov.  00:00 /var/log/borgmatic.log
-rw-r----- 1 root adm  5383 19 oct.  02:07 /var/log/borgmatic.log-20241019.gz
-rw-r----- 1 root adm  5298 26 oct.  02:02 /var/log/borgmatic.log-20241026.gz
-rw-r----- 1 root adm  5168  2 nov.  02:24 /var/log/borgmatic.log-20241102.gz
-rw-r----- 1 root adm  5283  9 nov.  02:06 /var/log/borgmatic.log-20241109.gz
-rw-r----- 1 root adm  5248 16 nov.  01:35 /var/log/borgmatic.log-20241116.gz
-rw-r----- 1 root adm 48274 23 nov.  02:25 /var/log/borgmatic.log-20241123

Aucune donnée à afficher

Actions

Formats disponibles : Atom PDF