DATEPAGE.CGI(1)

πŸ’– DATEPAGE.CGI β€” the manual, but make it cute πŸ’–

okay bestie, sit down, grab a strawberry πŸ“, because we're talking about datepage.cgi β€” a Xymon CGI script that lets you peek at pre-built reports by date. it's giving time-travel but make it web form ✨


🌸 NAME 🌸

datepage.cgi β€” Xymon CGI script to view pre-built reports by date πŸ—“οΈπŸ‘‘


✨ SYNOPSIS ✨

datepage.cgi?type={day,week,month} --url=URLPREFIX [options]

that's it, that's the whole vibe. literally.


πŸ¦‹ DESCRIPTION πŸ¦‹

so. datepage.cgi gets invoked as a CGI script through the datepage.sh CGI wrapper. that's the pipeline, no cap 🫢

it gets handed a QUERY_STRING environment variable telling it which flavor of time-selection you want: "day", "week" or "month" β€” pick your fighter. then it builds a whole web form with the appropriate day/week/month selection boxes (so fancy), and based on whatever the user picks, it constructs a resulting url out of the URLPREFIX plus the time selection. then? it redirects the browser to that URL. main character exit, honestly πŸ’…

here's exactly how the URL gets assembled β€” from the URLPREFIX, the type-parameter, the value of the "pagepath" or "host" cookie, and the user's selection:

  • type=day β€” the final URL is URLPREFIX/daily/YEAR/MONTH/DAY/PAGEPATH.
  • type=week β€” the final URL is URLPREFIX/weekly/YEAR/WEEK/PAGEPATH.
  • type=month β€” the final URL is URLPREFIX/monthly/YEAR/MONTH/PAGEPATH.

now let's decode those placeholders, because they matter fr fr:

  • YEAR is the full year (4 digits, including century) πŸ—“οΈ
  • MONTH is the two-digit number of the month (01..12)
  • DAY is the number of the day in the month (01..31)
  • WEEK is the ISO 8601:1988 week-number (01..53) πŸ“…
  • PAGEPATH is the current value of the "pagepath" cookie if it's set; but if it's not set and the "host" cookie is set, then this host gets looked up in the hosts.cfg file and the page where this host is found becomes the PAGEPATH.

and where do those two cookies come from, you ask? they're set by the default web-header templates that ship with Xymon. cute, right? πŸŽ€


πŸ’… OPTIONS πŸ’…

  • --url=URLPREFIX β€” specifies the initial part of the final URL. this one is required, bestie, no skipping it 🚨
  • --hffile=FILENAME β€” specifies the template files (from $XYMONHOME/web/) to use. the default is "--hffile=report".
  • --color=COLOR β€” sets the background color of the generated webpage. the default is blue. πŸ’™
  • --env=FILENAME β€” loads the environment defined in FILENAME before executing the CGI script.
  • --debug β€” enables debugging output. πŸ›βœ¨

and also these template files, which are listed right here in the OPTIONS section, so here they stay:

  • $XYMONHOME/web/report_form_daily β€” HTML form template for the date selection form when type=daily.
  • $XYMONHOME/web/report_form_weekly β€” HTML form template for the date selection form when type=weekly.
  • $XYMONHOME/web/report_form_monthly β€” HTML form template for the date selection form when type=monthly.
  • $XYMONHOME/web/report_header β€” HTML header file for the generated web page.
  • $XYMONHOME/web/report_footer β€” HTML footer file for the generated web page.

🌈 ENVIRONMENT VARIABLES 🌈

  • XYMONHOME β€” used to locate the template files for the generated web pages.
  • QUERY_STRING β€” contains the parameters for the CGI script.

πŸ‘‘ SEE ALSO πŸ‘‘

xymongen(1), hosts.cfg(5), xymonserver.cfg(5)

go read those next, bestie, iykyk πŸ“š


and that's the whole page!! Xymon, Version 4.3.30, 4 Sep 2019 β€” mwah, love that for us πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from