Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to pass NVMe character device instead of block device in get_nvme_list() file: nvme_list.py line: 22 #5

Open
ghansh0551 opened this issue Jun 23, 2023 · 0 comments

Comments

@ghansh0551
Copy link

nvme show-regs
The parameter is mandatory and must be the nvme admin character device (ex: /dev/nvme0).

But here you are passing the block device i.e. "/dev/nvme0n1" instead of character device "/dev/nvme0" in nvme_list.py line 22.

So eventually the script gets fails

(Pdb) device_path '/dev/nvme0n1' (Pdb) c Traceback (most recent call last): File "/home/ubuntu/nvme_exporter/nvme_exporter.py", line 184, in <module> main() File "/home/ubuntu/nvme_exporter/nvme_exporter.py", line 176, in main gather_nvme_ctrl_info(nvme_ctrl_gauge, nvme_list_json) File "/home/ubuntu/nvme_exporter/nvme_exporter.py", line 106, in gather_nvme_ctrl_info ctrl_json = nc.get_ctrl_regs(device) File "/home/ubuntu/nvme_exporter/nvme_ctrl.py", line 16, in get_ctrl_regs json_data = json.loads(stdout) File "/usr/lib/python3.10/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

$ sudo nvme show-regs /dev/nvme0n1
nvme-subsys0 is not a physical nvme controller

It works fine with character device
$ sudo nvme show-regs /dev/nvme0

cap : 1800c0301e023fff
version : 20000
cc : 460001
csts : 1

Please fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant