Skip to content

2.3 -- added "--tracehttp" parameter - #29

Merged
BornToBeRoot merged 2 commits into
BornToBeRoot:mainfrom
casadoi:2.3-casadoi
Sep 11, 2026
Merged

2.3 -- added "--tracehttp" parameter#29
BornToBeRoot merged 2 commits into
BornToBeRoot:mainfrom
casadoi:2.3-casadoi

Conversation

@casadoi

@casadoi casadoi commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

2.3 -- added "--tracehttp" parameter to show http requests/reponses

2.3 -- added "--tracehttp" parameter to show http requests/reponses

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Authentication credentials may be logged, and additional correctness issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds --tracehttp request/response diagnostics to the Nextcloud monitoring plugin and updates it to version 2.3.

Changes:

  • Adds HTTP tracing.
  • Updates version/changelog and formatting.
  • Changes database performance-data formatting.
File summaries
File Summary and findings
check_nextcloud.py Adds tracing, CLI help, version metadata, and formatting changes. Critical: tracing exposes authentication headers. Moderate: database units may become invalid. Nit: help text incorrectly documents the default as true.
Review details

Suppressed comments (2)

check_nextcloud.py:228

  • An HTTP error is itself a response, but HTTPError is caught before the success-only trace block and currently emits no response status, headers, or body. This prevents --tracehttp from showing the most useful failure responses (for example, a 401); trace the HTTPError response before printing the Nagios error.
except urllib.error.HTTPError as error:      # User is not authorized (401)
    print('UNKOWN - [WEBREQUEST] {0} {1}'.format(error.code, error.reason))
    sys.exit(3)

check_nextcloud.py:119

  • This adds a user-facing CLI option, but the repository's README contains a checked-in options/help listing and does not document --tracehttp. Add the flag and its behavior there so installations using the README can discover how to enable the trace.
parser.add_option('--tracehttp', dest='tracehttp', default=False, action='store_true', help='Show http protocol traces for debugging (default="true")')
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread check_nextcloud.py Outdated
Comment on lines +193 to +194
for key, value in request.headers.items():
print(f" {key}: {value}")
Comment thread check_nextcloud.py Outdated

print('OK - Database: {0}, version {1}, size: {2} | database_size={3}'.format(xml_database_type, xml_database_version, calc_size_suffix(xml_database_size), calc_size_nagios(xml_database_size)))
sys.exit(0)
print('OK - Database: {0}, version {1}, size: {2} | database_size={3}'.format(xml_database_type, xml_database_version, calc_size_suffix(xml_database_size), calc_size_nagios(xml_database_size,'')))
Comment thread check_nextcloud.py Outdated
parser.add_option('--ignore-sslcert', dest='ignore_sslcert', default=False, action='store_true', help='Ignore ssl certificate (default="false")')
parser.add_option('--api-url', dest='api_url', type='string', default='/ocs/v2.php/apps/serverinfo/api/v1/info', help='Url of the api (default="/ocs/v2.php/apps/serverinfo/api/v1/info")')
parser.add_option('--context', dest='context', type='string', help='Webserver context where Nextcloud is running (for example "/mycloud"). It will be prepended to api-url parameter')
parser.add_option('--tracehttp', dest='tracehttp', default=False, action='store_true', help='Show http protocol traces for debugging (default="true")')
@BornToBeRoot

Copy link
Copy Markdown
Owner

@casadoi thanks - i applied some fixes based on copilot & claude feedback. Merged!

@BornToBeRoot
BornToBeRoot merged commit 76cc851 into BornToBeRoot:main Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants