Coder Social home page Coder Social logo

server-state / linux-raid-module Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 5.39 MB

A module to view the current active raids based on /proc/mdstat generated by the linux-raid kernel module.

License: MIT License

JavaScript 81.88% PEG.js 18.12%
linux server-state module official raid official-module linux-raid

linux-raid-module's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar pklaschka avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

linux-raid-module's Issues

Parser do not recognize more activity types

The current parser do not recognize the activity type check:
Output of /proc/mdstat:

Personalities : [raid1] [raid0] [linear] [multipath] [raid6] [raid5] [raid4] [raid10] 
md125 : active raid0 md126[1] md127[0]
      7813301248 blocks super 1.2 512k chunks
      
md126 : active raid1 sdd1[1] sdc1[0]
      3906783040 blocks super 1.2 [2/2] [UU]
      [>....................]  check =  0.1% (7209856/3906783040) finish=348.0min speed=186728K/sec
      bitmap: 0/30 pages [0KB], 65536KB chunk

md127 : active raid1 sda1[1] sdb1[0]
      3906783040 blocks super 1.2 [2/2] [UU]
      [>....................]  check =  0.9% (35327488/3906783040) finish=352.4min speed=183050K/sec
      bitmap: 0/30 pages [0KB], 65536KB chunk

unused devices: <none>

Current JSON output:

{
   "personalities": [
      "raid1",
      "raid0",
      "linear",
      "multipath",
      "raid6",
      "raid5",
      "raid4",
      "raid10"
   ],
   "raids": [
      {
         "name": "md125",
         "state": "active",
         "access": "rw",
         "type": "raid0",
         "devices": [
            {
               "name": "md126",
               "index": 1,
               "status": "active"
            },
            {
               "name": "md127",
               "index": 0,
               "status": "active"
            }
         ],
         "blocks": 7813301248,
         "parameters": "super 1.2 512k chunks",
         "options": []
      },
      {
         "name": "md126",
         "state": "active",
         "access": "rw",
         "type": "raid1",
         "devices": [
            {
               "name": "sdd1",
               "index": 1,
               "status": "active"
            },
            {
               "name": "sdc1",
               "index": 0,
               "status": "active"
            }
         ],
         "blocks": 3906783040,
         "parameters": "super 1.2",
         "ideal": 2,
         "current": 2,
         "options": [
            {
               "type": "unknown",
               "value": "[>....................]  check =  0.1% (7209856/3906783040) finish=348.0min speed=186728K/sec"
            },
            {
               "type": "bitmap",
               "usedPages": 0,
               "totalPages": 30,
               "sizePages": 0,
               "chunkSize": 65536
            }
         ]
      },
      {
         "name": "md127",
         "state": "active",
         "access": "rw",
         "type": "raid1",
         "devices": [
            {
               "name": "sda1",
               "index": 1,
               "status": "active"
            },
            {
               "name": "sdb1",
               "index": 0,
               "status": "active"
            }
         ],
         "blocks": 3906783040,
         "parameters": "super 1.2",
         "ideal": 2,
         "current": 2,
         "options": [
            {
               "type": "unknown",
               "value": "[>....................]  check =  0.9% (35327488/3906783040) finish=352.4min speed=183050K/sec"
            },
            {
               "type": "bitmap",
               "usedPages": 0,
               "totalPages": 30,
               "sizePages": 0,
               "chunkSize": 65536
            }
         ]
      }
   ]
}

Please remove the unkown tag and add check to activity type in the parser.

pegjs parser do not recognize delayed resync activity

The status file /proc/mdstat shows a different option line comparable to the activity line, but without any progress.

Personalities : [raid1] 
md1 : active raid1 sdb8[1] sdb7[0]
      20954112 blocks super 1.2 [2/2] [UU]
        resync=DELAYED

unused devices: <none>

This can be reproduced by idling the sync action of the array:
echo "idle" > /sys/block/md1/md/sync_action

Currently the parser do not recognize this feature and assign to the unknown option.

JSON Output:

{
   "personalities": [
      "raid1"
   ],
   "raids": [
      {
         "name": "md1",
         "state": "active",
         "access": "rw",
         "type": "raid1",
         "devices": [
            {
               "name": "sdb8",
               "index": 1,
               "status": "active"
            },
            {
               "name": "sdb7",
               "index": 0,
               "status": "active"
            }
         ],
         "blocks": 20954112,
         "parameters": "super 1.2",
         "ideal": 2,
         "current": 2,
         "options": [
            {
               "type": "unknown",
               "value": "resync=DELAYED"
            }
         ]
      }
   ]
}

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating jest in /package-lock.json:
404 Not Found - GET https://registry.npmjs.org/jest-validate/-/jest-validate-25.2.6.tgz

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Option to filter results

It might be useful to add an option to filter the partitions whose data gets returned.

(Possible?) Use Case

In company X, there are two groups of users of their server-state instance. Designers, who use the RAID for project files, and administrators, who have full control over the servers.

To simplify usage for designers, the linux-raid-module allows filtering the data returned server-side. With a simple configuration like

server.addModule('raid-designer', raid, ['partition 1'])
server.addModule('raid-admin', raid);

designers only get shown partition 1, which is the one they care about, while admins still get all the information they need. Furthermore, this enhances security as information about the server architecture can remain on a need-to-know basis (for whatever that's worth ๐Ÿ˜‰ )

Refractoring of options output

Another structure of the parsed JSON output for the options attribute, for example:

         "options": {
            "activity": {
               "activityType": "recovery",
               "progress": 74.4,
               "processed": 15600512,
               "total": 20954112,
               "finish": 3.2,
               "speed": 27496
            },
            "bitmap": {
               "attr1": "value1"
            }
         }

Notes:

  • The options attribute is always given and an object.
  • Options are unique through attribute name.
  • Missing options are not listed.

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.