Automated Diagnostics File Gathering Script


Recommended Posts

TBH I have no idea. I am reacting to the conversation above. I have no idea how the Powedown Plugin works.

 

However, if I was to speculate, I would imagine the Plugin monitors for a "Power Button Press" event somehow. If this is right (and again this is speculation) the grab of the diagnostics zip file could be the "first thing" it does before initiating a shut down?

Link to comment

It doesn't monitor anything. That's already handled by base linux functionality. It hooks into /etc/rc.d/rc.local_shutdown via the following line inside that file:

 

[ -x /etc/rc.d/rc.unRAID ] && /etc/rc.d/rc.unRAID stop

 

The file /etc/rc.d/rc.local_shutdown is hooked in via /etc/rc.d/rc.6 (also symlinked from /etc/rc.d/rc.0) and  also /etc/rc.d/rc.K .

 

 

 

 

Link to comment

TBH I have no idea. I am reacting to the conversation above. I have no idea how the Powedown Plugin works.

 

However, if I was to speculate, I would imagine the Plugin monitors for a "Power Button Press" event somehow. If this is right (and again this is speculation) the grab of the diagnostics zip file could be the "first thing" it does before initiating a shut down?

 

The powerdown plugin hooks to power and shutdown events - webgui powerdown event, UPS shutdown, power button press, control-alt-delete, and cli commands.  Each of these events initiates the powerdown plugin script.

 

I would think the best time to capture the diagnostics is before any shutdown process starts.  The state of unraid should be captured while it is running as any process shutdown would possibly clear the problem and not provide the actual state of unraid when the problem occurred.  For example if there is a smb issue causing a hang up and smb is shutdown before the diagnostics is run, the smb issue would probably be cleared.

 

I will take a look at the powerdown plugin code and the diagnostics script and see if I can come up with a solution.

Link to comment

If everyone thinks this is best off in the powerdown plugin then I guess I can contact dlandon. It could be as simple as just executing the script when the button press is captured?

 

I am surprised that there seems to be consensus for this though as I would like to point out that this does NOT deal with the case of a lockups / resets etc.

I didn't see it as a consensus for an alternative, just another good idea.  And while I like the idea, it doesn't replace yours, because Powerdown only works if you still have control.  If the system has crashed or completely locked up, it's too late, you may only be able to power off manually.  A tail on the console and your constant diagnostics gathering are the only ways I know of to capture the last info a dying system can give.  Especially when it's one of those cases where everything appears to be working fine, nothing in the logs, and without warning it crashes hard, leaving no clues.

Link to comment

I didn't mean to exclusively say what you've done should only be in the PowerDown Script. I just believe as we all strive to make our machines more and more automated and user friendly it just made sense as a good Fail Safe place in case of a problem since things are shutting down and it would be nice to know what the heck happened to cause the shutdown and have a log for it.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.