Cosium / zabbix_zfs-on-linux

zabbix template and user parameters to monitor zfs on linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nan with numfmt with vdev's

cstackpole opened this issue · comments

Greetings,
I've been successfully working with the configs from 12eecbf.

Adding a new host with ZFS. Decided to grab the latest template and config file. I was getting errors in the vdev data so I cranked the logging.

The command on the old host returned a command that looked something like this: /sbin/zpool status | grep "sda" | awk '{ print $3 }'which returned 0.

The command on the new host returned a command that looked something like this: /sbin/zpool status | grep "sda" | awk '{ print $3 }' | numfmt --from=si which returned 'nan'

It looks like numfmt returns nan anytime I pass it a 0. eg: echo 0 | numfmt --from=si or even echo 0 | numfmt

I think I get the point of converting the numbers when it returns something like 1M, but before I put something that catches nan to return 0 I thought I would ask if anyone else is seeing this issue. For the moment I'm just using the old config file and it seems to work.

Thoughts? Thanks!

Dratz.....
So I can replicate this on every version of RHEL 7.9 with coreutils-8.22-24.el7_9.2.x86_64 (which is the latest and all my boxes are updated).
I can not replicate this on any Ubuntu 20.04 (coreutils 8.30-3ubuntu2), Debian Buster (coreutils 8.30), nor RHEL 8 (coreutils-8.30-8.el8.x86_64). Unfortunately, I don't have access to anything else. It's either RHEL 7.9 or coreutils 8.30. 😆

So instead of trying to write weird code to support all of it, my suggestion is to just put a note in the README for those of us still stuck on RHEL7 for a while.

@cstackpole thank you for the bug report, I'm not sure how to handle this yet, maybe an if will do the job there.

The absence of the -p flag on old versions of the zpool command is definitively bothersome :-/

Did a lot of digging on this. Found that I could replicate this in some situations but not all. Finally reached out for help and it was pointed out to me that there was a bug in RHEL glibc that caused the issue. This fix is applied to the 7.9 hosts that work...and it fails on the 7.9 hosts that don't have this fix yet.
So I need to go on a patching spree (glibc is blocked from auto updates until we get to our rolling maintenance windows).

Should anyone else run into this issue, you need glibc-2.17-323.el7_9 or better.

This is not an issue for this project so I'm closing this. Thanks @AceSlash for your work on this Zabbix template. It is much appreciated.

@cstackpole : thank you for your deep analysis, I was having trouble to reproduce it, now I understand why :-)