[sos-devel] Writing sos plugin for SQL Server on Linux

Pavel Moravec pmoravec at redhat.com
Thu May 24 11:20:39 UTC 2018


.. anyway proposing a patch or improvement via mail is surely welcomed and
accepted.

Kind regards,
Pavel

On Thu, May 24, 2018 at 1:03 PM, Pavel Moravec <pmoravec at redhat.com> wrote:

> Creating PR directly is IMHO fine, you can get better feedback there
> pinpointing to particular lines etc. - a code review is better to be done
> in github PR than via mail.
>
> Basically plugin seems ok, few points:
>
> - pep8 formatting :)
> - instead of pure URL with mssql.conf format, it is (also) worth
> explaining what the further code performs
> - catch exception when the config file is not present or readable
> - aren't you interested in collecting the mssql_conf file itself (but if
> so, can't it contain some credentials we should obfuscate? if so, see e.g.
> https://github.com/sosreport/sos/blob/master/sos/plugins/
> openstack_ansible.py#L30 how to do that)
>
>
>
> Kind regards,
> Pavel
>
> On Thu, May 24, 2018 at 9:45 AM, Takayoshi Tanaka <tatanaka at redhat.com>
> wrote:
>
>> Hello,
>>
>> I'm working on Azure support team and now writing a plugin for $subject.
>> Since I'm a beginner of Python, I would appreciate your comments before I
>> submit a PR.
>> Here is a source code.
>> https://github.com/tanaka-takayoshi/sos/blob/mssql/sos/plugins/mssql.py
>>
>> I'm concerned with a way to parse configuration file to specify the log
>> file location.
>> The location of log files is specified in mssql.conf, which is located
>> at /var/opt/mssql/mssql.conf by default.
>> This file looks like as follows.
>>
>> ```
>> [filelocation]
>> errorlogfile = /var/opt/mssql/log
>>
>> [sqlagent]
>> databasemailprofile = default
>> errorlogfile = /var/opt/mssql/log/sqlagentlog.log
>> ```
>>
>> I'm parsing this file in this location.
>> https://github.com/tanaka-takayoshi/sos/blob/mssql/sos/plugi
>> ns/mssql.py#L35-L48
>>
>> Is this a good way to parse this conf file in Python/sos plugin?
>> Also, I would appreciate any comments on my code.
>>
>>
>> Thanks,
>> --
>>
>> TAKAYOSHI TANAKA
>>
>> SOFTWARE MAINTENANCE ENGINEER, RHCA, MICROSOFT MVP
>>
>> Red Hat K.K. <https://www.redhat.com/>
>>
>> 8F, Ebisu Neonato, 4-1-18 Ebisu
>>
>> Shibuya-ku Tokyo, 150-0013, Japan
>>
>> tatanaka at redhat.com    M: +81-80-4193-5143     IM: tatanaka
>> <https://red.ht/sig>
>>
>> _______________________________________________
>> sos-devel mailing list
>> sos-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/sos-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/sos-devel/attachments/20180524/ef18ee95/attachment.htm>


More information about the sos-devel mailing list