HEX
Server: LiteSpeed
System: Linux baran.dnsprotection.me 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: ddir12 (3618)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/glances/exports/__pycache__/glances_riemann.cpython-36.pyc
3

Eo�c�@sXdZddlZddlmZddlmZddlmZddlm	Z	ddl
Z
Gdd�de	�ZdS)	zRiemann interface class.�N)�Number)�range)�logger)�
GlancesExportcs2eZdZdZd	�fdd�	Zdd�Zdd�Z�ZS)
�Exportz-This class manages the Riemann export module.NcsPtt|�j||d�|jdddggd�|_|js8td�tj�|_|j	�|_
dS)zInit the Riemann export IF.)�config�argsZriemann�host�port)ZmandatoriesZoptionszMissing RIEMANN configN)�superr�__init__Z	load_conf�
export_enable�exit�socketZgethostname�hostname�init�client)�selfrr)�	__class__��%/usr/lib/python3.6/glances_riemann.pyrs	
zExport.__init__cCsT|js
dSytj|j|jd�}|Stk
rN}ztjd|�dSd}~XnXdS)z*Init the connection to the Riemann server.N)r	r
z"Connection to Riemann failed : %s )r
�bernhardZClientr	r
�	ExceptionrZcritical)rr�errrr0szExport.initcCs�x�tt|��D]�}t||t�s$qq|j|d||||d�}tj|�y|jj|�Wqt	k
r�}ztj
d|�WYdd}~XqXqWdS)zWrite the points in Riemann.� )r	ZserviceZmetricz#Cannot export stats to Riemann (%s)N)r�len�
isinstancerrr�debugr�sendr�error)r�name�columnsZpoints�i�datarrrr�export;s
z
Export.export)NN)�__name__�
__module__�__qualname__�__doc__rrr$�
__classcell__rr)rrrsr)r(rZnumbersrZglances.compatrZglances.loggerrZglances.exports.glances_exportrrrrrrr�<module>
s