Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help output generated by -h, --help flag is sent to stderr, probably should go to stdout instead #555

Closed
atc0005 opened this issue Dec 8, 2021 · 0 comments · Fixed by #560
Assignees
Labels
bug Something isn't working config
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Dec 8, 2021

While defining a new command for a Nagios XI system today I noticed an option to pick from an Available Plugins list. When I selected an official plugin from the list its help output was shown:

image

Selecting plugins from this project resulted in an empty text block being shown:

image

When testing via CLI:

$ /usr/local/nagios/libexec/check_users --help 2> /dev/null
check_users v2.3.3 (nagios-plugins 2.3.3)
Copyright (c) 1999 Ethan Galstad
Copyright (c) 2000-2014 Nagios Plugin Development Team
        <devel@nagios-plugins.org>

This plugin checks the number of users currently logged in on the local
system and generates an error if the number exceeds the thresholds specified.


Usage:
check_users -w <users> -c <users>

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 --extra-opts=[section][@file]
    Read options from an ini file. See
    https://www.nagios-plugins.org/doc/extra-opts.html
    for usage and examples.
 -w, --warning=INTEGER
    Set WARNING status if more than INTEGER users are logged in
 -c, --critical=INTEGER
    Set CRITICAL status if more than INTEGER users are logged in

Send email to help@nagios-plugins.org if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
devel@nagios-plugins.org

$

Plugins from this project (and likely others that I maintain) send their output to stderr by default:

$ /usr/local/nagios/libexec/check_vmware_datastore --help 2> /dev/null
$

I'll need to check the official plugin guidelines to see if it indicates where help output should be sent. Based on the results shown above, I expect it will indicate stdout is the valid target.

@atc0005 atc0005 added bug Something isn't working config labels Dec 8, 2021
@atc0005 atc0005 added this to the Future milestone Dec 8, 2021
@atc0005 atc0005 self-assigned this Dec 8, 2021
@atc0005 atc0005 modified the milestones: Future, v0.28.0 Dec 9, 2021
atc0005 added a commit that referenced this issue Dec 17, 2021
Send output to stdout so that Nagios XI (and presumably similar
systems) can poll plugins from this project for their help
output and display within the admin web UI.

refs GH-555
atc0005 added a commit that referenced this issue Dec 17, 2021
Send output to stdout so that Nagios XI (and presumably similar
systems) can poll plugins from this project for their help
output and display within the admin web UI.

refs GH-555
@atc0005 atc0005 modified the milestones: v0.28.0, v0.27.1 Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant