Tâche #34552
Mis à jour par Emmanuel GARETTE il y a plus de 3 ans
J'ai un serveur avec une carte réseau qui a le nom : "enx0050b61bc1e4".
Z_stat est incapable de démarrer :
<pre>
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'.
</pre>
Si je limite la taille du nom cela passe.
Pour cela j'ai modifié :
/usr/share/zephir/monitor/configs/netstat.agent /usr/lib/python3/dist-packages/zephir/monitor/agentmanager/rrd.py ligne 35 154 :
<pre>
return "DS:%(ds-name)s:%(DST)s:%(heartbeat)d:%(min)s:%(max)s" % {
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'}]
</pre>
/usr/lib/python3/dist-packages/zephir/monitor/agents/netstat.py ligne 150 :
<pre>
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 'ds-name': self.name[:19], 'DST': self.type,
'heartbeat': self.heartbeat,
'min': minb, 'max': maxb
}
</pre>
Le fichier /usr/share/zephir/monitor/stats/17/netstats/enx0050b61bc1e4.rrd est alors créé correctement.
Z_stat est incapable de démarrer :
<pre>
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'.
</pre>
Si je limite la taille du nom cela passe.
Pour cela j'ai modifié :
/usr/share/zephir/monitor/configs/netstat.agent /usr/lib/python3/dist-packages/zephir/monitor/agentmanager/rrd.py ligne 35 154 :
<pre>
return "DS:%(ds-name)s:%(DST)s:%(heartbeat)d:%(min)s:%(max)s" % {
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'}]
</pre>
/usr/lib/python3/dist-packages/zephir/monitor/agents/netstat.py ligne 150 :
<pre>
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 'ds-name': self.name[:19], 'DST': self.type,
'heartbeat': self.heartbeat,
'min': minb, 'max': maxb
}
</pre>
Le fichier /usr/share/zephir/monitor/stats/17/netstats/enx0050b61bc1e4.rrd est alors créé correctement.