ceph / ceph-nagios-plugins

Nagios plugins for Ceph
Apache License 2.0
81 stars 80 forks source link

check_ceph_df: `TypeError: a bytes-like object is required, not 'str'` #70

Closed lorenzbausch closed 3 years ago

lorenzbausch commented 3 years ago

When monitoring a specific pool with check_ceph_df the following error is thrown:

$ ./check_ceph_df --pool rbd -C 70 -W 50
Traceback (most recent call last):
  File "/usr/lib64/nagios/plugins/ceph-nagios-plugins/check_ceph_df", line 231, in <module>
    sys.exit(main())
  File "/usr/lib64/nagios/plugins/ceph-nagios-plugins/check_ceph_df", line 136, in main
    if args.pool in line:
TypeError: a bytes-like object is required, not 'str'
$ /usr/bin/env python -V
Python 3.6.8

I worked around this by modifying line 136:

# before
if args.pool in line:

# after
if args.pool in str(line):

Not sure if this an appropriate fix - if so, I can open a PR to fix this issue.

valerytschopp commented 3 years ago

Feel free to open a PR