%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/beacons/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/beacons/diskusage.pyo

�
���^c@@s�dZddlmZmZddlZddlZddlZyddlZe	Z
Wnek
roeZ
nXej
e�ZdZd�Zd�Zd�ZdS(uT
Beacon to monitor disk usage.

.. versionadded:: 2015.5.0

:depends: python-psutil
i(tabsolute_importtunicode_literalsNu	diskusagecC@sttkrtStSdS(N(t
HAS_PSUTILtFalset__virtualname__(((s:/usr/lib/python2.7/site-packages/salt/beacons/diskusage.pyt__virtual__scC@s#t|t�stdfStdfS(u+
    Validate the beacon configuration
    u2Configuration for diskusage beacon must be a list.uValid beacon configuration(t
isinstancetlistRtTrue(tconfig((s:/usr/lib/python2.7/site-packages/salt/beacons/diskusage.pytvalidate$s
cC@s�tjdt�}g}xk|D]c}tt|��}|}|jd�s^dj|�}ntjj	j
�r�tjdd|�}tjdd|�}|j
�}nx�|D]�}tj||j�r�|j}ytj|�}Wn$tk
r
tjd|�q�nX|j}	||}
d|
krEtjdd	|
�}
nt|
�}
|	|
kr~|ji|	d
6|d6�q~q�q�WqW|S(u
    Monitor the disk usage of the minion

    Specify thresholds for each disk and only emit a beacon if any of them are
    exceeded.

    .. code-block:: yaml

        beacons:
          diskusage:
            - /: 63%
            - /mnt/nfs: 50%

    Windows drives must be quoted to avoid yaml syntax errors

    .. code-block:: yaml

        beacons:
          diskusage:
            -  interval: 120
            - 'c:\\': 90%
            - 'd:\\': 50%

    Regular expressions can be used as mount points.

    .. code-block:: yaml

        beacons:
          diskusage:
            - '^\/(?!home).*$': 90%
            - '^[a-zA-Z]:\\$': 50%

    The first one will match all mounted disks beginning with "/", except /home
    The second one will match disks from A:\ to Z:\ on a Windows system

    Note that if a regular expression are evaluated after static mount points,
    which means that if a regular expression matches another defined mount point,
    it will override the previously defined threshold.

    tallu$u{0}$u:\\\$u:\\\\u:\\\\\$u%s is not a valid mount point.u%uu	diskusageumount(tpsutiltdisk_partitionsRtnexttitertendswithtformattsalttutilstplatformt
is_windowstretsubtuppertmatcht
mountpointt
disk_usagetOSErrortlogtwarningtpercenttfloattappend(R	tpartstrettmountstmounttmount_retpartt_mountt_current_usaget
current_usaget
monitor_usage((s:/usr/lib/python2.7/site-packages/salt/beacons/diskusage.pytbeacon/s6)

	
	
)(t__doc__t
__future__RRtloggingRtsalt.utils.platformRRRRtImportErrorRt	getLoggert__name__RRRR
R,(((s:/usr/lib/python2.7/site-packages/salt/beacons/diskusage.pyt<module>s


		

Zerion Mini Shell 1.0