Project

General

Profile

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

Added by Emmanuel GARETTE 5 months ago. Updated 5 months ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
04/07/2021
Due date:
% Done:

100%

Remaining (hours):
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'

Associated revisions

Revision 2e13ffaa (diff)
Added by Emmanuel GARETTE 5 months ago

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

Revision 2cdebeeb (diff)
Added by Emmanuel GARETTE 5 months ago

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

Revision 5ff7269d (diff)
Added by Emmanuel GARETTE 5 months ago

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

This reverts commit 2e13ffaafcae97bcd27a1a9bfa05b6d65bc4d518.

Revision 16419820 (diff)
Added by Emmanuel GARETTE 5 months ago

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

This reverts commit 5ff7269dd46767d205262619d1b1945089c87244.

Revision 997f0d8f (diff)
Added by Emmanuel GARETTE 5 months ago

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

Uniquement en 2.8.1 (ref #32050)

This reverts commit 2cdebeeb78537ee018c572dc8fe11c902dc28e0c.

Revision d26a9fce (diff)
Added by Emmanuel GARETTE 5 months ago

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

This reverts commit 997f0d8f23e0d53082d450ddd2d6d0a2b265399f.

Revision 5cc803a4 (diff)
Added by Joël Cuissinat 5 months ago

cosmétique agent bareos (ref #32050)

History

#1 Updated by Emmanuel GARETTE 5 months ago

  • Tracker changed from Demande to Tâche
  • Parent task set to #31989

#2 Updated by Emmanuel GARETTE 5 months ago

  • Status changed from Nouveau to Résolu
  • Assigned To set to Emmanuel GARETTE
  • % Done changed from 0 to 100

#3 Updated by Joël Cuissinat 5 months ago

  • Status changed from Résolu to 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 Updated by Emmanuel GARETTE 5 months ago

  • Status changed from En cours to Résolu

#5 Updated by Joël Cuissinat 5 months ago

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

#6 Updated by Joël Cuissinat 5 months ago

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 Updated by Joël Cuissinat 5 months ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) set to 0.0

Also available in: Atom PDF