项目作者: server-state

项目描述 :
A module to view the current active raids based on /proc/mdstat generated by the linux-raid kernel module.
高级语言: JavaScript
项目地址: git://github.com/server-state/linux-raid-module.git
创建时间: 2019-09-04T13:31:04Z
项目社区:https://github.com/server-state/linux-raid-module

开源协议:MIT License

下载


Linux raid module

Build Status
GitHub
npm version
Coverage Status
module type: official

This module parses the file /proc/mdstat generated from the Linux raid kernel module and extracts useful information, for example, raid name, current devices with their status, activities.

The /proc/mdstat file might look like this:

  1. Personalities : [raid1] [raid0]
  2. md126 : active raid1 sdb20[2](R) sdb2[1] sdb1[0]
  3. 20954112 blocks super 1.2 [2/2] [UU]
  4. [==============>......] recovery = 74.4% (15600512/20954112) finish=3.2min speed=27496K/sec
  5. unused devices: <none>

For it, the parsed JSON output would look like this:

  1. {
  2. "personalities": [
  3. "raid1",
  4. "raid0"
  5. ],
  6. "raids": [
  7. {
  8. "name": "md126",
  9. "state": "active",
  10. "access": "rw",
  11. "type": "raid1",
  12. "unique": "myRaid",
  13. "devices": [
  14. {
  15. "name": "sdb20",
  16. "index": 2,
  17. "status": "rescue"
  18. },
  19. {
  20. "name": "sdb2",
  21. "index": 1,
  22. "status": "active"
  23. },
  24. {
  25. "name": "sdb1",
  26. "index": 0,
  27. "status": "active"
  28. }
  29. ],
  30. "blocks": 20954112,
  31. "parameters": "super 1.2",
  32. "ideal": 2,
  33. "current": 2,
  34. "options": [
  35. {
  36. "type": "activity",
  37. "activityType": "recovery",
  38. "progress": 74.4,
  39. "processed": 15600512,
  40. "total": 20954112,
  41. "finish": 3.2,
  42. "speed": 27496
  43. }
  44. ]
  45. }
  46. ]
  47. }

This output generates a straight base to provide other applications useful information like server-state example client-base.

This official module belongs to the organization server-state.