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

��?h�	�@sFddlZddlZddlZejdkr,ddlZnddlZGdd�d�ZdS)�N��c@sJeZdZdZdZgfdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�
BasePluginz$
    Abstract class for plugins
    �cCst|t�r||_ntd��dS)Nz#Type of agent_cache have to be list)�
isinstance�list�agent_cache�	TypeError)�selfr�r�B/usr/local/lib/python3.9/site-packages/agent360/plugins/plugins.py�__init__s
zBasePlugin.__init__NcCsdS)z7
        Virtual method for running the plugin
        Nr�r
�configrrr�runszBasePlugin.runcCs\d}ttj�dkrBtjdkr(t�t�}n
t�t�}|�tjd�t	�
|�|�tjj
�dS)zL
        Execution wrapper for the plugin
        argv[1]: ini_file
        N�r)�len�sys�argv�version_info�configparser�RawConfigParser�defaults�ConfigParser�read�pickle�dumpr�stdout�bufferrrrr�execute!s

zBasePlugin.executecCs(z|jdWSty"iYS0dS)zE
        Return agent cached value for this specific plugin.
        rN)r�	Exception)r
rrr�get_agent_cache/szBasePlugin.get_agent_cachecCs2z||jd<Wnty,|j�|�Yn0dS)a�
        Set agent cache value previously passed to this plugin instance.
        To enable caching existing agent_cache list have to be passed
        to Plugin on initialization.
        Minimally it should be list().
        Agent will be able to see only changes in zero element of agent_cache, so
        do not manually override self.agent_cache, othervice cache will not be saved!

        If self.agent_cache is not a list appropriate exception will be raised.
        rN)r�
IndexError�append)r
�cacherrr�set_agent_cache8szBasePlugin.set_agent_cachecCs^zB|||kr,|||t��|d}n|t��|d}WntyXd}Yn0|S)N�tsr)�timer )r
�key�valZ
prev_cache�valuerrr�absolute_to_per_secondHs
���
z!BasePlugin.absolute_to_per_second)N)
�__name__�
__module__�__qualname__�__doc__r
rrr!r%r+rrrrrs	
	r)rr'rrrrrrrrr�<module>s