AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[syslogd](server)

Martin Hope
Lee Hill
Asked: 2020-05-19 02:29:33 +0800 CST

使用 syslogd 进行远程日志记录 - Ubuntu 18.04.2 LTS - 只是不会发送

  • 1

因此,使用集中式日志记录,我无法让 syslogd 将消息发送到远程 syslog 服务器。

背景:

系统日志服务器已设置并正在工作,并与其他向其中发送日志的设备进行了测试。

网络服务器和客户端都位于同一子网中,服务器上的防火墙已关闭,据我所知,ubuntu 没有配置防火墙。测试 514 从客户端打开服务器并获得成功连接。

设置/测试过程

syslogd 似乎在我的安装中不存在,所以我安装了它:

sudo apt-get install -y inetutils-syslogd

修改 /etc/syslogd.conf 中的配置文件以包含 2 行:

*.* /home/lee/test
*.* @10.120.1.20

通过发送挂断信号保存并重新加载 syslogd

killall -s SIGHUP syslogd

使用记录器功能进行测试:

logger "test"

将行插入本地文件,但没有任何内容到达服务器。

尝试在 512 outbound 上设置 tcpdump 以查看是否有任何事情发生:

tcpdump -n -s 1500 -X port 514 -w /home/lee/tcpdump.pcap

该文件为空,尝试跟踪PID:

strace -s 500 -tfp 188341 -o /home/lee/strace_syslog

该文件的输出表明它看到了测试消息,并写入了一些输出,但似乎没有任何迹象表明写入远程系统日志地址......

1446  10:27:52 restart_syscall(<... resuming interrupted poll ...>) = 1
1446  10:28:03 recvfrom(21, "<13>May 18 10:28:03 lee: test", 1024, 0, 0x7ffd918070e0, [110->0]) = 29
1446  10:28:03 rt_sigprocmask(SIG_BLOCK, [HUP ALRM], [], 8) = 0
1446  10:28:03 writev(22, [{iov_base="May 18 10:28:03", iov_len=15}, {iov_base=" ", iov_len=1}, {iov_base="ubuntu-docker", iov_len=13}, {iov_base=" ", iov_len=1}, {iov_base="lee: test", iov_len=9}, {iov_base="\n", iov_len=1}], 6) = 40
1446  10:28:03 writev(20, [{iov_base="May 18 10:28:03", iov_len=15}, {iov_base=" ", iov_len=1}, {iov_base="ubuntu-docker", iov_len=13}, {iov_base=" ", iov_len=1}, {iov_base="lee: test", iov_len=9}, {iov_base="\n", iov_len=1}], 6) = 40
1446  10:28:03 writev(11, [{iov_base="May 18 10:28:03", iov_len=15}, {iov_base=" ", iov_len=1}, {iov_base="ubuntu-docker", iov_len=13}, {iov_base=" ", iov_len=1}, {iov_base="lee: test", iov_len=9}, {iov_base="\n", iov_len=1}], 6) = 40
1446  10:28:03 writev(6, [{iov_base="May 18 10:28:03", iov_len=15}, {iov_base=" ", iov_len=1}, {iov_base="ubuntu-docker", iov_len=13}, {iov_base=" ", iov_len=1}, {iov_base="lee: test", iov_len=9}, {iov_base="\n", iov_len=1}], 6) = 40
1446  10:28:03 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
1446  10:28:03 poll([{fd=3, events=POLLIN|POLLPRI}, {fd=21, events=POLLIN|POLLPRI}], 2, -1) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
1446  10:28:10 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
1446  10:28:10 alarm(30)                = 0
1446  10:28:10 rt_sigreturn({mask=[]})  = -1 EINTR (Interrupted system call)
1446  10:28:10 poll([{fd=3, events=POLLIN|POLLPRI}, {fd=21, events=POLLIN|POLLPRI}], 2, -1) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
1446  10:28:40 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
1446  10:28:40 alarm(30)                = 0
1446  10:28:40 rt_sigreturn({mask=[]})  = -1 EINTR (Interrupted system call)

我错过了什么???

我只是无法将其输出到远程主机....从我的测试中我确信这是 /etc/syslogd.conf 中的配置问题,但我看不到是什么!

ubuntu syslog syslogd
  • 1 个回答
  • 1934 Views
Martin Hope
armani
Asked: 2017-03-09 15:41:36 +0800 CST

使用模板 syslogd 到远程服务器

  • 0

在整个网络上,我找到了 (1) rsyslog 到远程服务器或 (2) 带有模板的 rsyslog 的示例,但从来没有两者兼而有之。当我在我的 Mac 上有这个 /etc/rsyslog.conf 时,它会很好地发送到远程服务器:

*.* @10.1.38.223

但是当我更改为这个时,没有网络流量被发送到远程服务器(使用 tcpdump 验证):

$template MyTemplate, "MacOSX %msg%"
*.* @10.1.38.223;MyTemplate

是否不可能将这样的额外文本附加到远程记录的消息中?

logging remote syslog syslogd
  • 1 个回答
  • 1721 Views
Martin Hope
coding_hero
Asked: 2012-07-12 09:32:45 +0800 CST

在 solaris 服务器上的 syslog-ng 中配置“审计”功能?

  • 0

这是这个问题的后续行动。mghocke 非常友好地帮助我解决了这个问题,但这确实是一个单独的问题,因此是一个新帖子。

我真的不太了解 syslog,并且正在尝试从 syslogd 转移到 syslog-ng。

在 Solaris 的 syslogd 中,有一个“审计”工具,您可以在下面看到它的配置:

local7.debug                                    /var/log/ncolog
audit.debug                                     /var/log/ncolog
local7.debug                                    @nimitz
audit.debug                                     @nimitz

在我新的 syslog-ng.conf 中,它是这样配置的:

filter f_local7 { facility (local7); };
filter f_audit { facility (audit); };

...

log { source (s_sys); filter (f_local7); destination (d_ncolog); destination (d_nimitz); };
log { source (s_sys); filter (f_audit); destination (d_ncolog); destination (d_nimitz); };

但是 syslog-ng 无法识别“审计”功能。我环顾四周,似乎“审计”设施是设施 13,但“local13”不起作用。这个工具在 syslog-ng 中叫什么?

solaris syslog syslogd syslog-ng
  • 1 个回答
  • 2767 Views
Martin Hope
coding_hero
Asked: 2012-07-11 11:18:48 +0800 CST

从 syslog.conf 移动到 syslogng.conf

  • 2

我正在将一个 Solaris 框从 syslogd 移动到 syslog-ng,因为 syslogd 的 Solaris 版本删除了日志中的原始源主机名。我正在查看 syslogng.conf 文档,但不确定我是否完全理解它。我们有一个相对简单的 syslog.conf,我希望那里的 syslog-ng 专家可以告诉我如何将它“转换”为可用的 syslogng.conf?

#ident  "@(#)syslog.conf        1.5     98/12/14 SMI"   /* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# syslog configuration file.
#
# This file is processed by m4 so be careful to quote (`') names
# that match m4 reserved words.  Also, within ifdef's, arguments
# containing commas must be quoted.
#
*.err;kern.notice;auth.notice                   /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit        /var/adm/messages

#*.alert;kern.err;daemon.err                    operator
#*.alert                                                root

*.emerg                                         *
local7.debug                                    /var/log/ncolog
audit.debug                                     /var/log/ncolog
local7.debug                                    @nimitz
audit.debug                                     @nimitz

# if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
#auth.notice                    ifdef(`LOGHOST', /var/log/authlog, @loghost)

mail.debug                      ifdef(`LOGHOST', /var/log/syslog, @loghost)

#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err                                        /dev/sysmsg
user.err                                        /var/adm/messages
#user.alert                                     `root, operator'
user.emerg                                      *
)
solaris unix syslog syslogd syslog-ng
  • 1 个回答
  • 1716 Views
Martin Hope
Chris Lercher
Asked: 2010-03-23 11:06:32 +0800 CST

syslogd:日志文件格式(不是配置格式)

  • 1

我想解析日志文件。syslogd 的日志文件格式是否对所有系统都相同?在我的系统(Debian Lenny)上,它是:

Mar  7 04:22:40 my-host-name ...

(我对 ... 部分不太感兴趣)

我可以依靠这个吗?是否有一些或多或少的官方描述?的手册页syslogd描述了配置格式,但没有描述日志文件格式。

理想情况下,描述会给字段提供官方名称,例如(日期、时间、主机、条目)或(日期时间、主机名、消息)。也许另外一些正则表达式。我想在我的脚本中使用名称和正则表达式,以避免不必要地偏离标准,并确保脚本到处运行。

谢谢

克里斯

log-files syslogd
  • 3 个回答
  • 8245 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve