File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/monit.cpython-310.pyc
o
�N�g� � @ s� d Z ddlZddlZddd�Zdd� Zdd � Zd
d� Zdd
� Zdd� Z dd� Z
d"dd�Zd"dd�Zdd� Z
dd� Zdd� Zd#dd�Zd d!� ZdS )$zM
Monit service module. This module will create a monit type
service watcher.
� N�id�reload)�id_�reload_c C s t jj�d�d urdS dS )N�monitT)FzQThe monit execution module cannot be loaded: the monit binary is not in the path.)�salt�utils�path�which� r r �F/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/monit.py�__virtual__ s r
c C � d| � �}t d |dd� S )z^
CLI Example:
.. code-block:: bash
salt '*' monit.start <service name>
zmonit start �cmd.retcodeF�Zpython_shell��__salt__��name�cmdr r r �start s
r c C r )zy
Stops service via monit
CLI Example:
.. code-block:: bash
salt '*' monit.stop <service name>
zmonit stop r Fr r r r r r �stop* �
r c C r )z~
Restart service via monit
CLI Example:
.. code-block:: bash
salt '*' monit.restart <service name>
zmonit restart r Fr r r r r r �restart9 r r c C r )z�
Unmonitor service via monit
CLI Example:
.. code-block:: bash
salt '*' monit.unmonitor <service name>
zmonit unmonitor r Fr r r r r r � unmonitorH r r c C r )z~
monitor service via monit
CLI Example:
.. code-block:: bash
salt '*' monit.monitor <service name>
zmonit monitor r Fr r r r r r �monitorW r r � c C s� i }d}t d |��� }|D ]M}d|v rtddd� S |r&| |vs&d|v r'q|�d�}t|�dkr[|d �� |d
|d �� }}}| dkrM| |krMq||vrUi ||<