o
    O6ufß	  ã                   @   s6   d dl mZmZmZ d dlmZ G dd„ deeƒZdS )é    )ÚPluginÚRedHatPluginÚ	PluginOpt©Úis_executablec                   @   sJ   e Zd ZdZdZdZeddedd�gZdd	„ Z	d
d„ Z
dd„ Zdd„ ZdS )ÚNaviclizEMC NavicliÚnavicli)ÚstorageÚhardwareÚipaddrsÚ z-space-delimited list of CLARiiON IP addresses)ÚdefaultÚval_typeÚdescc                 C   s   t dƒS )Nr   r   ©Úself© r   ú</usr/lib/python3/dist-packages/sos/report/plugins/navicli.pyÚcheck_enabled   s   zNavicli.check_enabledc                 C   s   |   g d¢¡ dS )zH EMC Navisphere Host Agent NAVICLI specific information - files
        )z/etc/Navisphere/agent.configz/etc/Navisphere/Navimon.cfgz/etc/Navisphere/Quietmode.cfgz/etc/Navisphere/messages/[a-z]*z/etc/Navisphere/log/[a-z]*N)Úadd_copy_specr   r   r   r   Úget_navicli_config   s   zNavicli.get_navicli_configc                 C   s�   |   d|› d�d|› d�d|› d�d|› d�d|› d�d|› d�d|› d�d|› d	�d|› d
�d|› d�d|› d�d|› d�d|› d�g¡ dS )z^ EMC Navisphere Host Agent NAVICLI specific
        information - CLARiiON - commands
        únavicli -h z getallz getsptime -spaz getsptime -spbz getlogz getdiskz	 getcachez getlunz1 getlun -rg -type -default -owner -crus -capacityz lunmapinfoz getcrusz port -list -allz storagegroup -listz spportspeed -getN)Úadd_cmd_output)r   Ú
sp_addressr   r   r   Úget_navicli_sp_info)   s   













òzNavicli.get_navicli_sp_infoc                 C   sH   |   ¡  t|  d¡ ¡ ƒD ]}|  d|› d�¡d dkr!|  |¡ qd S )Nr   r   z
 getsptimeÚstatusr   )r   ÚsetÚ
get_optionÚsplitÚexec_cmdr   )r   Úaddrr   r   r   Úsetup>   s   
€þzNavicli.setupN)Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesr   ÚstrÚoption_listr   r   r   r!   r   r   r   r   r      s    ÿÿr   N)Úsos.report.pluginsr   r   r   Úsos.utilitiesr   r   r   r   r   r   Ú<module>   s   