Projet

Général

Profil

Tâche #32050

Scénario #31989: Traceback zephir agent sur Amon 2.7.x

Agent Zéphir bareos : le script /usr/lib/nagios/plugins/check_bareos n'existe plus en 2.8.1

Ajouté par Emmanuel GARETTE il y a environ 3 ans. Mis à jour il y a presque 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Début:
07/04/2021
Echéance:
% réalisé:

100%

Restant à faire (heures):
0.0

Description

Il me semble qu'on avait corrigé dans le diagnose, mais visiblement ca n'a pas été fait dans l'agent Zéphir :

2021-04-07T10:59:20.099086+02:00 amonecole.etb3.lan zephiragents[11996]: 2021-04-07T10:59:20+0200 [-] Erreur remontée par /usr/lib/nagios/plugins/check_bareos :
2021-04-07T10:59:20.099131+02:00 amonecole.etb3.lan zephiragents[11996]: 2021-04-07T10:59:20+0200 [-] got stderr: b'Upon execvpe /usr/lib/nagios/plugins/check_bareos [b\'/usr/lib/nagios/plugins/check_bareos\', b\'-H\', b\'localhost\', b\'-D\', b\'sd\', b\'-M\', b\'bareos-amonecole-mon\', b\'-K\', b\'e4329c32638740da56aa76042efdecde40f2e616088626c96ea571bb\'] in environment id 140262528118208\n:Traceback (most recent call last):\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 444, in _fork\n    self._execChild(path, uid, gid, executable, args,\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 523, in _execChild\n    os.execvpe(executable, args, environment)\n  File "/usr/lib/python3.8/os.py", line 577, in execvpe\n    _execvpe(file, args, env)\n  File "/usr/lib/python3.8/os.py", line 591, in _execvpe\n    exec_func(file, *argrest)\nFileNotFoundError: [Errno 2] No such file or directory: \'/usr/lib/nagios/plugins/check_bareos\'\n'
2021-04-07T10:59:20.099196+02:00 amonecole.etb3.lan zephiragents: [-] got stderr: b'Upon execvpe /usr/lib/nagios/plugins/check_bareos [b\'/usr/lib/nagios/plugins/check_bareos\', b\'-H\', b\'localhost\', b\'-D\', b\'sd\', b\'-M\', b\'bareos-amonecole-mon\', b\'-K\', b\'e4329c32638740da56aa76042efdecde40f2e616088626c96ea571bb\'] in environment id 140262528118208\n:Traceback (most recent call last):\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 444, in _fork\n    self._execChild(path, uid, gid, executable, args,\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 523, in _execChild\n    os.execvpe(executable, args, environment)\n  File "/usr/lib/python3.8/os.py", line 577, in execvpe\n    _execvpe(file, args, env)\n  File "/usr/lib/python3.8/os.py", line 591, in _execvpe\n    exec_func(file, *argrest)\nFileNotFoundError: [Errno 2] No such file or directory: \'/usr/lib/nagios/plugins/check_bareos\'\n'

Révisions associées

Révision 2e13ffaa (diff)
Ajouté par Emmanuel GARETTE il y a environ 3 ans

mise à jour de l'agent bareos (ref #32050)

Révision 2cdebeeb (diff)
Ajouté par Emmanuel GARETTE il y a environ 3 ans

mise à jour de l'agent bareos (ref #32050)

Révision 5ff7269d (diff)
Ajouté par Emmanuel GARETTE il y a presque 3 ans

Revert "mise à jour de l'agent bareos (ref #32050)"
Doit être fait que sur 2.8.1 (ref #32050)

This reverts commit 2e13ffaafcae97bcd27a1a9bfa05b6d65bc4d518.

Révision 16419820 (diff)
Ajouté par Emmanuel GARETTE il y a presque 3 ans

Revert "Revert "mise à jour de l'agent bareos (ref #32050)""

This reverts commit 5ff7269dd46767d205262619d1b1945089c87244.

Révision 997f0d8f (diff)
Ajouté par Emmanuel GARETTE il y a presque 3 ans

Revert "mise à jour de l'agent bareos (ref #32050)"

Uniquement en 2.8.1 (ref #32050)

This reverts commit 2cdebeeb78537ee018c572dc8fe11c902dc28e0c.

Révision d26a9fce (diff)
Ajouté par Emmanuel GARETTE il y a presque 3 ans

Revert "Revert "mise à jour de l'agent bareos (ref #32050)""

This reverts commit 997f0d8f23e0d53082d450ddd2d6d0a2b265399f.

Révision 5cc803a4 (diff)
Ajouté par Joël Cuissinat il y a presque 3 ans

cosmétique agent bareos (ref #32050)

Historique

#1 Mis à jour par Emmanuel GARETTE il y a environ 3 ans

  • Tracker changé de Demande à Tâche
  • Tâche parente mis à #31989

#2 Mis à jour par Emmanuel GARETTE il y a environ 3 ans

  • Statut changé de Nouveau à Résolu
  • Assigné à mis à Emmanuel GARETTE
  • % réalisé changé de 0 à 100

#3 Mis à jour par Joël Cuissinat il y a environ 3 ans

  • Statut changé de Résolu à En cours

https://dev-eole.ac-dijon.fr/jenkins/job/2.8.0/job/test-checkinstance-scribe-2.8.0-amd64/

Depuis cette correction, on voit l'erreur suivante en 2.8.0 :

2021-04-09T23:42:46.281411+02:00 scribe.domscribe.ac-test.fr zephiragents[3388]: 2021-04-09T23:42:46+0200 [-] got stderr: b'Upon execvpe /usr/share/eole/bareos/test_director 
[b\'/usr/share/eole/bareos/test_director\', b\'bareos-scribe-mon\', b\'b981da76593d1a9e422422062acb1cfb1434a2ccf0d8104b815f462d\'] 
in environment id 140058734138752\n:Traceback (most recent call last):\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", 
line 444, in _fork\n    self._execChild(path, uid, gid, executable, args,\n  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", 
line 523, in _execChild\n    os.execvpe(executable, args, environment)\n  File "/usr/lib/python3.8/os.py", 
line 577, in execvpe\n    _execvpe(file, args, env)\n  File "/usr/lib/python3.8/os.py", 
line 591, in _execvpe\n    exec_func(file, *argrest)\nFileNotFoundError: [Errno 2] No such file or directory: \'/usr/share/eole/bareos/test_director\'\n'

#4 Mis à jour par Emmanuel GARETTE il y a presque 3 ans

  • Statut changé de En cours à Résolu

#5 Mis à jour par Joël Cuissinat il y a presque 3 ans

  • Sujet changé de Agent Zéphir bareos : le script /usr/lib/nagios/plugins/check_bareos n'existe plus à Agent Zéphir bareos : le script /usr/lib/nagios/plugins/check_bareos n'existe plus en 2.8.1

#6 Mis à jour par Joël Cuissinat il y a presque 3 ans

Avec le revert, le test 2.8.0 est de nouveau vert : https://dev-eole.ac-dijon.fr/jenkins/job/2.8.0/job/test-checkinstance-scribe-2.8.0-amd64/ (job n°224)

zephir-client$ git diff master 2.8.0/master -- zephir 
diff --git a/zephir/monitor/agents/bareos.py b/zephir/monitor/agents/bareos.py
index 0345c13..43b4995 100644
--- a/zephir/monitor/agents/bareos.py
+++ b/zephir/monitor/agents/bareos.py
@@ -32,15 +32,21 @@ class BareosService(Agent):
         self.data = [self.table]

     def measure(self):
-        CHECK_BAREOS = '/usr/share/eole/bareos/test_director'
+        CHECK_BAREOS = '/usr/lib/nagios/plugins/check_bareos'
         result = getProcessOutput(CHECK_BAREOS,
-                                  args=('bareos-{0}-mon'.format(self.machine), self.password),
+                                  args=('-H', 'localhost',
+                                  '-D', self.short_name,
+                                  '-M', 'bareos-{0}-mon'.format(self.machine),
+                                  '-K', self.password),
                                   env={'LC_ALL': 'C'})
         result.addCallbacks(self.measure_activity, self.measure_error)
         return result

     def measure_activity(self, data):
-        status = boolean_to_onoff(1)
+        if 'BACULA OK' in str(data):
+            status = boolean_to_onoff(1)
+        else:
+            status = boolean_to_onoff(0)
         mesures = [{'description': self.name,
                     'host': 'localhost',
                     'port': '',
@@ -48,7 +54,7 @@ class BareosService(Agent):
         return {'services': mesures}

     def measure_error(self, failure):
-        log.msg(u'Erreur remontée par /usr/share/eole/bareos/test_directors :')
+        log.msg(u'Erreur remontée par /usr/lib/nagios/plugins/check_bareos :')
         log.msg(failure.getErrorMessage())

     def write_data(self):

Il fallait également revenir en arrière sur le commit présent dans le projet eole-bareos ;)

eole-bareos$ git diff master 2.8.0/master -- zephir 
diff --git a/zephir/configs/bareos.agent b/zephir/configs/bareos.agent
index 3715099..15941ab 100644
--- a/zephir/configs/bareos.agent
+++ b/zephir/configs/bareos.agent
@@ -16,6 +16,13 @@ if ACTIVER_BAREOS_DIR:
     agents.append(BareosService('bareos-dir', BAREOS_MON_PASSWORD,
                                 NOM_MACHINE, period=115,
                                 description='État du démon bareos-dir'))
+    agents.append(BareosService('bareos-fd', BAREOS_MON_PASSWORD,
+                                NOM_MACHINE, period=115,
+                                description='État du démon bareos-fd'))
+if ACTIVER_BAREOS_SD:
+    agents.append(BareosService('bareos-sd', BAREOS_MON_PASSWORD,
+                                NOM_MACHINE, period=115,
+                                description='État du démon bareos-sd'))

 if agents != []:
     AGENTS.extend(agents)

#7 Mis à jour par Joël Cuissinat il y a presque 3 ans

  • Statut changé de Résolu à Fermé
  • Restant à faire (heures) mis à 0.0

Formats disponibles : Atom PDF