From 44068fc941f50c37f235725e77630f4de77cb3fa Mon Sep 17 00:00:00 2001 From: Patrick Seidensal Date: Mon, 16 Sep 2019 15:44:53 +0200 Subject: [PATCH] osd: add common smartctl output to JSON output Enables consumers like the dashboard to provide the regular smartctl output to users. Signed-off-by: Patrick Seidensal --- src/common/blkdev.cc | 2 +- sudoers.d/ceph-osd-smartctl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc index 2d34decb299..4da2be6a4c3 100644 --- a/src/common/blkdev.cc +++ b/src/common/blkdev.cc @@ -681,7 +681,7 @@ static int block_device_run_smartctl(const string& devname, int timeout, "smartctl", "-a", //"-x", - "--json", + "--json=o", device.c_str(), NULL); diff --git a/sudoers.d/ceph-osd-smartctl b/sudoers.d/ceph-osd-smartctl index ba788d6c0be..882e8b68121 100644 --- a/sudoers.d/ceph-osd-smartctl +++ b/sudoers.d/ceph-osd-smartctl @@ -1,4 +1,4 @@ ## allow ceph-osd (which runs as user ceph) to collect device health metrics -ceph ALL=NOPASSWD: /usr/sbin/smartctl -a --json /dev/* +ceph ALL=NOPASSWD: /usr/sbin/smartctl -a --json=o /dev/* ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*