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

Activating && or || depending on short DST result with different Error Levels for failing disks and empty slots #68

Open
Callistemon opened this issue Jan 22, 2022 · 2 comments
Assignees

Comments

@Callistemon
Copy link

I want to start automatic short self-tests every week, and launch a warning message with && or || if there are errors. At first, I was looking at smartctl, but that always returns an exit code of 0 as soon as the test begins, even if it completes with errors. It appeared openSeaChest provided this functionality, as there is a long list of exit codes including 3 for Operation Failure, but only --shortGeneric waits to send an exit code until finished, while --shortDST always activates && after starting. There should be a --shortDST option that waits to send an exit code until completion.

Both --shortDST and --shortGeneric activate || if a disk with the specified number is not connected. It's not practical to have failure warnings appear when a disk doesn't happen to be available at a specified number (such as PD4, which may be empty most of the time). I understand || is activated by anything above 0, so it will be activated even if the Error Code for failing and unavailable disks is different, but echo %ErrorLevel% shows that 3 is the Error Code for an empty slot, so it is the same Error Code as when disks fail with errors, assuming Error Code 3 is even used for failed tests.

@vonericsen
Copy link
Contributor

Short generic is a read test so it has to wait until completion since the software is managing the entire thing.
Short DST is a drive managed test and the software starts it and can optionally poll it for progress. If you run --shortDST --poll it will wait until the test has completed and then return the exit code based off of the full operation.

I don't think openSeaChest has a way to detect a difference between "drive not found" and "failure". I'll look into it and see if that is something that can be added.

@Callistemon
Copy link
Author

Short DST is a drive managed test and the software starts it and can optionally poll it for progress. If you run --shortDST --poll it will wait until the test has completed and then return the exit code based off of the full operation.

Great! That's exactly what I wanted.

I don't think openSeaChest has a way to detect a difference between "drive not found" and "failure". I'll look into it and see if that is something that can be added.

I just looked at the list of Error Levels again, and an unavailable handle is supposed to be Exit Code 2. However, it is 3, which is for operation failure (in this case, short DST failure).

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

3 participants