Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Monitoring your ZFS root using monit
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: Monitoring your ZFS root using monit (Read 7686 times)
dcol
Hero Member
Posts: 635
Karma: 51
Re: Monitoring your ZFS root using monit
«
Reply #15 on:
January 15, 2023, 11:03:13 pm »
I have tried commenting the entire script and it still shows 'No such file or directory'
Must be something else.
Maybe there is a problem with the NonZeroStatus test. No other enabled Monit service uses that test.
[Update] I enabled gateway status check, which uses the NonZeroStatus test and it works fine. I am at a complete loss on this one.
«
Last Edit: January 15, 2023, 11:23:08 pm by dcol
»
Logged
SWEETGOOD
Newbie
Posts: 14
Karma: 1
Re: Monitoring your ZFS root using monit
«
Reply #16 on:
January 15, 2023, 11:22:59 pm »
Not very likely if you can't even execute the script using the command line. This has nothing to do with Monit at all.
Logged
dcol
Hero Member
Posts: 635
Karma: 51
Re: Monitoring your ZFS root using monit
«
Reply #17 on:
January 15, 2023, 11:27:01 pm »
There must be some issue with my OPNsense. I can execute the test.sh just fine in the same location. I have two other custom Monit scripts and they work fine.
Logged
SWEETGOOD
Newbie
Posts: 14
Karma: 1
Re: Monitoring your ZFS root using monit
«
Reply #18 on:
January 15, 2023, 11:49:13 pm »
My assumption still is that the error is caused by either wrong (invisible) characters in the bash file or by a wrong encoding.
If you can execute other files (with the same shebang at the top) just fine there MUST be an issue with this particular file.
Logged
dcol
Hero Member
Posts: 635
Karma: 51
Re: Monitoring your ZFS root using monit
«
Reply #19 on:
January 15, 2023, 11:59:37 pm »
Sure seems that way. I just copied the script from this thread and used notepad to save it to a file. Did the same with one of my other custom Monit tests.
Logged
cookiemonster
Hero Member
Posts: 1823
Karma: 95
Re: Monitoring your ZFS root using monit
«
Reply #20 on:
January 16, 2023, 12:11:27 am »
try to learn a bit about unixes/bsds dcol, it helps. Most of the errors you have posted are result of not being familiar with the way the OSs work.
For instance they are case sensitive. zfs-file.sh is not the same as ZFS-file.sh. The result is file/object not found.
Paths are important. If you try to find or run a file, the path has to be able to get to it. A period i.e, "." denotes the current location you are at.
The shebang in a script tells the OS which shell to use, so
Code:
[Select]
#! /bin/sh
at the beginning is important.
Do you have nano installed on OPN? Forget the windows editors, they introduce characters mostly for line endings that are different in unix and windows, and often a source of no end of problems. In this case I doubt is the problem but a) will help in the future, b) will take care of it if is the problem.
Code:
[Select]
pkg install nano
is to install it.
Once installed. Remove the file and recreate it as per the first post with nano, that allows you to paste into it.
Take it from there.
Logged
Print
Pages:
1
[
2
]
« previous
next »
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Monitoring your ZFS root using monit