GithubHelp home page GithubHelp logo

zlacelle / nagios_check_zfs_linux Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 17.0 81 KB

Nagios plugin to check ZFS pool in the Linux environment

License: GNU General Public License v3.0

Python 100.00%

nagios_check_zfs_linux's People

Contributors

ahinrichs avatar cormoran96 avatar glemignot avatar quentinsch avatar reamer avatar s-fu avatar stewlg avatar zlacelle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nagios_check_zfs_linux's Issues

Two minor issues

Looks good so far.

Two minor issues:

  1. error message if sudo is missing. If sudo is not installed the script fails with "invalid pool"
  2. better locale support. The script fails if run with LANG=de_DE (e.g. comma as decimal delimiter) the script fails to parse some numbers:
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

Extended status/health checks

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.)

Release 2.0 does not support Python 3.5

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.

Why isn't nosudo the default?

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>

feature request: check all zpools present, rather than selecting one

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!

Migrating to Python3

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.