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

Expose number of DNS query results in connection-related error messages #201

Closed
atc0005 opened this issue Jul 25, 2021 · 2 comments · Fixed by #202
Closed

Expose number of DNS query results in connection-related error messages #201

atc0005 opened this issue Jul 25, 2021 · 2 comments · Fixed by #202
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jul 25, 2021

Instead of a repeat of #190, the check_imap_mailbox plugin reported the following today:

Additional Info:

CRITICAL: Error connecting to outlook.office365.com

ERRORS

  • failed to gather IP Addresses for connection attempts

This is good, since the plugin didn't crash, but it also doesn't note how many query results we started with. Were there literally no results, or were they all IPv6 only?

The error message should be expanded to note the original query results before any potential parsing to drop IPv6-specific entries (or to drop IPv4 entries if the user opted for IPv6-only connectivity).

@atc0005 atc0005 added enhancement New feature or request output/logging labels Jul 25, 2021
@atc0005 atc0005 added this to the Next Release milestone Jul 25, 2021
@atc0005 atc0005 self-assigned this Jul 25, 2021
@atc0005
Copy link
Owner Author

atc0005 commented Jul 25, 2021

Block relevant to the specific error message noted earlier:

// No IPs remain after filtering against IPv4-only or IPv6-only
// requirement.
switch {
case len(addrs) < 1:
errMsg := "failed to gather IP Addresses for connection attempts"
logger.Error().Msg(errMsg)
return nil, fmt.Errorf(errMsg)
default:
logger.Debug().
Int("count", len(addrs)).
Str("ips", strings.Join(addrs, ", ")).
Msg("successfully gathered IP Addresses for connection attempts")
}

@atc0005
Copy link
Owner Author

atc0005 commented Jul 25, 2021

In addition to that block, other related error messages for mbxs.Connect() should also identify the query results count.

atc0005 added a commit that referenced this issue Jul 25, 2021
Attempt to provide additional information when troubleshooting
failures to gather IP Addresses for connection attempts.

refs GH-201
@atc0005 atc0005 changed the title Expose number of original query results in error messages Expose number of original query results in connection-related error messages Jul 25, 2021
@atc0005 atc0005 changed the title Expose number of original query results in connection-related error messages Expose number of DNS query results in connection-related error messages Jul 25, 2021
atc0005 added a commit that referenced this issue Jul 27, 2021
Provide original lookup results prior to parsing/filtering
that may potentially be applied if limiting connections to
one of IPv4-only or IPv6-only.

refs GH-201
refs GH-190
atc0005 added a commit that referenced this issue Jul 27, 2021
Provide original lookup results prior to parsing/filtering
that may potentially be applied if limiting connections to
one of IPv4-only or IPv6-only.

refs GH-205
refs GH-201
refs GH-190
@atc0005 atc0005 added the dns label Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant