server-state / linux-raid-module Goto Github PK
View Code? Open in Web Editor NEWA module to view the current active raids based on /proc/mdstat generated by the linux-raid kernel module.
License: MIT License
A module to view the current active raids based on /proc/mdstat generated by the linux-raid kernel module.
License: MIT License
Rewrite of fs mock logic for more complex data structures.
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.
In
linux-raid-module/src/index.js
Line 32 in 8dec726
the defaultOptions
get overwritten, as the empty object as first argument in Object.assign
is missing. This could get solved with something along the lines of
options = Object.assign({}, defaultOptions, options);
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.
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.
Move compilation to npm run build
via a webpack plugin, e.g., https://www.npmjs.com/package/pegjs-loader, and import it directly. This allows for easy iteration, compilation and maintainability.
It might be useful to add an option to filter the partitions whose data gets returned.
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 ๐ )
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"
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.