RH133读书 笔记(4) - Lab 4 System Services
Lab 4 System Services
Goal: Develop skills using system administration tools and setting up and administering CUPS.
Estimated Duration: 30
Sequence 1: Using cron
Scenario: You want to know some information about the status of the system every ten minutes today to help investigate some performance issues you have been having. You suspect it might be memory or I/O related and want to keep an eye on those resources.
Deliverable: A cron job that runs every ten minutes today between the hours of 0800 (8:00 AM) and 1700 (5:00 PM).
Instructions:
1. Using crontab -e create a cron job that executes /usr/bin/free and /bin/ps every 10 minutes between 0800 (8:00 am) and 1750 (5:50 pm).
a. As root, use the command crontab -e to edit your cron file. (If you are not comfortable with vi, export an EDITOR environment variable to set another editor.)
b. Enter the following line in your crontab file:
*/10 8-17 * * * /usr/bin/free; /bin/ps
2. How could you send the output from these cron jobs to another e-mail address?
You can set the MAILTO=user variable or use command | mail -s test user
3. Use mail, or mutt as root to check for email from the cron job you have scheduled.
4. Be sure to delete your cron job when you have received several emails from it.
Sequence 2: Logging to a centralized log host
Scenario: Your boss thinks it is a great idea to have one central logging host.
Work together with your neighbor. Set up one machine as the log server and the other as a log client
Instructions:
1. First, on the log server set up syslogd to accept remote messages.
a. Edit /etc/sysconfig/syslog:
SYSLOGD_OPTIONS=“-r -m 0”
b. Restart syslogd:
# service syslog restart
2. On the log client set up syslogd to send messages from the user facility to the log server.
a. Append in /etc/syslog.conf the following line:
user.* @192.168.0.X
b. Restart syslogd.
# service syslog restart
3. Test the new setup by using logger to generate a syslog message. Does the message appear in your neighbor's /var/log/messages?
# logger -i -t yourname "This is a test"
Sequence 3: Setting up a printer and administering a printer with CUPS.
Instructions:
1. Use system-config-printer to create a local queue named testprinter using the generic Postscript printer driver
a. As root run system-config-printer or select System->Administration->Printing in the graphical interface.
b. Click New Printer
c. Enter the text: testprinter in the Printer Name field and click Forward.
d. Select Serial Port #1 from the Select Connection. This describes a locally-connected printer. Click Forward.
e. Select Generic from the Makes list and click Forward.
f. Scroll down to and select Postscript Printer from the Models list and click Forward.
g. Click Apply.
h. After a short pause, you should see your new printer in the Local Printers section of the main interface.
2. Make testprinter your default printer and print a test page.
a. Select testprinter from system-config-printer's Local Printers list to display its settings interface. Note that there are many new configuration options available once the printer has been created.
b. Click Make Default Printer.
c. Click Print Test Page. Click OK in the confirmation dialog.
d. If you are using Gnome, a printer icon should appear in in the corner of your screen. Click this icon and you will see your test page waiting to print. Since your printer does not actually exist, this will never happen, so you may wish to remove the print job by right-clicking on it and selecting Cancel Documents.
3. Use the lp command to print the file /root/install.log from the command line. Since you do not have a real printer attached, this job will be queued forever. Verify the status of the print queue with lpstat and then remove the print job with cancel.
a. # lp /root/install.log
b. # lpstat
(Note: you should see at least one print job active for root with Job number 1. If your test page is still in the queue, you should see it as well)
c. Type the command: cancel 1 to remove the job.
d. Type the command: lpstat The job should now be removed.
RH133读书 笔记(4) - Lab 4 System Services的更多相关文章
- RH133读书笔记(11)-Lab 11 System Rescue and Troubleshooting
Lab 11 System Rescue and Troubleshooting Goal: To build skills in system rescue procedures. Estimate ...
- RH253读书笔记(2)-Lab 2 System Resource Access Controls
Lab 2 System Resource Access Controls Goal: To become familiar with system resource access controls. ...
- RH253读书笔记(1)-Lab 1 System Monitoring
Lab 1 System Monitoring Goal: To build skills to better assess system resources, performance and sec ...
- RH133读书笔记(1)-Lab 1 Managing Startup
Lab 1 Managing Startup Goal: To familiarize yourself with the startup process System Setup: A system ...
- RH133读书笔记(2)-Lab 2 Working with packages
Lab 2 Working with packages Goal: To gain working experience with package management System Setup: A ...
- RH133读书 笔记(5) - Lab 5 User and Group Administration
Lab 5 User and Group Administration Goal: To build skills for user and group administration. Estimat ...
- RH133读书 笔记(3) - Lab 3 Configuring the kernel
Lab 3 Configuring the kernel Goal: Develop skills tuning the /proc filesystem. Gain some experience ...
- RH133读书笔记(6) - Lab 6 Adding New Filesystems to the Filesystem Tree
Lab 6 Adding New Filesystems to the Filesystem Tree Goal: Develop skills and knowlege related to par ...
- RH133读书笔记(9)-Lab 9 Installation and System-Initialization
Lab 9 Installation and System-Initialization Goal: Successfully install Red Hat Enterprise Linux. Sy ...
随机推荐
- hosts文件导致无法访问网站
前段时间有人反映无论怎么样都无法在自己的电脑上访问法兰克官网,那台电脑的DNS也无法解析,通过查看hosts文件后发现,原来该电脑的hosts文件木马修改过了,屏蔽了相关的域名,删除新增的或者用其他机 ...
- 浅谈JAVA ThreadPoolExecutor(转)
这篇文章分为两部分,前面是ThreadPoolExecutor的一些基本知识,后一部分则是Mina中一个特殊的ThreadPoolExecutor代码解析.算是我的Java学习笔记吧. 基础 在我看来 ...
- hdu1698(线段树)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 线段树功能:update:成段替换 (由于只query一次总区间,所以可以直接输出1结点的信息) ...
- Web监听器导图详解(转)
阅读目录 Web监听器 监听器的分类 Servlet版本与Tomcat版本 getAttribute与getParameter的区别 参考 监听器是JAVA Web开发中很重要的内容,其中涉及到的知识 ...
- 运行一个android程序,直接访问某个网站
package android.com.youtube; import android.app.Activity; import android.content.Intent; import andr ...
- SQL Server :理解Page Free Space (PFS) 页
原文:SQL Server :理解Page Free Space (PFS) 页 我们已经讨论了GAM与SGAM页,数据页(Data Page) ,现在我们来看下页面自由空间页(Page Free S ...
- 0当执行游戏xc000007b错误的解决方法
如图所示,这个错误是让很多玩家担心. 出现这个错误,可能是硬件的问题,也可能是软件的问题. 可是.因为硬件引起该问题的概率非常小,而且除了更换硬件之外没有更好的解决方法,因此本文将具体介绍怎样通过软件 ...
- view和activity的区别(转)
activity相当于控制部分,view相当于显示部分.两者之间是多对多的关系,所有东西必须用view来显示. viewGroup继承自view,实现了ViewManager,ViewParent接口 ...
- java web开发人员经常使用标签
struts标签库 国际化配置 配置国际化 1.国际化配置 在struts自带的app中的struts-config.xml中的<message-resources parameter=&quo ...
- 玩转html5(五)---月球绕着地球转,地球绕着太阳转(canvas实现,同样可以动哦)
关于运动速度的参数与真实速度有点差距,大家可以自行调整 <!DOCTYPE html> <html> <head> <meta http-equiv=&quo ...