mgr/devicehealth: rename old smart module to devicehealth

Let's avoid "SMART" since it's misleading (it refers specifically to ATA).

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-06-08 09:01:27 -05:00
parent 7897f21a70
commit 07cbb10719
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,2 @@
from .module import Module

View File

@ -0,0 +1,37 @@
"""
Device health monitoring
"""
import json
from mgr_module import MgrModule, CommandResult
import rados
from threading import Event
from datetime import datetime, timedelta, date, time
class Module(MgrModule):
COMMANDS = [
{
"cmd": "device query-daemon-health-metrics "
"name=osd_id,type=CephOsdName,req=true",
"desc": "Get device health metrics for a given daemon (OSD)",
"perm": "r"
},
]
def handle_command(self, inbuf, cmd):
self.log.error("handle_command")
if cmd['prefix'] == 'device query-daemon-health-metrics':
result = CommandResult('')
self.send_command(result, 'osd', str(cmd['osd_id']), json.dumps({
'prefix': 'smart',
'format': 'json',
}), '')
r, outb, outs = result.wait()
return (r, outb, outs)
else:
# mgr should respect our self.COMMANDS and not call us for
# any prefix we don't advertise
raise NotImplementedError(cmd['prefix'])