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__/docker.cpython-39.pyc
a

��?hr
�@s@ddlZddlZddlZGdd�dej�Zedkr<e���dS)�Nc@s eZdZdZdd�Zdd�ZdS)�PluginZdockerc
Csi}i}|��}�z�dd�t�d�����D�}|D�]z}i}|d�d�|d<|d}|d}	|�|d	�|d
<|�|d�|d<|�d
|df|�|d�|�|d<|�d
|df|�|d�|�|d<|�d
|df|�|d�|�|d<|�d
|df|�|d�|�|d<|d�d�|d<|�|d	�|d
|d
f<|�|d�|d
|df<|�|d�|d
|df<|�|d�|d
|df<|�|d�|d
|df<|||<q4Wn,t�y�}
z|
j	WYd}
~
Sd}
~
00t
|�|d<t��|d<|�|�|S)z�
        Docker monitoring, needs sudo access!
        Instructions at:
        https://docs.360monitoring.com/docs/docker-plugin
        cSsg|]}|�d��qS)z / )�split)�.0�s�r�A/usr/local/lib/python3.9/site-packages/agent360/plugins/docker.py�
<listcomp>�zPlugin.run.<locals>.<listcomp>z�sudo docker stats --no-stream --no-trunc --format "{{.CPUPerc}} / {{.Name}} / {{.ID}} / {{.MemUsage}} / {{.NetIO}} / {{.BlockIO}} / {{.MemPerc}}"r�%�cpu���Zmem_usage_bytes�Zmem_total_bytesz%s_%sZnet_in_bytes�Z
net_out_bytes�Z
disk_in_bytes�Zdisk_out_bytes��	Zmem_pctN�
containers�ts)
Zget_agent_cache�os�popen�read�
splitlines�strip�computerReadableZabsolute_to_per_second�	Exception�message�len�timeZset_agent_cache)�self�configr�
last_valueZ
prev_cache�lines�row�	container�nameZcontainer_id�errr�runs:
$$$$
z
Plugin.runcCs�|dd�dkr$t|dd��dS|dd�dkrLt|dd��ddS|dd�dkrxt|dd��dddS|dd�dkr�t|dd��ddddS|dd�dkr�t|dd��dddddS|dd�d	k�rt|dd��dS|dd�d
k�r,t|dd��ddS|dd�dk�rZt|dd��dddS|dd�dk�r�t|dd��ddddS|dd�d
k�r�t|dd��dddddS|dd�dk�r�t|dd��SdS)N���ZKiBiZMiBZGiBZTiBZPiB���ZkBZMBZGBZTBZPB����B)�float)r!�valuerrrr1s, $ $zPlugin.computerReadableN)�__name__�
__module__�__qualname__r)rrrrrrs&r�__main__)rZpluginsr Z
BasePluginrr0�executerrrr�<module>s
A