HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //usr/local/lib/python3.9/site-packages/agent360/plugins/__pycache__/haproxy.cpython-39.pyc
a

��?h��@sHddlZddlZddlZddlZGdd�dej�ZedkrDe���dS)�Nc@seZdZdZdd�ZdS)�Plugin�haproxycCsNt�}t�}z$|�dd�}|�dd�}||f}Wnd}Yn0|�dd�}d|vr^|d}tj||d�}t��|d<|��}	|jd	ur�|j�d
�}
nd�|j�Sd}d
}t	�
|
�}
t�}ttg}|
D�]h}i||dd|d<i||dd|d<z$|	d|	|dd|dd<Wn,t
�yNi|	|dd|d<Yn0|��D]�\}}|D](}z||�}Wnt�y�Yn0�qd||v�r�|||dd|d|<nx||v�rXt|�tu�rX|�|t|�|	|dd|d�||dd|d|<t|�||dd|d|<n�qXq�t��|d<|�|�|S)Nr�username�passwordF�status_page_urlz;csv)�auth�ts���
z&Could not load haproxy status page: {})ZqcurZqmaxZscurZsmaxZslimZstotZweightZqlimitZthrottleZlbtotZtrackedZrateZrate_limZrate_maxZhanafailZreq_rateZreq_rate_maxZreq_totZ	conn_rateZ
conn_rate_maxZconn_tot)�binZboutZcli_abrtZsrv_abrtZinterceptedZhrsp_1xxZhrsp_2xxZhrsp_3xxZhrsp_4xxZ
check_riseZ
check_fallZcheck_healthZ
agent_riseZ
agent_fallZhrsp_5xxZcomp_inZcomp_outZcomp_bypZcomp_rspZ
hrsp_otherZdconZdreqZdrespZereqZeconZerespZwretrZwredisZdsesz# pxname�/Zsvname)�dict�get�requests�timeZget_agent_cache�status_code�text�split�format�csv�
DictReader�str�float�KeyError�items�
ValueError�typeZabsolute_to_per_secondZset_agent_cache)�self�config�resultsZ
next_cacherr�	user_passr�requestZ
prev_cache�responseZ	non_delta�deltaZ
csv_reader�data�constructors�row�k�v�c�r*�B/usr/local/lib/python3.9/site-packages/agent360/plugins/haproxy.py�runsX

1

$

>"
z
Plugin.runN)�__name__�
__module__�__qualname__r,r*r*r*r+r	sr�__main__)rZpluginsrrZ
BasePluginrr-�executer*r*r*r+�<module>s