The question of ZED, and bash #409
Replies: 4 comments 4 replies
-
I've rewritten a couple of bash scripts in PowerShell in my time and, honestly, it's something AI is great at—so long as you check its work, of course. I did mine with GitHub Copilot, but ChatGPT should also do a fine job at the bulk of translating. |
Beta Was this translation helpful? Give feedback.
-
Well, real basic port exists and example of script structure. Still needs cleaning up to be useful. https://github.com/openzfsonwindows/openzfs/tree/zed/cmd/zed/os/windows/zed.d |
Beta Was this translation helpful? Give feedback.
-
What intro / HOWTO would anyone recommended to learn about setting up and using ZED on a genuine platform? (I think it's Linux) Found a few pages: The first page looks pretty simple. The second one seems to be pretty complicated (and tied to the ntfy software). The 3rd one contains some nice insights, but doesn't seem to be complete. |
Beta Was this translation helpful? Give feedback.
-
Outline of work: zed uses syslog on Unix to store events permanently, so you can look up what went wrong, and when. Windows version needs to do something similar, which probably means plugging into Event Viewer system. The installer can take care of the Registry node needed, and the zedlets can use Write-EventLog to put messages in there. We can pop up toast notifications, probably based on the level (critical? warning?) Following the general layout of Unix zedlets is a good idea. You can see all-debug.sh and all-debug.ps1 look similar, does the same include of zed.rc, and zed-functions.ps1. and so on.. |
Beta Was this translation helpful? Give feedback.
-
Watching the OpenZFS User Summit, it reminded me that we should be better at alerting the user to faults, which we currently do not do.
So it is time to port
zed
over, to handle that for us. The biggest thing there is that all the fault scripts are written in bash.It is probably possible to get bash scripts to run, but it wouldn't be pretty and have somewhat large install requirements. Either cygwin, or Ming, or perhaps WSL.
ChatGPT did point out that perhaps using Powershell (PS1) is a better fit, since I can link
zed
against PowerShell 5.1, which comes with Windows 7 and up. (There is PowerShell 7, but that is a separate install, and honestly the zed scripts probably do not need any new features in there).It would mean our own copies of the bash scripts for Windows. These scripts aren't particularly complicated, they generally just pull out the ENV vars, pop up notifications or send emails.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions