Coder Social home page Coder Social logo

nvme_exporter's People

Contributors

yongseokoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nvme_exporter's Issues

nvme0 failed to map. Did your kernel enable CONFIG_IO_STRICT_DEVMEM?

$ python3 nvme_exporter.py -p 9900 -u 5
DevicePath /dev/nvme0n1
Firmware AAGA4106
Index 0
ModelNumber KXG50ZNV512G TOSHIBA
ProductName Non-Volatile memory controller: Toshiba Corporation Device 0x0116
SerialNumber 48TS10BVTYST
UsedBytes 512110190592
MaximumLBA 1000215216
PhysicalSize 512110190592
SectorSize 512
DevicePath /dev/nvme1n1
Firmware AAGA4106
Index 1
ModelNumber KXG50ZNV512G TOSHIBA
ProductName Non-Volatile memory controller: Toshiba Corporation Device 0x0116
SerialNumber 48TS10EFTYST
UsedBytes 512110190592
MaximumLBA 1000215216
PhysicalSize 512110190592
SectorSize 512
critical_warning 0
temperature 301
avail_spare 100
spare_thresh 10
percent_used 184
data_units_read 111876632
data_units_written 696554113
host_read_commands 1085544532
host_write_commands 6859327382
controller_buys_time 150201
power_cycles 52
power_on_hours 29698
unsafe_shutdowns 11
media_errors 0
num_err_log_entries 0
warning_temp_time 0
critical_comp_tim 0
thm_temp1_trans_count 0
thm_temp2_trans_count 0
thm_temp1_total_time 0
thm_temp2_total_time 0
critical_warning 0
temperature 303
avail_spare 100
spare_thresh 10
percent_used 222
data_units_read 38569398
data_units_written 857159522
host_read_commands 494702158
host_write_commands 8540271356
controller_buys_time 242229
power_cycles 17
power_on_hours 30237
unsafe_shutdowns 2
media_errors 0
num_err_log_entries 0
warning_temp_time 0
critical_comp_tim 0
thm_temp1_trans_count 0
thm_temp2_trans_count 0
thm_temp1_total_time 0
thm_temp2_total_time 0
nvme0 failed to map. Did your kernel enable CONFIG_IO_STRICT_DEVMEM?
Traceback (most recent call last):
  File "/opt/node_exporter/nvme_exporter/nvme_exporter.py", line 184, in <module>
    main()
  File "/opt/node_exporter/nvme_exporter/nvme_exporter.py", line 176, in main
    gather_nvme_ctrl_info(nvme_ctrl_gauge, nvme_list_json)
  File "/opt/node_exporter/nvme_exporter/nvme_exporter.py", line 106, in gather_nvme_ctrl_info
    ctrl_json = nc.get_ctrl_regs(device)
  File "/opt/node_exporter/nvme_exporter/nvme_ctrl.py", line 16, in get_ctrl_regs
    json_data = json.loads(stdout)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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)

Fail in requirements.txt

Hello, I have installed your exporter, it works great except for one small problem,
the prometheus client referenced in your requirements.txt, is too old, and don't have the Info on the client

You just have to change the version to make it work !

root@owdavl:/home/owd/nvme_exporter# python3 nvme_exporter.py -p 9243 -u 10
Traceback (most recent call last):
File "nvme_exporter.py", line 2, in
from prometheus_client import Info
ImportError: cannot import name 'Info' from 'prometheus_client' (/usr/local/lib/python3.7/dist-packages/prometheus_client/init.py)

Thanks a lot for your work !

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.