Project

General

Profile

Tâche #17929

Scénario #30539: Traitement express MEN (36-39)

Rendre les sondes eQOS fonctionnelles sur EOLE 2.6 (HORUS-T07-002)

Added by Fabrice Barconnière almost 7 years ago. Updated about 3 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
07/20/2020
Due date:
% Done:

100%

Estimated time:
0.00 h
Spent time:
Remaining (hours):
0.0

Description

https://dev-eole.ac-dijon.fr/squash/executions/3805

Le service eqos est actif avec un code retour 0 mais la sortie de la commande indique des erreurs.

eqosd.pl.patch View (1.36 KB) Laurent Flori, 11/29/2016 01:58 PM

checker.pl.patch View (737 Bytes) Yoni Baude, 07/16/2020 11:11 AM


Related issues

Related to Distribution EOLE - Tâche #18047: Remonter le problème de fonctionnement des sondes eQOS au pôle de supervision Fermé 11/25/2016

Associated revisions

Revision 9c4ce200 (diff)
Added by Joël Cuissinat about 3 years ago

Mise à niveau eqosd.pl pour EOLE 2.6

Ref: #17929

Revision 0ebdbd51 (diff)
Added by Joël Cuissinat about 3 years ago

Mise à niveau checker.pl pour EOLE 2.6

Ref: #17929

Revision 9554a22e (diff)
Added by Joël Cuissinat about 3 years ago

fix typo in eqosd.pl

Ref: #17929

History

#1 Updated by Scrum Master almost 7 years ago

  • Subject changed from Correction test HORUS-T07-002 to Correction test HORUS-T07-002 : à vérifier
  • Estimated time set to 2.00 h
  • Remaining (hours) set to 2.0

Tester si l'ajout d'un reconfigure améliore les choses...

#2 Updated by Laurent Flori almost 7 years ago

  • Status changed from Nouveau to En cours

#3 Updated by Laurent Flori almost 7 years ago

  • Assigned To set to Laurent Flori

#4 Updated by Laurent Flori almost 7 years ago

En ajoutant le domaine eqos.orion.education.fr dans les domaines à ne pas authentitifier sur l'amon on a plus l'erreur

SOAP transport error : 407 Proxy Authentication Required

mais après redémarrage du service eqos on a ces erreurs là:
DBD::SQLite::db selectall_arrayref failed: no such table: eqos_alerts at /usr/share/eqos/eqosd.pl line 431.
....
error : message is not OK (input data error : mac address is empty), aborting configuration

Il y un problème avec la recherche de l'adresse MAC dans le script /usr/share/eqos/eqosd.pl qui cherche un périphérique eth0:
my $cmd_getmac = '/sbin/ifconfig eth0 | /bin/grep HWaddr | /bin/sed "s/^.*HWaddr \([^ ]*\).*$/\\1/"'; # get mac address with ifconfig method

Il y a aussi plus loin dans le script une fonction qui cherche l'adresse MAC de eth0 (il semble que ce soit cette fonction qui soit utilisée):
# Return eth0 hardware address used for agent identification
sub get_mac_address() {
    my $sysfile = '/sys/class/net/eth0/address';
    my $mac = '';
    if ( -e $sysfile ) {
        open(SYSFILE,"<$sysfile");
        $mac = <SYSFILE>;
        close(SYSFILE);
    } else {
        &make_log(0, BOLD RED . "Enable to read mac address in $sysfile.")
    }
    chomp $mac;
    return uc($mac);
}

Il faudrait aussi je pense changer le path relatif de l'utilitaire checker.pl pour le path absolu /usr/share/eqos/checker.pl:

my $exec_checker = "./checker.pl"; # checker exe file

Il faut aussi changer le path relatif pour le fichier eqos_struct.sql pour le path absolu /usr/share/eqos/sql/eqos_struct.sql:

my $sqlite_structdumpfile = "./sql/eqos_struct.sql";

#5 Updated by Laurent Flori almost 7 years ago

  • Remaining (hours) changed from 2.0 to 1.0

#6 Updated by Scrum Master almost 7 years ago

  • Status changed from En cours to Fermé
  • Remaining (hours) changed from 1.0 to 0.0

#7 Updated by Joël Cuissinat almost 7 years ago

  • Subject changed from Correction test HORUS-T07-002 : à vérifier to Rendre les sondes eQOS fonctionnelles sur EOLE 2.6 (HORUS-T07-002)
  • Status changed from Fermé to Nouveau
  • Assigned To deleted (Laurent Flori)
  • Estimated time changed from 2.00 h to 0.00 h
  • Parent task deleted (#17920)

#8 Updated by Joël Cuissinat almost 7 years ago

  • Tracker changed from Tâche to Proposition Scénario
  • Project changed from Distribution EOLE to Sondes Eqos
  • Target version deleted (sprint 2016 45-47 - Équipe MENSR)

#9 Updated by Scrum Master almost 7 years ago

Remonter le problème au pôle de supervision

#10 Updated by Joël Cuissinat almost 7 years ago

  • Related to Tâche #18047: Remonter le problème de fonctionnement des sondes eQOS au pôle de supervision added

#11 Updated by Laurent Flori almost 7 years ago

J'ajoute un patch qui permet de faire fonctionner eqos.

  • ATTENTION il faut renseigner la variable $mac avec le nom de l'interface dont on cherche l'adresse MAC (je l'ai mise par défaut à ens4). On peut plus utiliser eth0 par défaut comme dans les versions précédentes.
  • Il y a deux nouvelles variables, $root_dir et $sqlite_dir qui permettent de fixer les chemins absolus.
Notes:
  • on pourrait envisager un fichier de configuration
  • il y a du code non utlisé qu'on pourrait nettoyer (my $cmd_getmac ligne 86 par exemple)

#12 Updated by Scrum Master over 6 years ago

  • Tracker changed from Proposition Scénario to Scénario
  • Release set to EOLE 2.6.1

En attente de retour de Nancy.

#13 Updated by Scrum Master over 6 years ago

  • Release deleted (EOLE 2.6.1)

#14 Updated by Joël Cuissinat almost 6 years ago

  • Tracker changed from Scénario to Proposition Scénario

#15 Updated by Gilles Grandgérard over 5 years ago

  • Tracker changed from Proposition Scénario to Scénario

#16 Updated by Joël Cuissinat about 4 years ago

  • Tracker changed from Scénario to Bac à idée

#17 Updated by Yoni Baude about 3 years ago

Bonjour,

Le patch eqosd.pl.patch sera-t-il appliqué dans une prochaine mise a jours eole 2.6.2 ?

Une idée pour récupérer le nom de l'interface pour le patch :

ifconfig | egrep '^[^ ]' |  awk '{print $1}'| head -1

Bien a vous
Yoni

#18 Updated by Yoni Baude about 3 years ago

Voici une procédure en attendant :

cd /usr/share/eqos/
wget https://dev-eole.ac-dijon.fr/attachments/download/1918/eqosd.pl.patch
interface=$(ifconfig | egrep '^[^ ]' |  awk '{print $1}'| head -1)
sed -i -e "s/ens4/${interface}/g" /usr/share/eqos/eqosd.pl.patch
patch eqosd.pl < eqosd.pl.patch
reconfigure

#19 Updated by Joël Cuissinat about 3 years ago

  • Parent task set to #30411

#20 Updated by Yoni Baude about 3 years ago

Le path ne suffit pas pour faire fonctionner eqos, le service est bien actif mais il a un soucis avec checker.pl.

root@horus:/usr/share/eqos# service eqos status
● eqos.service - Sonde EQOS
   Loaded: loaded (/lib/systemd/system/eqos.service; enabled; vendor preset: enabled)
   Active: active (running) since jeu. 2020-07-16 09:25:35 CEST; 10min ago
 Main PID: 2157 (eqosd)
   CGroup: /system.slice/eqos.service
           ├─2157 eqos
           └─2158 /usr/bin/perl -w /usr/share/eqos/checker.pl

juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 820 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 830 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 141 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 139 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 921 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 825 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 136 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 728 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 732 : 'plugins/check_application_en.pl' is not executable.
juil. 16 09:35:48 horus eqosd.pl[2157]: 16/07 07:35:48 [checker] getConf() : Cancel task 822 : 'plugins/check_application_en.pl' is not executable.

#21 Updated by Yoni Baude about 3 years ago

Il faut également corriger le chemin du plugin dans le fichier checker.pl.

my $root_dir = "/usr/share/eqos/";
my $nagiosPluginPath = $root_dir."plugins";

dbh->{'sqlite_unicode'} = 1;

Ensuite sonde Eqos sur horus 2.6 ok.

#22 Updated by Joël Cuissinat about 3 years ago

  • Project changed from Sondes Eqos to Distribution EOLE
  • Status changed from Nouveau to En cours
  • Start date set to 07/20/2020

#23 Updated by Joël Cuissinat about 3 years ago

  • Assigned To set to Joël Cuissinat

#24 Updated by Joël Cuissinat about 3 years ago

Je vois également que dans le patch il y a un fix sur le numéro du mois pour l'horodatage des logs pour tenter de compenser qu'avec gmtime :

$mon is the month itself, in the range 0..11 with 0 indicating January and 11 indicating December.

Mais comme il n'est pas appliqué partout cela engendre des incohérences avec les messages tels que :

2020-07-20T11:02:53.812900+02:00 horus.etb1.lan eqosd.pl[12231]: 532920612012010#033[37m20/07 09:02:53 [eqosd] try to send alert message, event from "20/06 08:07:32" : eqosd halt $Revision: 1.8.0 $#033[0m

Une correction dédiée serait à envisager ?

#25 Updated by Joël Cuissinat about 3 years ago

  • Status changed from En cours to Résolu
  • % Done changed from 0 to 100

Paquet candidat : eole-eqos 2.6.2-1
(branche 2.6.0/17929-fixEqos si retro-portage nécessaire)

#26 Updated by Fabrice Barconnière about 3 years ago

  • Description updated (diff)

#27 Updated by Fabrice Barconnière about 3 years ago

  • Status changed from Résolu to En cours
  • % Done changed from 100 to 90

Il ne doit pas trop aimer la déclaration de la variable month+1 dans my ($sec, ....

root@horus:~# service eqos status
● eqos.service - Sonde EQOS
   Loaded: loaded (/lib/systemd/system/eqos.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since mar. 2020-07-21 15:37:05 CEST; 3s ago
  Process: 8632 ExecStart=/usr/share/eqos/eqosd.pl (code=exited, status=255)
 Main PID: 8632 (code=exited, status=255)

juil. 21 15:37:05 horus systemd[1]: Started Sonde EQOS.
juil. 21 15:37:05 horus eqosd.pl[8632]: Can't declare addition (+) in "my" at /usr/share/eqos/eqosd.pl line 158, near ") =" 
juil. 21 15:37:05 horus eqosd.pl[8632]: Execution of /usr/share/eqos/eqosd.pl aborted due to compilation errors.
juil. 21 15:37:05 horus systemd[1]: eqos.service: Main process exited, code=exited, status=255/n/a
juil. 21 15:37:05 horus systemd[1]: eqos.service: Unit entered failed state.
juil. 21 15:37:05 horus systemd[1]: eqos.service: Failed with result 'exit-code'.

#28 Updated by Joël Cuissinat about 3 years ago

Fabrice Barconnière a écrit :

Il ne doit pas trop aimer la déclaration de la variable month+1 dans my ($sec, ....
[...]

Exact, il faut mettre le +1 dans le print... Mais on dirait que je l'avais bien fait dans eole-eqos:5f33830 ...
=> eole-eqos 2.6.2-2

#29 Updated by Joël Cuissinat about 3 years ago

  • Status changed from En cours to Résolu
  • % Done changed from 90 to 100

#30 Updated by Fabrice Barconnière about 3 years ago

  • Status changed from Résolu to En cours

Je ne sais pas trop si c'est fonctionnel, le service tourne mais message d'erreur dans le status

oot@horus:~# service eqos status
● eqos.service - Sonde EQOS
   Loaded: loaded (/lib/systemd/system/eqos.service; enabled; vendor preset: enabled)
   Active: active (running) since mar. 2020-08-25 08:20:39 CEST; 2s ago
 Main PID: 2474 (eqosd)
   CGroup: /system.slice/eqos.service
           └─2474 eqos

août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] sqlite info : database OK
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] sqlite info : pragma sync configured
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] Starting main loop
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] 2 task(s) waiting
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] info : task "getconf", time not expired (1s)
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] info : task "feedback", time not expired (60s)
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] try to send alert message, event from "25/07 05:57:54" : eqosd halt $Revision: 1.8.0 $
août 25 08:20:39 horus eqosd.pl[2474]: 25/08 06:20:39 [eqosd] SOAP QUERY  sendalert("02:00:0A:01:01:65", 1598335074, "eqosd", "eqosd halt $Revision: 1.8.0 $")
août 25 08:20:40 horus eqosd.pl[2474]: 25/08 06:20:40 [eqosd] SOAP RESULT message : can't select mac address, no agent configured for 02:00:0A:01:01:65
août 25 08:20:40 horus eqosd.pl[2474]: 25/08 06:20:40 [eqosd] error : an error has been detected during commit message, aborting

Et le résultat du test Squash n'est pas le même, résultat attendu :

Affiche :

sondes EQOS (pid XXX) est actif ...

#31 Updated by Joël Cuissinat about 3 years ago

  • Parent task changed from #30411 to #30539

#32 Updated by Yoni Baude about 3 years ago

Suite à l'installation du paquet eole-eqos 2.6.2-2, sonde eqos ok pour horus 2.6 :

root@horus:~# service eqos status
● eqos.service - Sonde EQOS
   Loaded: loaded (/lib/systemd/system/eqos.service; enabled; vendor preset: enabled)
   Active: active (running) since jeu. 2020-09-24 09:18:51 CEST; 23min ago
 Main PID: 57925 (eqosd)
   CGroup: /system.slice/eqos.service
           ├─57925 eqos
           └─57961 /usr/bin/perl -w /usr/share/eqos/checker.pl

sept. 24 09:40:50 horus eqosd.pl[57925]: 24/09 07:40:50 [checker] Task 830 start : /usr/share/eqos/plugins/check_application_en.pl -u https://webetab.ac-caen.fr/gigc/racvi
sept. 24 09:40:50 horus eqosd.pl[57925]: 24/09 07:40:50 [checker] Task 830 end : OK - GIGC (2.4.8) OK - 7 test(s) done 
sept. 24 09:41:25 horus eqosd.pl[57925]: 24/09 07:41:25 [checker] Task 532 start : /usr/share/eqos/plugins/check_application_en.pl -u https://webetab.ac-caen.fr/tsmprive/r
sept. 24 09:41:25 horus eqosd.pl[57925]: 24/09 07:41:25 [checker] Task 532 end : OK - tsmprive (1.1.3) OK - 1 test(s) done 
sept. 24 09:41:55 horus eqosd.pl[57925]: 24/09 07:41:55 [checker] Task 847 start : /usr/share/eqos/plugins/check_application_en.pl -u https://webetab.ac-caen.fr/viescolair
sept. 24 09:41:55 horus eqosd.pl[57925]: 24/09 07:41:55 [checker] Task 847 end : OK - VIESCOLAIRE (20.3.1.0.2) OK - WARN - Test de validité du certificat SMS : Le keystore
sept. 24 09:42:02 horus eqosd.pl[57925]: 24/09 07:42:02 [checker] Task 937 start : /usr/share/eqos/plugins/check_application_en.pl -u https://webetab.ac-caen.fr/affelnet-l
sept. 24 09:42:03 horus eqosd.pl[57925]: 24/09 07:42:03 [checker] Task 937 end : OK - Affelnet Lycée - Service général (20.3.0.7) OK - WARN - Test d'appel au Téléservice A
sept. 24 09:42:33 horus eqosd.pl[57925]: 24/09 07:42:33 [checker] Task 820 start : /usr/share/eqos/plugins/check_application_en.pl -u https://extranet.ac-caen.fr/premier_d

Merci à tous,
Yoni

#33 Updated by Joël Cuissinat about 3 years ago

  • Status changed from En cours to Fermé

Super, merci à toi également !

Also available in: Atom PDF