In the interests of diversity, Submitty provides for users to set a preferred name should it be different from their legal name. This feature can be abused, so changes to a user's preferred name is recorded into Postgresql's log for review. To make it easier to locate these logged messages, a sysadmin tools script, pnc_compile.pl, is provided to fetch the preferred name change logs from Postgresql and compile them into a human readable report.
IMPORTANT: pnc_compile.pl needs to operate on a host that can directly access Postgresql's log. Typically, this means the script must be setup on the same server as Postgresql.
- Make sure your host has Perl 5.30.0 or later.
- Ubuntu 20.04 includes Perl 5.30.0.
- Retrieve
pnc_compile.plfrom Github (right click link and choose "Save Link As...") - Edit code file to setup its configuration.
- Locate the two lines shown below. They are near the top of the file. These lines dictate where to look for Postgresql's log and where to write the script's compiled log.
$PSQL_LOGdictates where Postgresql's log is located.$PNC_LOGdictates where this script will record and append its report.- The default for
$PSQL_LOGis set for Postgresql 12 running in Ubuntu 20.04. The default for$PNC_LOGwill write the script's report to the same directory as the script file. - Change these values to match your host's setup.
my $PSQL_LOG = "/var/log/postgresql/postgresql-12-main.log";
my $PNC_LOG = "preferred_name_change_report.log";- Setup a cron schedule to run the script.
- Postgresql's log is typically owned by
root, so it is mandatory to run the script asroot. - Be sure to set execute permission on the script.
- The script will parse Postgresql's log by the current day's datestamp, so it is intended that the script is run once per day.
- Alternatively, if you wish to schedule the crontab for overnight after 12AM, you can set the
-yor--yesterdayargument so the script will intentionally parse Postgresql's log by the previous day's datestamp. e.g./path/to/pnc_compile.pl -y
Data processed and logged by this tool may be protected by FERPA (20 U.S.C. § 1232g). Please consult and abide by your institute's data protection policies.