%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/munin.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	Z
ddlZ
dZd�Z
dd�Zd	�Zd
�Zd�ZdS(uC
Run munin plugins/checks from salt and format the output as data.
i(tabsolute_importtprint_functiontunicode_literalsN(tsixu/etc/munin/plugins/cC@s tjjd�rdStdfS(u9
    Only load the module if munin-node is installed
    u/etc/munin/munin-node.confumuninuIThe munin execution module cannot be loaded: munin-node is not installed.(tostpathtexiststFalse(((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pyt__virtual__su/etc/munin/munin-node.cfgcC@s>tjjj|d�� }tjjj|j��SWdQXdS(Nur(tsalttutilstfilestfopentstringutilst
to_unicodetread(tfnametfp_((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pyt	_get_confscC@s!t�}t|tj�r-|jd�}ni}x�|D]�}||krRq:ni||<tddj|�dt�}x�|jd�D]�}d|kr�|jd�\}}|jd�d	}y9d|kr�t|�}nt	|�}||||<Wqt
k
rqXq�q�Wq:W|S(
u�
    Run one or more named munin plugins

    CLI Example:

    .. code-block:: bash

        salt '*' munin.run uptime
        salt '*' munin.run uptime,cpu,load,memory
    u,ucmd.runu
munin-run {0}tpython_shellu
uvalueu u.i(tlist_pluginst
isinstanceRtstring_typestsplitt__salt__tformatRtfloattintt
ValueError(tpluginstall_pluginstdatatplugintmuninouttlinetkeytval((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pytrun!s.	

	
cC@s7t�}i}x!|D]}|jt|��qW|S(uo
    Run all the munin plugins

    CLI Example:

    .. code-block:: bash

        salt '*' munin.run_all
    (RtupdateR%(RtretR ((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pytrun_allIs

	
cC@s�tjt�}g}xn|D]f}tjjt|�}y!tjtj|�tj@}Wntk
rknX|r|j	|�qqW|S(uu
    List all the munin plugins

    CLI Example:

    .. code-block:: bash

        salt '*' munin.list_plugins
    (
Rtlistdirt	PLUGINDIRRtjointstattS_IXUSRtST_MODEtOSErrortappend(t
pluginlistR'R tstatft
executebit((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pyRZs

!
(t__doc__t
__future__RRRRR,tsalt.extRtsalt.utils.filesR	tsalt.utils.stringutilsR*RRR%R(R(((s6/usr/lib/python2.7/site-packages/salt/modules/munin.pyt<module>s			(	

Zerion Mini Shell 1.0