Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/memcached.cpython-36.pyc

3

�uGh]�@sHddlZddlZddlZddlZGdd�dej�ZedkrDe�j�dS)�Nc@seZdZdZdd�ZdS)�Plugin�	memcachedc
)CsL|j�}y|jdd�}Wnd}YnXyJ|dkr^tjd|jdd�|jdd�fgdd�}ntjd	|gdd�}Wn
d
Sd@}dA}i}i}y�|j�}	x�t|	dd=�D]t\}
}|	dd=|}|j�j�}
|
|k�r�t|�||
<n6|
|k�r�t|�}|j	|
t|�|�||
<t|�||
<n�q�WWn
d>St
j
�|d?<|j|�|S)Bz�
        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�accepting_conns�bytes�uptime�total_items�total_connections�time_in_listen_disabled_us�threads�rusage_user�
rusage_system�reserved_fds�pointer_size�malloc_fails�lrutail_reflocked�listen_disabled_num�limit_maxbytes�hash_power_level�
hash_bytes�
curr_items�curr_connections�connection_structures�conn_yields�	reclaimed�	auth_cmds�auth_errors�
bytes_read�
bytes_written�touch_misses�
touch_hits�incr_misses�	incr_hits�
cas_misses�
cas_badval�
get_misses�get_hits�expired_unfetched�	evictions�evicted_unfetched�
delete_misses�delete_hits�decr_misses�	decr_hits�crawler_reclaimed�crawler_items_checked�	cmd_touch�cmd_get�cmd_set�	cmd_flush�
cmd_misses�
cmd_badval�cmd_hits�zCould not fetch memcached stats�ts)rr	r
rrr
rrrrrrrrrrrrrrrr)rrr r!r"r#r$r%r&r'r%r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9)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�rK�C/root/tmp/pip-build-gzoz1_uw/agent360/agent360/plugins/memcached.py�run	s�	
*



z
Plugin.runN)�__name__�
__module__�__qualname__rMrKrKrKrLrsr�__main__)Zplugins�structrBr=Z
BasePluginrrN�executerKrKrKrL�<module>si

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists