mirror of
https://github.com/ceph/ceph
synced 2025-02-21 18:17:42 +00:00
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:
parent
7897f21a70
commit
07cbb10719
2
src/pybind/mgr/devicehealth/__init__.py
Normal file
2
src/pybind/mgr/devicehealth/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
from .module import Module
|
37
src/pybind/mgr/devicehealth/module.py
Normal file
37
src/pybind/mgr/devicehealth/module.py
Normal 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'])
|
Loading…
Reference in New Issue
Block a user