403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/beacons/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/beacons/__pycache__/swapusage.cpython-310.pyc
o

;j��@sndZddlZddlZddlZzddlZdZWney!dZYnwe�e	�Z
dZdd�Zdd	�Z
d
d�ZdS)zP
Beacon to monitor swap usage.

.. versionadded:: 3003

:depends: python-psutil
�NTF�	swapusagecCs&tdurd}t�dt|�d|fStS)NFzpsutil library is missing.zUnable to load %s beacon: %s)�
HAS_PSUTIL�log�error�__virtualname__)�err_msg�r�J/opt/saltstack/salt/lib/python3.10/site-packages/salt/beacons/swapusage.py�__virtual__s
r
cCs,t|t�sdStjj�|�}d|vrdSdS)z+
    Validate the beacon configuration
    )Fz2Configuration for swapusage beacon must be a list.�percent)Fz4Configuration for swapusage beacon requires percent.)TzValid beacon configuration)�
isinstance�list�salt�utils�beacons�list_to_dict)�configrrr	�validate#s
rcCsjg}tjj�|�}t��}|j}|d}t|t�r$d|vr$t	�
dd|�}t|�}||kr3|�d|i�|S)z�
    Monitor the swap usage of the minion

    Specify thresholds for percent used and only emit a beacon
    if it is exceeded.

    .. code-block:: yaml

        beacons:
          swapusage:
            - percent: 13%
    r�%�r)
rrrr�psutilZswap_memoryrr�str�re�sub�float�append)r�retZ_current_usageZ
current_usageZ
monitor_usagerrr	�beacon2s
r)�__doc__�loggingrZsalt.utils.beaconsrrr�ImportError�	getLogger�__name__rrr
rrrrrr	�<module>s�
	

Youez - 2016 - github.com/yon3zu
LinuXploit