简体   繁体   English

Syslog心跳和监控

[英]Syslog heartbeat and monitoring

Does anybody know how or even if, since I can't locate much on it, syslog offers any heartbeat mechanism? 是否有人知道,因为我找不到太多信息,因此syslog提供任何心跳机制?

I'm specifically thinking about how to monitor the devices that offer up syslog messages. 我特别在考虑如何监视提供syslog消息的设备。

I'm not specifically looking to use an external solution, but instead something syslog possibly offers itself, which can be monitored/interrogated and flagged if something is down. 我并不是特别希望使用外部解决方案,而是可以使用syslog本身提供的内容,如果出现故障,可以对其进行监视/查询和标记。

Or is their a standard lightweight tcp-based heartbeat protocol which runs on win/linux/bsd/solaris/aix/hp-ux? 还是他们的标准轻量级基于tcp的心跳协议在win / linux / bsd / solaris / aix / hp-ux上运行?

Motivation 动机

Maybe you already solved your problem but didn't post your solution or maybe you gave up on that and you're still waiting. 也许您已经解决了您的问题,但没有发布解决方案,或者您放弃了,但仍在等待。 I had the same problem and found an answer. 我有同样的问题,找到了答案。 Here it is: 这里是:

SYSLOG 系统日志

Syslog itself offers "mark". Syslog本身提供“标记”。 Actually this is a heartbeat. 实际上,这是一个心跳。

An syslog entry looks like this: 系统日志条目如下所示:

Nov 23 17:37:00 192.168.160.115 -- MARK --

mark: messages generated by syslogd itself that contain only a timestamp and the string “--MARK--”. mark:由syslogd本身生成的消息,仅包含时间戳和字符串“ --MARK--”。 To specify how many minutes should transpire between marks, invoke syslogd with the -m [minutes] flag. 要指定在标记之间移动多少分钟,请使用-m [minutes]标志调用syslogd。

[Source: http://www.linuxjournal.com/article/5476 ] [来源: http//www.linuxjournal.com/article/5476 ]

NXLOG NXLOG

If you want the same for NXLOG you can do this by using the Module im_mark: 如果您希望NXLOG拥有相同的功能,则可以使用模块im_mark来实现:

<Input mark>
   Module        im_mark         // Module
   MarkInterval  40              // Interval in minutes
   Mark          -- MARK --      // Message
</Input>

[Source: https://nxlog.org/node/295#im_mark ] [来源: https//nxlog.org/node/295#im_mark ]

A log from nxlog on Windows looks like this: Windows上来自nxlog的日志如下所示:

Nov 24 09:21:57 192.168.160.123 MSWinEventLog   1       N/A     77
Tue Nov 24 09:21:57 2015        N/A     nxlog-ce        N/A     N/A    
N/A     WKS-HC02        N/A  -- MARK --       N/A

You could use the following RegEx to trigger on such logentries: 您可以使用以下RegEx来触发此类登录:

(\w+\s+\d+\s+\d+:\d+:\d+) ([\w.-]+).*--\s*MARK\s*--

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM