3 ܓi@s4ddlZddlmZmZmZGdddeeeZdS)N)Plugin RedHatPlugin UbuntuPluginc@s4eZdZdZdZdZdZdZdZd d Z ddZ dS)CephOSDa This plugin is for capturing information from Ceph OSD nodes. While the majority of this plugin should be version agnostic, several collections are dependent upon the version of Ceph installed. Versions that correlate to RHCS 4 or RHCS 5 are explicitly handled for differences such as those pertaining to log locations on the host filesystem. Note that while this plugin will activate based on the presence of Ceph containers, commands are run directly on the host as those containers are often not configured to successfully run the `ceph` commands collected by this plugin. These commands are majorly `ceph daemon` commands that will reference discovered admin sockets under /var/run/ceph. zCEPH osdZceph_osdstoragevirt containercephceph-(.*-)?osd.*/var/lib/ceph/osd/*/var/lib/ceph/*/osd*%/var/snap/microceph/common/data/osd/*c s|jd}d}|jjjd}dddddd d d d d ddddddddddddddddddd d!d"d#g |sd$}|jd%d&i|jd'd(d)d*g|jd+d,d-d.g|jd/d0g|r|jd1d2gn2d3}|jd4d5d6g|jd7d8g|r|jd9g|jfd:d;|j|DdS)sz!CephOSD.setup..) Z get_optionZpolicyZpackage_managerZ pkg_by_nameZ add_file_tagsZadd_forbidden_pathZ add_copy_specZadd_cmd_output get_socks)selfr directoryZ microceph_pkgr)rrsetup's    z CephOSD.setupcCsTg}xJtj|D]<\}}}x0|D](}|jdr d|kr |j|j||q WqW|S)z Find any available admin sockets under /var/run/ceph (or subdirs for later versions of Ceph) which can be used for ceph daemon commands z.asokZosd)oswalkendswithappendZ path_join)rrZ ceph_socketsZrdir_filesfilerrrrs  zCephOSD.get_socksN)rrrr )r )r r r ) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZ containersr"rrrrrrrs dr)rZsos.report.pluginsrrrrrrrr s