HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //usr/local/lib/python3.9/site-packages/agent360/plugins/__pycache__/memcached.cpython-39.pyc
a

q�dg]�@sHddlZddlZddlZddlZGdd�dej�ZedkrDe���dS)�Nc@seZdZdZdd�ZdS)�Plugin�	memcachedc
CsJ|��}z|�dd�}Wnd}Yn0zJ|dur^tjd|�dd�|�dd�fgdd�}ntjd	|gdd�}WnYd
S0d}d}i}i}z�|��}	t|	dd
�D]n\}
}|	dd
|}|����}
|
|vr�t|�||
<q�|
|vr�t|�}|�	|
t|�|�||
<t|�||
<q�q�WnYdS0t
�
�|d<|�|�|S)z�
        pip install python-memcached
        add to /etc/agent360.ini
        [memcached]
        enabled=yes
        host=127.0.0.1
        port=11211
        r�socketFz%s:%s�host�portr)�debugzunix:/%szCould not connect to memcached)Zaccepting_conns�bytesZuptimeZtotal_itemsZtotal_connectionsZtime_in_listen_disabled_us�threadsZrusage_userZ
rusage_systemZreserved_fdsZpointer_sizeZmalloc_failsZlrutail_reflockedZlisten_disabled_numZlimit_maxbytesZhash_power_levelZ
hash_bytesZ
curr_itemsZcurr_connectionsZconnection_structuresZconn_yieldsZ	reclaimed)Z	auth_cmdsZauth_errors�
bytes_readZ
bytes_writtenZtouch_missesZ
touch_hitsZincr_misses�	incr_hitsZ
cas_missesZ
cas_badvalrZ
get_missesZget_hitsZexpired_unfetchedZ	evictionsZevicted_unfetchedZ
delete_missesZdelete_hitsZdecr_missesZ	decr_hitsZcrawler_reclaimedZcrawler_items_checkedZ	cmd_touchZcmd_getZcmd_setZ	cmd_flushZ
cmd_missesZ
cmd_badvalZcmd_hits�zCould not fetch memcached stats�ts)Zget_agent_cache�get�memcacheZClientZ	get_stats�	enumerate�lower�strip�floatZabsolute_to_per_second�timeZset_agent_cache)
�self�configZ
prev_cacherZmcZ	non_deltaZ
delta_keys�results�data�result�key�	key_value�value�r�D/usr/local/lib/python3.9/site-packages/agent360/plugins/memcached.py�run	s@	
* 
z
Plugin.runN)�__name__�
__module__�__qualname__rrrrrrsr�__main__)Zplugins�structrrZ
BasePluginrr �executerrrr�<module>si