[Gearman] Timeout shows RC 255 and full command (password exposed)
Posted: Wed Jun 25, 2025 10:20 am
Hi everyone,
Not 100% sure if this is a Nagios XI or a Nagios Core issue.
I’m seeing an odd combination of return-code 255 and full-command echo when a check times out, and the command line contains a clear-text password.
I’m running a distributed check setup with Nagios Core 4.5.3 on the master using Mod Gearman:
Environment
A service check that ultimately calls NCPA + a custom plugin sometimes exceeds its internal timeout.
Timeout settings
The problem is that the entire command line is echoed back, including the -p argument that contains a production password (expanded from a $USER macro). Exposing credentials in plain text is a security concern.
What I’ve tried / know so far
Thanks in advance!
Not 100% sure if this is a Nagios XI or a Nagios Core issue.
I’m seeing an odd combination of return-code 255 and full-command echo when a check times out, and the command line contains a clear-text password.
I’m running a distributed check setup with Nagios Core 4.5.3 on the master using Mod Gearman:
Environment
- Nagios Core 4.5.3 (single master)
- mod-gearman NEB: 1.0.1 on the master
- mod-gearman worker: 3.3.0 on a separate node
- NCPA 2.4.4 on the target host, launching a custom Bash wrapper → pytest → Selenium
A service check that ultimately calls NCPA + a custom plugin sometimes exceeds its internal timeout.
Timeout settings
- nagios.cfg service_check_timeout = 60 s
- worker.conf job_timeout = 60 s (I know this is supposed to affect only event-handlers)
- Plugin invoked with -T 59 s (internal timeout)
Code: Select all
CRITICAL: Return code of 255 is out of bounds. (worker: <worker-host>)
Error: Plugin command (/bin/sh /usr/local/ncpa/plugins/launcher_test_az.sh -n Argument -h xvfb -u User -p Password -T 59) timed out. (59 sec)What I’ve tried / know so far
- job_timeout in worker.conf is also 60 s, but docs say it only affects event-handlers.
- Changing timeout_return alters the exit code, but the worker still prints the full command.
- Yes, I could refactor the plugin to read the password from a file or env-var, but I’d prefer a Gearman-side fix.
- Is there a worker.conf option (or patch) that suppresses or sanitises the command the worker prints when it times out?
- If not, has anyone found a workaround besides rewriting the plugin (e.g. show_error_output=no)?
- Could upgrading from mod-gearman to nagios-mod-gearman in the workers solve this problem?
- Would upgrading the NEB module to a newer nagios-mod-gearman release change this behaviour?
Thanks in advance!