diff options
author | Nikhil Kshirsagar <nikhil.kshirsagar@canonical.com> | 2023-10-09 07:19:34 +0000 |
---|---|---|
committer | Jake Hunsaker <jacob.r.hunsaker@gmail.com> | 2023-10-13 07:25:03 -0700 |
commit | 19d2faf9d68f30741025b87c1ddaee27b04f5a02 (patch) | |
tree | 2b9896aa062b73ace0d1eb195b7d54844cc88430 | |
parent | dd6aa62a2e5d37f65693ea666a7fbf0f451ba4ba (diff) | |
download | sos-19d2faf9d68f30741025b87c1ddaee27b04f5a02.tar.gz |
[microceph][ubuntu] Collect ceph daemon commands in OSD node
Now that https://github.com/canonical/microceph/issues/160 is fixed,
gather the ceph daemon command outputs for OSD nodes.
Signed-off-by: Nikhil Kshirsagar <nikhil.kshirsagar@canonical.com>
-rw-r--r-- | sos/report/plugins/ceph_osd.py | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/sos/report/plugins/ceph_osd.py b/sos/report/plugins/ceph_osd.py index 41bde4c9..57987302 100644 --- a/sos/report/plugins/ceph_osd.py +++ b/sos/report/plugins/ceph_osd.py @@ -36,6 +36,39 @@ class CephOSD(Plugin, RedHatPlugin, UbuntuPlugin): def setup(self): microceph_pkg = self.policy.package_manager.pkg_by_name('microceph') + cmds = [ + # will work pre quincy + "dump_reservations", + "bluestore bluefs available", + # will work quincy onward + "bluestore bluefs device info", + "bluefs stats", + "config diff", + "config show", + "dump_blocklist", + "dump_blocked_ops", + "dump_historic_ops_by_duration", + "dump_historic_slow_ops", + "dump_mempools", + "dump_ops_in_flight", + "dump_op_pq_state", + "dump_osd_network", + "dump_pgstate_history", + "dump_recovery_reservations", + "dump_scrubs", + "get_mapped_pools", + "dump_watchers", + "log dump", + "list_devices", + "list_unfound", + "perf dump", + "perf histogram dump", + "objecter_requests", + "ops", + "status", + "version", + ] + if not microceph_pkg: self.add_file_tags({ "/var/log/ceph/(.*/)?ceph-(.*-)?osd.*.log": 'ceph_osd_log', @@ -63,31 +96,9 @@ class CephOSD(Plugin, RedHatPlugin, UbuntuPlugin): "ceph-volume lvm list" ]) - cmds = [ - "bluestore bluefs available", - "config diff", - "config show", - "dump_blacklist", - "dump_blocked_ops", - "dump_historic_ops_by_duration", - "dump_historic_slow_ops", - "dump_mempools", - "dump_ops_in_flight", - "dump_op_pq_state", - "dump_osd_network", - "dump_reservations", - "dump_watchers", - "log dump", - "perf dump", - "perf histogram dump", - "objecter_requests", - "ops", - "status", - "version", - ] - self.add_cmd_output( - [f"ceph daemon {i} {c}" for i in self.get_socks() for c in cmds] + [f"ceph daemon {i} {c}" for i in self.get_socks( + 'var/run/ceph') for c in cmds] ) else: @@ -103,15 +114,20 @@ class CephOSD(Plugin, RedHatPlugin, UbuntuPlugin): "/var/snap/microceph/common/logs/*ceph-osd*.log", ]) - def get_socks(self): + self.add_cmd_output( + [f"ceph daemon {i} {c}" for i in self.get_socks( + '/var/snap/microceph/') for c in cmds] + ) + + def get_socks(self, folderpath): """ Find any available admin sockets under /var/run/ceph (or subdirs for later versions of Ceph) which can be used for ceph daemon commands """ ceph_sockets = [] - for rdir, dirs, files in os.walk('/var/run/ceph/'): + for rdir, dirs, files in os.walk(folderpath): for file in files: - if file.endswith('.asok'): + if file.endswith('.asok') and 'osd' in file: ceph_sockets.append(self.path_join(rdir, file)) return ceph_sockets |