zoukankan      html  css  js  c++  java
  • Linux配置日志服务器


    title: Linux配置日志服务器
    tags: linux, 日志服务器

    Linux配置日志服务器


    日志服务器配置文件:/etc/rsyslog.conf

    服务器端:

    服务器IP如下:
    enter description here

    编辑日志服务器的配置文件:
    enter description here

    这里UDP或者TCP任选一个
    enter description here

    将注释的两句复制一遍,然后取消注释即可
    enter description here

    进入目录下创建配置文件,配置需要监控的客户端
    enter description here

    Vim编辑器打开
    enter description here
    内容如下:
    enter description here

    内容格式如下:
    :属性, 比较操作符, "值" 保存位置

    属性包括以下内容
    fromhost 哪个主机名发过来的
    fromhost-ip 哪个ip发过来的
    msg 从日志信息里的内容判断
    hostname 从日志中的主机名判断
    比较操作符包括以下内容
    contains 包含
    isequal 等于
    startswith 以...开头
    

    重启日志服务
    enter description here

    可以看到目标目录下已经生成一个目录记录文件,且内容为空
    enter description here

    客户机端:

    客户机端IP为:192.168.0.100/24

    编辑配置文件:
    enter description here
    在末尾加上如下行指定日志服务器地址和端口号
    enter description here
    保存退出,重启日志服务
    enter description here

    开始验证:
    用服务器端通过ssh试图连接客户端:
    enter description here

    由于输入密码,连接失败

    现在在去查看日志记录文件:
    enter description here

    如上,ssh连接的记录已经被记录在日志文件中

  • 相关阅读:
    linux 安装python3
    phoenix 索引实践
    spark shuffle参数调优
    hbase 面试问题汇总
    sqlserver 自动初始化从节点数据
    hive sql 窗口函数
    数据仓库建模
    Spark DataFrame简介(二)
    list删除时java.util.ConcurrentModificationException
    mybatis中判断等于字符串的条件怎么写
  • 原文地址:https://www.cnblogs.com/laoxiajiadeyun/p/9943742.html
Copyright © 2011-2022 走看看