the error in the log was this
```
"/usr/share/ceph/mgr/dashboard/services/ceph_service.py", line 253, in _get_smart_data_by_device
May 06 07:38:39 occldlr750-1.occl208.lab conmon[
2142938]: svc_type, svc_id = daemon.split('.')
May 06 07:38:39 occldlr750-1.occl208.lab conmon[
2142938]: ValueError: too many values to unpack (expected 2)
```
on the cluster, the output of `ceph device ls-by-host` looks like this
```
ceph: root@occldlr750-1 /]# ceph device ls-by-host occldlr750-1.occl208.lab
DEVICE DEV DAEMONS EXPECTED FAILURE
DELLBOSS_VD_cbd004c975390010 sda mon.occldlr750-1.occl208.lab
WDC_WUH721818AL5204_3FGZR3JT sdda osd.20
WDC_WUH721818AL5204_3FH4315T sdbf osd.94
WDC_WUH721818AL5204_3FHP58TT sdec osd.30
WDC_WUH721818AL5204_3FHSK8HT sdu osd.78
WDC_WUH721818AL5204_3FHVTS9T sdfi osd.47
WDC_WUH721818AL5204_3FHWJE8T sdv osd.23
WDC_WUH721818AL5204_3FHXHETT sdcl osd.11
WDC_WUH721818AL5204_3FHXKP1T sdcj osd.10
```
the first device is mon and its name is mon.occldlr750-1.occl208.lab.
In our dashboard code, when fetching the smart data we have a line like
this
`svc_type, svc_id = daemon.split('.')`
so for the mon the output of `daemon.split('.') will be ['mon', 'occldlr750-1', 'occl208', 'lab']. The svc_id gets split into three because of the split. I am changing that and giving the criteria as splitting only on the first occurence of the dot and the considering everything that comes after the dot as the svc_id of the device.
Fixes: https://tracker.ceph.com/issues/55571
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit
f38e3e96b8c32f6fb7370406b975cd88431858d8)
# thus it is not relevant for us which daemon we are using.
# NOTE: the list may contain daemons that are 'down' or 'destroyed'.
for daemon in device['daemons']:
- svc_type, svc_id = daemon.split('.')
+ svc_type, svc_id = daemon.split('.', 1)
if 'osd' in svc_type:
if daemon not in osd_daemons_up:
continue
self.sleep_interval = 0.0
def is_valid_daemon_name(self, who: str) -> bool:
- parts = who.split('.')
+ parts = who.split('.', 1)
if len(parts) != 2:
return False
return parts[0] in ('osd', 'mon')