Beispiel #1
0
    def page(self) -> None:
        file_name = self.file_name(self._request)
        file_content = self._get_agent_output_file()

        html.set_output_format("text")
        html.response.headers[
            "Content-Disposition"] = "Attachment; filename=%s" % file_name
        html.write_binary(file_content)
Beispiel #2
0
    def page(self) -> None:
        site = html.request.get_ascii_input_mandatory("site")
        tarfile_name = html.request.get_ascii_input_mandatory("tarfile_name")
        Filename().validate_value(tarfile_name, "tarfile_name")
        file_content = self._get_diagnostics_dump_file(site, tarfile_name)

        html.set_output_format("x-tgz")
        html.response.headers["Content-Disposition"] = "Attachment; filename=%s" % tarfile_name
        html.write_binary(file_content)
Beispiel #3
0
    def page(self):
        config.user.need_permission("general.see_crash_reports")

        filename = "Checkmk_Crash_%s_%s_%s.tar.gz" % \
            (html.urlencode(self._site_id), html.urlencode(self._crash_id), time.strftime("%Y-%m-%d_%H-%M-%S"))

        html.response.headers['Content-Disposition'] = 'Attachment; filename=%s' % filename
        html.response.headers['Content-Type'] = 'application/x-tar'
        html.write_binary(_pack_crash_report(self._get_serialized_crash_report()))
Beispiel #4
0
    def page(self) -> None:
        if not config.user.may("wato.diagnostics"):
            raise MKAuthException(
                _("Sorry, you lack the permission for downloading diagnostics dumps."))

        site = html.request.get_ascii_input_mandatory("site")
        tarfile_name = html.request.get_ascii_input_mandatory("tarfile_name")
        file_content = self._get_diagnostics_dump_file(site, tarfile_name)

        html.set_output_format("x-tgz")
        html.response.headers["Content-Disposition"] = "Attachment; filename=%s" % tarfile_name
        html.write_binary(file_content)
Beispiel #5
0
 def send(cls, pdf_source, sendas):
     html.set_output_format("pdf")
     html.response.headers["Content-Disposition"] = "inline; filename=" + ensure_str(sendas)
     html.write_binary(pdf_source)