damicon / zfswatcher Goto Github PK
View Code? Open in Web Editor NEWZFS pool monitoring and notification daemon
License: GNU General Public License v3.0
ZFS pool monitoring and notification daemon
License: GNU General Public License v3.0
I've been receiving alerts for 85% and 90% thresholds where the zpool information returned from the OS was 83% and 88%. Looking through the source, it seems as though this is a discrepancy between the "Free" and "Avail" reported by both methods.
This is ZoL 0.6.2 on CentOS.
Hello Developers.
I hope contribute with the code refinement
I had an error when starting zfswatcher,
The log file explains by itself
Thank you all
2020-10-01 20:38:17 [info] zfswatcher starting 2020-10-01 20:38:17 [crit] invalid line 11 in status output: remove: Removal of vdev 0 copied 552G in 2h27m, completed on Mon Aug 24 05:40:45 2020 > pool: backup_servers > state: ONLINE >status: One or more devices has experienced an unrecoverable error. An > attempt was made to correct the error. Applications are unaffected. >action: Determine if the device needs to be replaced, and clear the errors > using 'zpool clear' or replace the device with 'zpool replace'. > see: http://zfsonlinux.org/msg/ZFS-8000-9P > scan: scrub in progress since Thu Oct 1 19:03:39 2020 > 315G scanned at 56.8M/s, 215G issued at 38.8M/s, 716G total > 36K repaired, 30.02% done, 0 days 03:40:32 to go >remove: Removal of vdev 0 copied 552G in 2h27m, completed on Mon Aug 24 05:40:45 2020 > 7.21M memory used for removed device mappings >config: > > NAME STATE READ WRITE CKSUM > backup_servers ONLINE 0 0 0 > mirror-1 ONLINE 0 0 0 > ata-ST1000DM003-1CH162_S1DGGSXD ONLINE 0 0 0 > ata-SAMSUNG_HD103SJ_S2NWJ50B351535 ONLINE 1 0 3 (repairing) > >errors: No known data errors > > pool: dpool > state: ONLINE > scan: scrub in progress since Thu Oct 1 19:03:49 2020 > 308G scanned at 55.6M/s, 288G issued at 52.1M/s, 388G total > 0B repaired, 74.37% done, 0 days 00:32:33 to go >config: > > NAME STATE READ WRITE CKSUM > dpool ONLINE 0 0 0 > mirror-0 ONLINE 0 0 0 > ata-SAMSUNG_HD154UI_S240J50B101993-part3 ONLINE 0 0 0 > ata-SAMSUNG_HD154UI_S240J50B712198-part3 ONLINE 0 0 0 > >errors: No known data errors > > pool: vpool > state: ONLINE > scan: scrub in progress since Thu Oct 1 19:03:56 2020 > 938G scanned at 170M/s, 655G issued at 118M/s, 2.14T total > 0B repaired, 29.92% done, 0 days 03:40:56 to go >config: > > NAME STATE READ WRITE CKSUM > vpool ONLINE 0 0 0 > ata-ST3000VX000-1ES166_Z501YC0L ONLINE 0 0 0 > >errors: No known data errors 2020-10-01 20:38:17 [crit] exiting, parsing ZFS status failed 2020-10-01 20:38:17 [info] zfswatcher stopping
And the zpool status output
# zpool status pool: backup_servers state: ONLINE status: One or more devices has experienced an unrecoverable error. An attempt was made to correct the error. Applications are unaffected. action: Determine if the device needs to be replaced, and clear the errors using 'zpool clear' or replace the device with 'zpool replace'. see: http://zfsonlinux.org/msg/ZFS-8000-9P scan: scrub in progress since Thu Oct 1 19:03:39 2020 352G scanned at 51,5M/s, 252G issued at 36,9M/s, 716G total 36K repaired, 35,22% done, 0 days 03:34:53 to go remove: Removal of vdev 0 copied 552G in 2h27m, completed on Mon Aug 24 05:40:45 2020 7,21M memory used for removed device mappings config: NAME STATE READ WRITE CKSUM backup_servers ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 ata-ST1000DM003-1CH162_S1DGGSXD ONLINE 0 0 0 ata-SAMSUNG_HD103SJ_S2NWJ50B351535 ONLINE 1 0 3 (repairing) errors: No known data errors pool: dpool state: ONLINE scan: scrub in progress since Thu Oct 1 19:03:49 2020 356G scanned at 52,0M/s, 337G issued at 49,3M/s, 388G total 0B repaired, 86,96% done, 0 days 00:17:29 to go config: NAME STATE READ WRITE CKSUM dpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 ata-SAMSUNG_HD154UI_S240J50B101993-part3 ONLINE 0 0 0 ata-SAMSUNG_HD154UI_S240J50B712198-part3 ONLINE 0 0 0 errors: No known data errors pool: vpool state: ONLINE scan: scrub in progress since Thu Oct 1 19:03:56 2020 1,03T scanned at 154M/s, 793G issued at 116M/s, 2,14T total 0B repaired, 36,26% done, 0 days 03:24:51 to go config: NAME STATE READ WRITE CKSUM vpool ONLINE 0 0 0 ata-ST3000VX000-1ES166_Z501YC0L ONLINE 0 0 0 errors: No known data errors
Not really sure this is a zfswatcher problem, but OpenZFS on rasbian does not have a "status:" line in the zpool status command, so zfswatcher exits with a crit error. Here is log file:
2015-03-27 22:39:39 [info] zfswatcher starting
2015-03-27 22:39:40 [crit] invalid line 3 in status output: scrub: none requested
pool: data
state: ONLINE
scrub: none requested
config:NAME STATE READ WRITE CKSUM
data ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
disk/by-id/ata-Hitachi_HTS725032A9A360_110214PCJL00GLGU26WJ ONLINE 0 0 0
disk/by-id/ata-WDC_WD3200BEVT-26A23T0_WD-WXN1A8017896 ONLINE 0 0 0errors: No known data errors
2015-03-27 22:39:40 [crit] exiting, parsing ZFS status failed
2015-03-27 22:39:40 [info] zfswatcher stopping
There’s a minor problem in that if you:
I'm trying to configure a new zfswatcher installation but can't get it to send any emails. I'm sure my config file is faulty, but I can't figure out what. The problem is I cannot find any error messages or even any indication that zfswatcher is attempting to send any email. (I did set enable="true" in that section, then triggered critical events that get picked up correctly in zfswatcher.log.) If there's a way to get such debug info, please consider this a doc request. If not, consider this a feature request.
Zfswatcher looks like exactly the tool I was looking for, but without emails it's not much use!
Do you think you will develop the statistics page at some point, or is the project on hold?
Regards,
A happy user
Hello,
I can't compile thesource code on ZFSGuru(freebsd 9.2-001),
I have installed the Go lang & can run the hello world test program...
I got this:
GOPATH=pwd
/golibs /usr/local/go/bin/go build -o zfswatcher
osutil_freebsd.go:41: cannot convert unsafe.Pointer(&buf[0]) (type unsafe.Pointer) to type syscall.Timeval
osutil_freebsd.go:41: invalid indirect of syscall.Timeval(unsafe.Pointer(&buf[0])) (type syscall.Timeval)
osutil_freebsd.go:43: not enough arguments in call to time.Unix
*** [zfswatcher] Error code 2
Stop in /tmp/zfswatcher.
Also when I try to type 'go install' I get:
setup.go:25:2: cannot find package "code.google.com/p/gcfg" in any of:
/usr/local/go/src/pkg/code.google.com/p/gcfg (from $GOROOT)
/root/go/src/code.google.com/p/gcfg (from $GOPATH)
webserver.go:26:2: cannot find package "github.com/abbot/go-http-auth" in any of:
/usr/local/go/src/pkg/github.com/abbot/go-http-auth (from $GOROOT)
/root/go/src/github.com/abbot/go-http-auth (from $GOPATH)
leds.go:27:2: cannot find package "github.com/damicon/zfswatcher/notifier" in any of:
/usr/local/go/src/pkg/github.com/damicon/zfswatcher/notifier (from $GOROOT)
/root/go/src/github.com/damicon/zfswatcher/notifier (from $GOPATH)
setup.go:29:2: cannot find package "github.com/ogier/pflag" in any of:
please advice.
Thanks a lot,
Michael
Thanks for this great utility, I've been using it with the built-in web server on an alternate port but now trying to move it to a named virtual host but struggling to find the correct DocumentRoot. I'm pointing the DocumentRoot to /usr/share/zfswatcher/www but only getting the directory listing.
My config in /etc/apache2/sites-enabled/zfswatcher.conf:
<VirtualHost *>
DocumentRoot "/usr/share/zfswatcher/www"
ServerName zfswatcher
Options FollowSymLinks
AllowOverride None
<Directory "/usr/share/zfswatcher/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
Where should this be pointed? Thanks.
After following https://github.com/zfsonlinux/zfs/wiki/Debian to install zfs and then went to install
zfs watcher with the provided .deb file i get this issue
➜ Downloads sudo apt install zfs-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
zfs-dkms is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
zfswatcher : Depends: zfs but it is not installable or
ubuntu-zfs but it is not installable or
debian-zfs but it is not installable
Recommends: ledmon but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
OS: Debian GNU/Linux 8.7 (jessie) x86_64
Kernel: 3.16.0-4-amd64
Hi Just wnated to share a CRUX port I've put together for ``zfswatcher:
# Description: ZFS pool monitoring and notification daemon
# URL: http://zfswatcher.damicon.fi/
# Maintainer: ames Mills, prologic at shortcircuit dot net dot au
#
# Depends on: go
name=zfswatcher
version=0.03
release=1
source=(http://shortcircuit.net.au/~prologic/distfiles/$name-$version.tar.gz)
build() {
cd $name-$version
# Fix go path
sed -i -e 's|/usr/local/go/bin/go|/usr/bin/env go|g' Makefile
make
make DESTDIR=$PKG install
# Fix man paths
mv $PKG/usr/share/man $PKG/usr
}
Note the sed
and mv
hacks I had to do? Perhaps these could be configurable if not already?
Just wondering whether you've tried to run this Dockerized at all and if that worked? I imagine you'd have to run it as a "privileged" container with ledctl
and zfs
installed in the container's image?
I really like your work, and was wondering if you are going to continue to develop more on the web interface. Despite the new zfs-zed module, I think a lot of us are missing a web interface with more info, logs, statistics, etc.
I have zfswatcher's web service listening on 127.0.0.1:28372, with Apache mod_proxy catching at http://server/zfswatcher and sending requests through to the zfswatcher service. This is primarily for security (SSL, etc).
At the moment, the only way to achieve this is by editing the templates in /usr/share/zfswatcher/www/templates; and prefixing "/zfs" to all the URLs. While this works fine for my, I figured others might be doing something similar.
It would be great if we could have an option in zfswatcher.conf, perhaps called something like "webroot", which specifies the prefix/directory the web service should use.
There doesn't seem to be (unless I'm mistaken) a way to configure zfswatcehr
to use a sendmail compatible binary for email notifications. e.g: esmtp
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.