zlacelle / nagios_check_zfs_linux Goto Github PK
View Code? Open in Web Editor NEWNagios plugin to check ZFS pool in the Linux environment
License: GNU General Public License v3.0
Nagios plugin to check ZFS pool in the Linux environment
License: GNU General Public License v3.0
Looks good so far.
Two minor issues:
Traceback (most recent call last):
File "./check_zfs.py", line 260, in <module>
sizeGB = ConvertToGB(size)
File "./check_zfs.py", line 74, in ConvertToGB
gigs=float(value)*1024
ValueError: invalid literal for float(): 8,12
Without further knowledge of the intended scope of this script, here are some ideas for additional checks regarding the health of the zpools:
So basically it would be nice to get a warning if zpool status
shows anything unusual. (I admit that might be hard to generalize, I think I try a simple regex solution first.)
The code checks for Python 3.5, but that version actually does not work, as the f-strings are used, which require Python 3.6. This effectively drops support for Ubuntu 16.04 (which has reached "end of standard support").
There are only 3 places where f-strings are used, which could be replaced, otherwise the version check should probably test for Python 3.6.
Hi,
I noticed that on Proxmox all users can run zfs commands. Is that also the case for other systems? Are there any reasons to avoid running the commands as an unprivileged user?
If sudo is required, I would also suggest being more restrictive in the suggestions you include in README. Something like this seems to be enough and doesn't grant access to any dangerous zfs commands:
<user> ALL=(ALL) NOPASSWD: /sbin/zfs list
<user> ALL=(ALL) NOPASSWD: /sbin/zpool list <pool>
<user> ALL=(ALL) NOPASSWD: /sbin/zfs get compression <pool>
<user> ALL=(ALL) NOPASSWD: /sbin/zfs get compressratio <pool>
are there any plans to support an argument to check any zpools present? the use case i'm concerned about handling is adding a pool to a system, monitoring not being updated immediately, and losing a disk. being able to run check_zfs --allpools means any zpools present will report degradation, even if the pools are brand new, inherited during failover, etc.
thanks for the plugin!
Running the script with python3 yields errors, probably due to minor things like print
statements.
Since python2 is not installed by default anymore on modern distros, and will soon be EOL, this would benefit from being ported to python 3.
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.