o
    id                     @   s*   d dl mZmZmZ G dd deeZdS )    )PluginRedHatPlugin	PluginOptc                   @   s4   e Zd ZdZdZdZdZeddddgZd	d
 Z	dS )MsSQLzMicrosoft SQL Server on Linuxmssql)services)mssql-server
mssql_confz/var/opt/mssql/mssql.confzSQL server configuration file)defaultdescc           
   
   C   s  |  d}d}d}d}d }zJt|  D ]?}|dr |}q|d}|d  dkrC|d	kr8|d
  }q|dkrB|d
  }q|d  dkrU|dkrU|d
  }qW n tys } z| d||f  W Y d }~d S d }~ww d| }	|d ur| 	|r| 
d|  | 
d|  n| |	 | ||d |g |  ds| |d  | | n| |d  | | | jdgd d S )Nr	    z/var/opt/mssql/logz&/var/opt/mssql/log/sqlagentstartup.log[=r   errorlogfilez[filelocation]   z
[sqlagent]kerberoskeytabfilez	[network]zCould not open conf file %s: %sz:keytab file is specfieid in mssql_conf but not found in %szls -l %szklist -e -k %sz/*all_logsr   )units)
get_optionopenread
splitlines
startswithsplitstripIOError
_log_errorpath_isfileadd_cmd_outputadd_copy_specadd_journal)
selfr	   sectionr   sqlagent_errorlogfiler   linewordsex
keytab_err r(   :/usr/lib/python3/dist-packages/sos/report/plugins/mssql.pysetup   s`   






zMsSQL.setupN)
__name__
__module____qualname__
short_descplugin_nameprofilespackagesr   option_listr*   r(   r(   r(   r)   r      s    r   N)sos.report.pluginsr   r   r   r   r(   r(   r(   r)   <module>   s   
