Project

General

Profile

Tâche #34552

Scénario #34556: EOLE 2.9 : traceback agents Zéphir tcpservices et netstat

Erreur z_stats si le nom de la carte est trop long (vu sur une eole 2.8.1)

Added by Emmanuel GARETTE over 1 year ago. Updated over 1 year ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
09/02/2022
Due date:
% Done:

100%

Remaining (hours):
0.0

Description

J'ai un serveur avec une carte réseau qui a le nom : "enx0050b61bc1e4".

Z_stat est incapable de démarrer :

sept. 02 17:13:21 hapy systemd[1]: Stopped Agent zephir.
sept. 02 17:13:21 hapy systemd[1]: Started Agent zephir.
sept. 02 17:13:22 hapy creoled[1226]: 127.0.0.1 - - [02/Sep/2022:17:13:22] "GET /get/creole/interface_0/nom_zone_eth0 HTTP/1.1" 200 35 "" "python-requests/2.22.0" 
sept. 02 17:13:22 hapy zephiragents[15193]: Traceback (most recent call last):
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/bin/twistd3", line 11, in <module>
sept. 02 17:13:22 hapy zephiragents[15193]:     load_entry_point('Twisted==18.9.0', 'console_scripts', 'twistd')()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/twisted/scripts/twistd.py", line 31, in run
sept. 02 17:13:22 hapy zephiragents[15193]:     app.run(runApp, ServerOptions)
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/twisted/application/app.py", line 674, in run
sept. 02 17:13:22 hapy zephiragents[15193]:     runApp(config)
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/twisted/scripts/twistd.py", line 25, in runApp
sept. 02 17:13:22 hapy zephiragents[15193]:     runner.run()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/twisted/application/app.py", line 381, in run
sept. 02 17:13:22 hapy zephiragents[15193]:     self.application = self.createOrGetApplication()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/twisted/application/app.py", line 448, in createOrGetApplication
sept. 02 17:13:22 hapy zephiragents[15193]:     ser = plg.makeService(self.config.subOptions)
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/zephir_tap.py", line 49, in makeService
sept. 02 17:13:22 hapy zephiragents[15193]:     return ZephirService(config,serve_static=True).with_updater_and_publisher()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/zephirservice.py", line 83, in with_updater_and_publisher
sept. 02 17:13:22 hapy zephiragents[15193]:     self.updater = UpdaterService(self.config, self, self.root_resource)
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/zephirservice.py", line 108, in __init__
sept. 02 17:13:22 hapy zephiragents[15193]:     self.agents = self.load_agents()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/zephirservice.py", line 163, in load_agents
sept. 02 17:13:22 hapy zephiragents[15193]:     a.init_data(os.path.join(self.config['state_dir'],
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agents/netstat.py", line 65, in init_data
sept. 02 17:13:22 hapy zephiragents[15193]:     MultiRRDAgent.init_data(self,archive_dir)
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/agent.py", line 520, in init_data
sept. 02 17:13:22 hapy zephiragents[15193]:     self.rrd[name].create()
sept. 02 17:13:22 hapy zephiragents[15193]:   File "/usr/lib/python3/dist-packages/zephir/monitor/agentmanager/rrd.py", line 97, in create
sept. 02 17:13:22 hapy zephiragents[15193]:     rrdtool.create(*args)
sept. 02 17:13:22 hapy zephiragents[15193]: rrdtool.OperationalError: invalid DS format
sept. 02 17:13:22 hapy systemd[1]: z_stats.service: Main process exited, code=exited, status=1/FAILURE
sept. 02 17:13:22 hapy systemd[1]: z_stats.service: Failed with result 'exit-code'.

Si je limite la taille du nom cela passe.

Pour cela j'ai modifié :

/usr/share/zephir/monitor/configs/netstat.agent ligne 35 :

            datasources[interf]=[{'name': "in_%s" % interf[:16], 'ds_type': 'COUNTER'},
                                 {'name': "out_%s" % interf[:15], 'ds_type': 'COUNTER'},
                                 {'name': "iner_%s" % interf[:14], 'ds_type': 'COUNTER'},
                                 {'name': "outer_%s" % interf[:13], 'ds_type': 'COUNTER'}]

/usr/lib/python3/dist-packages/zephir/monitor/agents/netstat.py ligne 150 :

                dico['in_%s' % if_name[:16]] = inkb
                dico['iner_%s' % if_name[:14]] = iner
                dico['out_%s' % if_name[:15]] = outkb
                dico['outer_%s' % if_name[:13]] = outer

Le fichier /usr/share/zephir/monitor/stats/17/netstats/enx0050b61bc1e4.rrd est alors créé correctement.

À faire

Implémenter la correction proposée pour EOLE ≥ 2.8.1

Associated revisions

Revision 11ebd752 (diff)
Added by Laurent Gourvenec over 1 year ago

Zstats: gestion de longs noms de carte réseau pour l'agent netstat

Autrement, zephiragents produit une stacktrace dans les logs.

Ref #34552

History

#1 Updated by Emmanuel GARETTE over 1 year ago

  • Description updated (diff)

#2 Updated by Joël Cuissinat over 1 year ago

  • Parent task set to #34540

#3 Updated by Joël Cuissinat over 1 year ago

  • Parent task changed from #34540 to #34556

#4 Updated by Joël Cuissinat over 1 year ago

  • Description updated (diff)

#5 Updated by Laurent Gourvenec over 1 year ago

  • Status changed from Nouveau to En cours

#6 Updated by Laurent Gourvenec over 1 year ago

  • Assigned To set to Laurent Gourvenec

#7 Updated by Laurent Gourvenec over 1 year ago

  • % Done changed from 0 to 100

#8 Updated by Laurent Gourvenec over 1 year ago

  • Status changed from En cours to À valider

#9 Updated by Ludwig Seys over 1 year ago

  • Status changed from À valider to Résolu

#10 Updated by Joël Cuissinat over 1 year ago

zephir-client$ git branch -r --contains  11ebd752  
  origin/2.8.1/master
  origin/HEAD -> origin/master
  origin/dist/eole/2.8.1/master
  origin/dist/eole/2.9.0/master
  origin/master

#11 Updated by Joël Cuissinat over 1 year ago

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

Also available in: Atom PDF