CIS 238 - UNIX System Administration

Lab Exercise #5: UNIX Printing, Syslog

1)  yum install cups*, cups-lpd, yum install system-config-printer

2)  Instructor adds local printer using system-config-printer, “Short name” as lp0 and shares it.

-  service start cups

-  systemctl start cups-lpd.socket …. starts LPD separate process

3)  Instructor adds cups-lpd to /etc/xinetd.d with disable=no

-

service printer

{

socket_type = stream

protocol = tcp

port = 515

wait = no

user = lp

group = sys

passenv =

server = /usr/libexec/cups/daemon/cups-lpd

server_args = -o document-format=application/octet-stream

disable = no

}

-  systemctl stop cups-lpd.socket

-  service xinted reload

4)  Student adds local printer as network printer pointing to instructor as lp0 using correct drivers.

5)  lpinfo –v command to see available ports

6)  Student prints test page to both printer

7)  Other commands – lpq, lpstat, lprm

8)  Point your browser to 127.0.0.1:631. Review options,

Related commands: lpr, lpq, lpstat, lprm


Syslog: rsyslog coonfiguration, logrotate, logwatch.

9)  Change /etc/rsyslog.conf to compress logfiles.

10) Verify logrotate schedule under anacron (/etc/cron.daily/logrotate)

11) Install logwatch.

yum install logwatch

12) Copy the original config file:

cat /usr/share/logwatch/default.conf/logwatch.conf > /etc/logwatch/conf/logwatch.conf

13) vi /etc/logwatch/conf/logwatch.conf Modify as follows:

Output = mail

Format = html

MailTo = ldomain

MailFrom = ldomain

Range = Today

Detail = High

14) vi /etc/cron.daily/0logwatch

add the following to the logwatch line:

/usr/sbin/logwatch --mailto ldomain

15) cp /usr/share/logwatch/default.conf/services/* /etc/logwatch/conf/services

16) $ vi zz-disk_space.conf

Set disk space reporting

Uncomment the lines as shown:

#Uncomment this to show the home directory sizes

show_home_dir_sizes = 1

home_dir = "/home"

#Uncomment this to show the mail spool size

show_mail_dir_sizes = 1

mail_dir = "/var/spool/mail"

#Uncomment this to show the system directory sizes /opt /usr/ /var/log

show_disk_usage = 1

17) Save changes then to run it:

logwatch

If you want to watch the output instead of having it e-mailed to you then set 'Output = mail' line back to its default Output = stdout

18) cp /usr/share/logwatch/default.conf/logfiles/* /etc/logwatch/conf/services