It is often desirable to consolidate system logging information for the cluster
in a central location, both to provide easy access to the data, and to reduce
the impact of storing data inside the compute node's memory footprint if it is
stateless. The following commands highlight the steps necessary to configure
compute nodes to forward their logs to the master node, and to allow the master
node to accept these log requests.

% begin_ohpc_run
% ohpc_comment_header Configure rsyslog on master and computes
\begin{lstlisting}[language=bash,keywords={},upquote=true,literate={BOSVER}{\baseos{}}1]
# Configure master node to receive messages and reload rsyslog configuration
[sms](*\#*) echo 'module(load="imudp")' >> /etc/rsyslog.d/ohpc.conf
[sms](*\#*) echo 'input(type="imudp" port="514")' >> /etc/rsyslog.d/ohpc.conf
[sms](*\#*) systemctl restart rsyslog

# Install rsyslog in the minimal Ubuntu compute image
[sms](*\#*) wwctl image exec --build=false BOSVER -- apt -y install rsyslog
[sms](*\#*) wwctl image exec --build=false BOSVER -- install -d -m 0755 /etc/rsyslog.d

# Define compute node forwarding destination
[sms](*\#*) echo '*.* @'${sms_ip}':514' > $CHROOT/etc/rsyslog.d/ohpc-forward.conf

# Disable most local logging on computes. Emergency and boot logs will remain.
[sms](*\#*) perl -pi -e "s/^\*\.info/\#\*\.info/" $CHROOT/etc/rsyslog.conf
[sms](*\#*) perl -pi -e "s/^authpriv/\#authpriv/" $CHROOT/etc/rsyslog.conf
[sms](*\#*) perl -pi -e "s/^mail/\#mail/" $CHROOT/etc/rsyslog.conf
[sms](*\#*) perl -pi -e "s/^cron/\#cron/" $CHROOT/etc/rsyslog.conf
[sms](*\#*) perl -pi -e "s/^uucp/\#uucp/" $CHROOT/etc/rsyslog.conf
\end{lstlisting}
% end_ohpc_run
