A script to intercept the 'module' command and log each invocation for later auditing. Source the generated script from your .bashrc (or force it into user environments via system bashrc)
Tested on both TCL module and LMOD environments, and preserves tab completion.
Can be installed one of three ways:
- local: will log locally to a file
- rsyslog-local: will intergrate with rsyslog system logger (requires admin privileges)
- rsyslog-remote: integrate with rsyslog and write logs to remote logserver
First declare environment vars LAME_LOGFILE, LAME_INSTALL_DIR, and LAME_LOGHOST (if using remote logging). Then one of:
$ make install-local
-- or --
$ make install-rsyslog-local
-- or --
$ make install-rsyslog-remote
Edit log file path as desired, then copy generated etc/rsyslog.d/lame_local.conf
to /etc/rsyslog.d/lame_local.conf
Edit log file path as desired, then copy generated etc/rsyslog.d/lame_server.conf
to /etc/rsyslog.d/lame_server.conf
Edit logserver name as desired, then copy generated etc/rsyslog.d/lame_client.conf
to /etc/rsyslog.d/lame_client.conf
After adding the .conf files, restart the syslog service:
# systemctl stop rsyslog.service
# systemctl start rsyslog.service
Note that you may need to configure your firewall to allow messages to pass from the client to the server.