Skip to content

valkey-status: using --ignore-thp true doesn't work? #898

Open
@chriscroome

Description

@chriscroome

This issue respects the following points:

Which variant of the Monitoring Plugins do you use?

  • .rpm/.deb package from repo.linuxfabrik.ch
  • Compiled for Linux from download.linuxfabrik.ch
  • Compiled for Windows from download.linuxfabrik.ch
  • Source Code from GitHub

Bug description

The ignore-thp option that the valkey-status plugin has always seems to return:

I/O error "No such file or directory" while opening or reading /sys/kernel/mm/transparent_hugepage/enabled

Irrespective of what it is set to?

Steps to reproduce - Plugin call

/usr/lib64/nagios/plugins/valkey-status --socket /run/valkey/valkey-server.sock --password XXX --ignore-thp

Steps to reproduce - Data

It is true that the directory and file doesn't exist:

ls -lah /sys/kernel/mm
total 0
drwxr-xr-x  6 root root 0 Jun 12 15:12 .
drwxr-xr-x 16 root root 0 Jun 12 15:12 ..
drwxr-xr-x  2 root root 0 Jun 12 15:12 ksm
drwxr-xr-x  2 root root 0 Jun 12 15:14 lru_gen
drwxr-xr-x  2 root root 0 Jun 12 15:14 numa
drwxr-xr-x  2 root root 0 Jun 12 15:14 swap

But the check doesn't appear to be disabled?

/usr/lib64/nagios/plugins/valkey-status --socket /run/valkey/valkey-server.sock --password XXX --ignore-thp
I/O error "No such file or directory" while opening or reading /sys/kernel/mm/transparent_hugepage/enabled

/usr/lib64/nagios/plugins/valkey-status --socket /run/valkey/valkey-server.sock --password XXX
I/O error "No such file or directory" while opening or reading /sys/kernel/mm/transparent_hugepage/enabled

Am I doing something wrong?

I'm not sure how to even create the file that can't be checked:

 echo never > /sys/kernel/mm/transparent_hugepage/enabled
-bash: /sys/kernel/mm/transparent_hugepage/enabled: No such file or directory

mkdir /sys/kernel/mm/transparent_hugepage
mkdir: cannot create directory ‘/sys/kernel/mm/transparent_hugepage’: Operation not permitted

I have updated /etc/default/grub to contain:

GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never"

and rebooted but that doesn't appear to make a difference.

How can the transparent_hugepage check be disabled?


### Environment

Debian Bookworm:

Linux 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux


### Plugin Version

v2025053001 by Linuxfabrik GmbH, Zurich/Switzerland

### Python version

Python 3.11.2

### List of Python modules


Please wait a moment while I gather a list of all available modules...

/usr/lib/python3/dist-packages/nltk/app/__init__.py:45: UserWarning: nltk.app.wordfreq not loaded (requires the matplotlib library).
  warnings.warn("nltk.app.wordfreq not loaded (requires the matplotlib library).")
/usr/lib/python3/dist-packages/nltk/twitter/__init__.py:20: UserWarning: The twython library has not been installed. Some functionality from the twitter package will not be available.
  warnings.warn(
/usr/lib/python3.11/pkgutil.py:92: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(info.name)
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
MySQLdb             ast                 iniparse            resolvelib
__future__          async_timeout       inspect             resource
__hello__           asynchat            io                  rfc3986
__phello__          asyncio             ipaddress           rfc3987
_abc                asyncore            itertools           rich
_aix_support        atexit              jc                  rlcompleter
_ast                attr                jinja2              runpy
_asyncio            attrs               jmespath            samba
_bisect             audioop             joblib              sched
_black_version      babel               json                secrets
_blake2             base64              jsonpointer         select
_bootsubprocess     bdb                 jsonschema          selectors
_bz2                binascii            jwt                 selinux
_cffi_backend       bisect              kerberos            setuptools
_codecs             black               keyword             shelve
_codecs_cn          blackd              ldb                 shlex
_codecs_hk          blib2to3            lib2to3             shutil
_codecs_iso2022     blinker             libcloud            signal
_codecs_jp          bracex              linecache           simplejson
_codecs_kr          bs4                 livereload          site
_codecs_tw          bson                locale              sitecustomize
_collections        builtins            lockfile            six
_collections_abc    bz2                 logging             smtpd
_compat_pickle      cProfile            lunr                smtplib
_compression        calendar            lxml                sndhdr
_contextvars        certifi             lzma                sniffio
_crypt              cgi                 mailbox             socket
_csv                cgitb               mailcap             socketserver
_ctypes             chardet             markdown            softwareproperties
_ctypes_test        charset_normalizer  markdown_it         soupsieve
_curses             chunk               markupsafe          spwd
_curses_panel       cli_helpers         marshal             sqlglot
_datetime           click               math                sqlite3
_dbm                cmath               mdurl               sqlparse
_dbus_bindings      cmd                 mergedeep           sre_compile
_dbus_glib_bindings code                mimetypes           sre_constants
_decimal            codecs              mkdocs              sre_parse
_distutils_hack     codeop              mmap                ssh_import_id
_distutils_system_mod collections         modulefinder        ssl
_elementtree        colorama            more_itertools      stat
_functools          colorsys            msgpack             statistics
_hashlib            commonmark          multiprocessing     string
_heapq              compileall          mycli               stringprep
_imp                concurrent          mypy_extensions     struct
_io                 configobj           nagiosplugin        subprocess
_json               configparser        neovim              subprocess_tee
_ldb_text           contextlib          netaddr             sunau
_locale             contextvars         netrc               symtable
_lsprof             copy                nis                 sys
_lzma               copyreg             nltk                sysconfig
_markupbase         crudini             nntplib             syslog
_md5                crypt               ntlm_auth           systemd
_multibytecodec     cryptography        ntpath              tabnanny
_multiprocessing    csv                 nturl2path          tabulate
_opcode             ctypes              numbers             talloc
_operator           curl                numpy               tarfile
_osx_support        curses              oauthlib            tdb
_pickle             dataclasses         opcode              telnetlib
_posixshmem         datetime            operator            tempfile
_posixsubprocess    dateutil            optparse            tenacity
_py_abc             dbm                 os                  terminaltables
_pydecimal          dbus                ossaudiodev         termios
_pyio               deb822              packaging           test
_pyrsistent_version debconf             passlib             textwrap
_pytest             debian              pathlib             this
_queue              debian_bundle       pathspec            threading
_random             decimal             pbr                 time
_ruamel_yaml        deprecated          pdb                 timeit
_selinux            difflib             pickle              tkinter
_sha1               dis                 pickletools         token
_sha256             distro              pip                 tokenize
_sha3               distutils           pipes               tomllib
_sha512             dns                 pipx                tornado
_signal             doctest             pkg_resources       tqdm
_sitebuiltins       email               pkgutil             trace
_socket             encodings           platform            traceback
_sqlite3            enrich              platformdirs        tracemalloc
_sre                ensurepip           plistlib            tty
_ssl                enum                pluggy              turtle
_stat               errno               poplib              types
_statistics         fail2ban            posix               typing
_string             faulthandler        posixpath           typing_extensions
_strptime           fcntl               pprint              ufw
_struct             filecmp             profile             unicodedata
_symtable           fileinput           prompt_toolkit      unittest
_sysconfigdata__linux_x86_64-linux-gnu filelock            pstats              uritemplate
_sysconfigdata__x86_64-linux-gnu fnmatch             psutil              urllib
_tdb_text           fractions           psycopg             urllib3
_testbuffer         ftplib              psycopg2            userpath
_testcapi           functools           pty                 uu
_testclinic         gc                  pvectorc            uuid
_testimportmultiple genericpath         pwd                 validate
_testinternalcapi   getopt              py                  venv
_testmultiphase     getpass             py_compile          wadllib
_thread             gettext             pyaes               warnings
_threading_local    ghp_import          pyclbr              watchdog
_tkinter            gi                  pycurl              wave
_tokenize           glob                pydoc               wcmatch
_tracemalloc        gpg                 pydoc_data          wcwidth
_typing             graphlib            pyexpat             weakref
_uuid               greenlet            pygments            webbrowser
_warnings           gridfs              pygtkcompat         webcolors
_weakref            grp                 pyinotify           webencodings
_weakrefset         gzip                pymongo             wheel
_xxsubinterpreters  h11                 pymysql             winrm
_xxtestfuzz         h2                  pynvim              wrapt
_yaml               hashlib             pyparsing           wsgiref
_zoneinfo           heapq               pyperclip           xdrlib
abc                 hmac                pyrsistent          xml
aifc                hpack               pytest              xmlrpc
ansible             html                pytz                xmltodict
ansible_compat      html5lib            queue               xxlimited
ansible_test        http                quopri              xxlimited_35
ansiblelint         httpcore            random              xxsubtype
antigravity         httplib2            re                  yaml
anyio               httpx               readline            yaml_env_tag
apt                 hyperframe          redis               yamllint
apt_inst            idna                regex               zipapp
apt_pkg             imaplib             reprlib             zipfile
aptsources          imghdr              requests            zipimport
argcomplete         imp                 requests_kerberos   zlib
argparse            importlib           requests_ntlm       zoneinfo
array               iniconfig           requests_toolbelt   

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

### Additional Information

_No response_

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions