File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/nagios.cpython-310.pyc
o
�N�g� � @ s� d Z ddlZddlZddlZe�e�ZdZdd� Zddd �Z d
d� Z
dd
� Zddd�Zddd�Z
ddd�Zdd� Zdd� Zdd� Zdd� ZdS )zA
Run nagios plugins/checks from salt and get the return as data.
� Nz/usr/lib/nagios/plugins/c C s t j�t�rdS dS )z3
Only load if nagios-plugins are installed
Znagios)FzOThe nagios execution module cannot be loaded: nagios-plugins are not installed.)�os�path�isdir� PLUGINDIR� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/nagios.py�__virtual__ s r � �cmd.retcodec C s4 i }t � }| |v rt| t� | � d|� �dd�}|S )z`
Execute nagios plugin if it's in the directory with salt command specified in run_type
� F)Zpython_shell)�list_plugins�__salt__r )�plugin�args�run_type�dataZall_pluginsr r r �_execute_cmd s
r c
C s� t d | �}i }|D ]3}i ||<