开发者社区> zengjf> 正文

Linux syslogd

简介: /********************************************************************************** * Linux syslogd * 说明: * 今天检查一下系统的系统日志,看一下系统是否正常,之前也都没有查看过这部分 * 日志。
+关注继续查看
/**********************************************************************************
 *                            Linux syslogd
 * 说明:
 *     今天检查一下系统的系统日志,看一下系统是否正常,之前也都没有查看过这部分
 * 日志。
 *                              
 *                                              2017-2-22 深圳 南山平山村 曾剑锋
 ********************************************************************************/

一、参考文档:
    1. 30.11. 使用 syslogd 记录远程主机的日志
        https://www.freebsd.org/doc/zh_CN/books/handbook/network-syslogd.html

二、syslogd帮助:
    # syslogd --help
    BusyBox v1.25.1 (2017-01-16 18:39:57 CST) multi-call binary.

    Usage: syslogd [OPTIONS]

    System logging utility
    (this version of syslogd ignores /etc/syslog.conf)

            -n              Run in foreground
            -R HOST[:PORT]  Log to HOST:PORT (default PORT:514)
            -L              Log locally and via network (default is network only if -R)
            -O FILE         Log to FILE (default: /var/log/messages, stdout if -)
            -s SIZE         Max size (KB) before rotation (default:200KB, 0=off)
            -b N            N rotated logs to keep (default:1, max=99, 0=purge)
            -l N            Log only messages more urgent than prio N (1-8)
            -S              Smaller output
    # 

三、/var/log/messages示例:
    ...
    Feb 21 00:39:34 aplex user.debug kernel: usb 2-1: usb auto-suspend
    Feb 21 00:39:34 aplex user.info kernel: eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
    Feb 21 00:39:36 aplex user.debug kernel: hub 2-0:1.0: hub_suspend
    Feb 21 00:39:36 aplex user.debug kernel: usb usb2: bus auto-suspend
    Feb 21 00:39:36 aplex user.debug kernel: ehci_fsl_bus_suspend begins, Host 1
    Feb 21 00:39:36 aplex user.debug kernel: fsl-ehci fsl-ehci.1: suspend root hub
    Feb 21 00:39:36 aplex user.debug kernel: ehci_fsl_bus_suspend ends, Host 1
    Feb 21 00:39:37 aplex user.info kernel: PHY: 1:01 - Link is Up - 100/Full
    Feb 21 00:39:38 aplex auth.info sshd[1478]: Server listening on 0.0.0.0 port 22.
    Feb 21 00:39:38 aplex daemon.err tftpd[1494]: cannot open IPv6 socket, disable IPv6: Address family not supported by protocol
    Feb 21 00:39:38 aplex daemon.err tftpd[1494]: Cannot set nonblock flag on socket: Bad file descriptor
    Feb 21 00:39:41 aplex daemon.info : starting pid 1641, tty '/dev/ttymxc0': '/sbin/getty -L  ttymxc0 115200 vt100 '
    Feb 22 22:05:26 aplex auth.info sshd[6989]: Accepted password for root from 192.168.10.10 port 49136 ssh2
    ...

 

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
Linux之《荒岛余生》(一)准备篇
xin片之争,已经暴露了中国xin的问题,我等码农束手无策;而在操作系统方面,成果也是乏善可陈;现如今酷炫的Web监控工具,让很多研发丧失了真正处理问题的能力。 越接近底层,就越接近真相,在计算机的世界,同样适用。
1203 0
linux which
1. 查找可执行文件的位置、显示命令所在路径 命令: which pwd 输出: hc@hc-virtual-machine:~/test$ which pwd /bin/pwd hc@hc-virtual-machine:~/test$ which...
703 0
+关注
文章
问答
文章排行榜
最热
最新
相关电子书
更多
Debian GNU/Linux 安全合规之路
立即下载
Decian GNU/Linux安全合规之路
立即下载
从 Linux 系统内核层面来解决实际问题的实战经验
立即下载