HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/cpu.cpython-36.pyc
3

3	Eg��@s@ddlZddlZddlZGdd�dej�Zedkr<e�j�dS)�Nc@seZdZdZdd�ZdS)�Plugin�cpucGs�|j�}i}tj�|d<i}tj�}y|dWnztk
r�tjdd�}d}tj�|d<x>|D]6}|d}i||<x |jD]}	t||	�|||	<q~WqbWtjd�YnXtjdd�}d	}x�|D]�}|d}i||<i||<x�|jD]�}	t||	�|||	<ytj�|d}
Wnw�YnX|
dk�r,q�t||	�|||	}|dk�rPd}||
d|||	<|||	dk�r�d|||	<|||	dkr�d|||	<q�Wq�W|j	|�|S)
N�tsT)Zpercpu�g�?r�d���r)
Zget_agent_cache�time�psutilZ	cpu_stats�KeyErrorZ	cpu_times�_fields�getattr�sleepZset_agent_cache)�selfZunusedZ
prev_cacheZ
next_cache�resultsZ
data_stats�data�
cpu_numberr�keyZ
time_deltaZcpu_time_delta�r�=/root/tmp/pip-build-f6rmvwrq/agent360/agent360/plugins/cpu.py�run
sR




z
Plugin.runN)�__name__�
__module__�__qualname__rrrrrrsr�__main__)r	ZpluginsrZ
BasePluginrr�executerrrr�<module>s
3