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

unexpected visible log output in Icingaweb2 #314

Closed
Byolock opened this issue Aug 30, 2021 · 5 comments · Fixed by #324
Closed

unexpected visible log output in Icingaweb2 #314

Byolock opened this issue Aug 30, 2021 · 5 comments · Fixed by #324
Assignees
Labels
documentation Improvements or additions to documentation output/logging
Milestone

Comments

@Byolock
Copy link

Byolock commented Aug 30, 2021

When a service reaches warning or critical state, the log output gets visible in icingaweb2 :

grafik

I wondered if it was expected and simply set the log level to fatal instead of info as a workaround, but based on this text it seems like it's not expected :

Logging is enabled at the info level.

this output is sent to stderr by default, which Nagios ignores
this output is only seen (at least as of Nagios v3.x) when invoking the plugin directly via CLI (often for troubleshooting)

Unfortunately, I wasn't able to find information on how Icinga2 / Icingaweb2 differs from Nagios v3.x in this regard.
Do you recommend to just stay on log level fatal or do you want to develop a fix? I will provide any useful info I can in case you need some.

@atc0005 atc0005 self-assigned this Aug 30, 2021
@atc0005 atc0005 added this to the Next Release milestone Aug 30, 2021
@atc0005 atc0005 added documentation Improvements or additions to documentation output/logging labels Aug 30, 2021
@atc0005
Copy link
Owner

atc0005 commented Aug 30, 2021

Thanks for the report. Most of my experience has been with Nagios Core (v3 mostly, v4 recently) and only a small exposure to Nagios XI. While Icinga has been on my list to try, I've not used it.

Nagios doesn't use stderr, so at a very basic level I relied on that across all plugins in the project (and others based on the same logic) to use stderr as a way of emitting details useful for troubleshooting.

I don't believe that fatal is used at present (though the option is valid), so using that is probably a good choice for your environment (depending on how the web UI for Icinga displays the details). However if you don't want any output emitted at all, try passing disabled for the log-level flag.

Does this accomplish what you're looking to do?

@Byolock
Copy link
Author

Byolock commented Aug 30, 2021

Yes that's fine I'll simply put the log level in the command template. Can be closed if you want.

@atc0005
Copy link
Owner

atc0005 commented Aug 30, 2021

@Byolock: Yes that's fine I'll simply put the log level in the command template. Can be closed if you want.

Thanks for the feedback, and for giving this project a try.

I'll close after a bit, but in the meantime will try to think of a way to convey setting --log-level "disabled" for Icingaweb2 use.

atc0005 added a commit that referenced this issue Sep 16, 2021
Until recently, emitting plugin logging details to `stderr`
was seen as a safe approach. `stdout` is processed by Nagios
and used to generate notifications, web UI details, etc. Output
to `stderr` by default was intended to make troubleshooting
plugin operation easier for sysadmins.

After receiving a report from @Byolock, I learned that Icinga
Web 2 displays `stderr` output within the web UI mixed in with
`stdout`. This is undesirable.

This commit attempts to make both the original intent and
potential problems clearer along with providing a workaround
for the command definitions for plugins in this project:

--log-level "disabled"

refs GH-314
refs GH-323
@atc0005
Copy link
Owner

atc0005 commented Sep 16, 2021

Spun off separate discussion item here for potential long-term changes:

atc0005 added a commit that referenced this issue Sep 16, 2021
Until recently, emitting plugin logging details to `stderr`
was seen as a safe approach. `stdout` is processed by Nagios
and used to generate notifications, web UI details, etc. Output
to `stderr` by default was intended to make troubleshooting
plugin operation easier for sysadmins.

After receiving a report from @Byolock, I learned that Icinga
Web 2 displays `stderr` output within the web UI mixed in with
`stdout`. This is undesirable.

This commit attempts to make both the original intent and
potential problems clearer along with providing a workaround
for the command definitions for plugins in this project:

--log-level "disabled"

refs GH-314
refs GH-323
@atc0005
Copy link
Owner

atc0005 commented Sep 16, 2021

@Byolock: Yes that's fine I'll simply put the log level in the command template. Can be closed if you want.

Thanks for the feedback, and for giving this project a try.

I'll close after a bit, but in the meantime will try to think of a way to convey setting --log-level "disabled" for Icingaweb2 use.

Updated README (GH-324) to provide additional coverage regarding the use of stderr. See also GH-323 for further discussion.

Thanks again for raising the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation output/logging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants