kiwi syslog mysql_转一篇syslog简单搭建方法--kiwi syslog

软件名称:Kiwi Syslog Daemon (freeware version)

版本7.1.4

For use on Windows

95/98/ME/NT4/2000/XP/2003

下载:[url]http://www.kiwisyslog.com[/url]

分标准版和服务版,标准版是交互式操作,服务版可以安装成服务,当下次启动可以自己默默在后台运行。

kiwi自由版可以免费使用,但功能有限,不过基本的需求已经可以解决了。如果需要用完全功能的需要注册

,每个licence$99

庞大的网路中日志服务器很重要,假如主机被***,删除所有的系统日志,多冤枉,而日志服务器可以把

所有的***记录如实记载,hacker再这样如入无人之地的时候可要小心。还有些设备自身的存储介质原因不

可能记录海量的数据,也必须把日志转存到日志服务器上来。如果担心日志在传输中被sniffer,可以安装另

外一个软件Kiwi

Secure Tunnel,这样传输的日志被加密。

安装过程和一般软件无异, 监听端口 默认的是tcp1468 udp514

snmp162,可以根据需要调整。我从另

外的机器安装标准版后,telnet ip地址 端口

然后输入任何字符,发现均被记录,当时我就想如果把这个行

为作为一个登陆脚本就可以记录服务器是否无故被重启和关机。当我仔细再看kiwi的设置才发现我的想法有

点弱智,kiwi的功能非常齐全和实用。

当接受到日志后会激发它的行为,默认是显示,支持的行为丰富,有:icq消息

脚本 转存其他主机 播放声音

发送邮件 转存为nt事件日志,为应用日志   运行一个外部程序 转存到ODBC(支持oracle mysql

mssql

access)等。如果日志服务器的本地磁盘不够可以选择停止接受日志并发声音和邮件报警。

支持的设备有:

ciscoRouter

ciscoPIX

cisco交换机

UNIX主机

3COM dlink的网络设备

netscreen防火墙

Symantec防火墙和×××

FREESCO的路由器和防火墙

Intertex ADSL路由

HP JetDriect

printer

朗讯路由

(太多了,我发现只要支持snmp协议和有syslog选项的设备基本都支持,当然大部分设备我没有去试验过

)

日志定义:

DEBUG:

Info useful to developers for debugging the app, not useful during

operations

INFORMATIONAL:

Normal operational messages - may be

harvested for reporting, measuring throughput, etc -

no action required

NOTICE:

Events that are unusual but not error conditions - might be

summarized in an email to

developers or admins to spot potential

problems - no immediate action required

WARNING:

Warning messages -

not an error, but indication that an error will occur if action is not taken,

e.g. file system 85% full - each item must be resolved within a given

time

ERROR:

Non-urgent failures - these should be relayed to

developers or admins; each item must be

resolved within a given time

ALERT:

Should be corrected immediately - notify staff who can fix

the problem - example is loss of

backup ISP connection

CRITICAL:

Should be corrected immediately, but indicates failure in a primary system -

fix CRITICAL

problems before ALERT - example is loss of primary ISP

connection

EMERGENCY:

A "panic" condition - notify all tech staff on

call? (earthquake? tornado?) - affects multiple

apps/servers/sites...

-----------------------------------------------

下面给两个设备配置实例:

netscreen防火墙日志配置实例(我在ns500上亲自操作过):

netscreen的flash

memory只保存4096条日志,但在网络访问量大的时候根本没用,最多一两天就被后面

的日志给冲掉,而且当防火墙重新启动不能保存日志。

web操作步骤:

1

用admin用户登陆web界面

2 选择Configuration->;Report Settings->;Syslog

3

点击'Enable Syslog'

4 假如你要把所有的传输日志全部记录,最好还要选择'Include Traffic Log'

5

输入日志服务器的地址和端口(udp端口514)

这个是一个叫Kevin Branch的友好提示:

所有的Netscreen policies

(permit/deny/tunnel)最好全部有log的默认选项,这样可以全部如实录并传

送到日志服务(假如netscreen设置允许会话没有被指定拒绝)

“Log

Packets Terminated to Self"

选项与访问netscreen的会话无关,但最好还是记录所有的会话给

netscreen自己保存,否则哪怕仅仅是管理防火墙,也会显示来自Internet的消息。

命令行操作步骤:

1

set syslog config ip_address security_facility

2   local_facility

3 set

syslog enable

4 set syslog traffic

5 set log module system level level

destination syslog

提示:当用set syslog

config命令需要你定义一个安全facility(不知道怎么翻译,我理解为安全级别),你

可以用set syslog命令提示选项来看

security_facility 和 local_facility。

必须输入被设置的每个消息的安全层,选项如下:级别是从高到低

emergency (紧急事件)

alert          (警报)

critical       (危机)

error

(错误)

warning       (预告警)

notification     (通知)

information

(信息)

二 cisco

router日志配置实例:

首先telnet或者用console连接到目标路由器并进入enable模式。在命令行下输入下面的命令:

Config

term

Logging on

Logging Facility Local7   '注释:这个facility可以自己定义的

Logging IP Address '注释:填写安装了Kiwi Syslog Daemon的ip地址或者主机名

End

日志服务器集中负责日期的收集、分析、报告和日志安全管理,能够有效的协助系统管理人员和网络管理人员进行系统管理维护、故障定位,发现安全风险。通过日志收集代理程序收集各种平台和产品的操作系统日志、数据库日志、网络设备日志,转换成统一的格式后进行集中存储和风险,并利用预先设置的警告规则向管理员发出警告。用户可以方便的查询并生成报表、报告。安全管理员定期审阅日志,可以全面的了解网络安全形势,针对有问题的特定系统和机器采取相应措施,并将处理情况反馈领导和用户,形成一个良性循环的机制。

为了便于配置各类产品的SYSLOG服务,现就网络、安全等提出参考配置。

UNIX系统仅支持接受SYSLOG,下边的UNIX配置是配置SYSLOG服务将其他设备日志记录到UNIX主机的配置。

2.

网络设备

2.1. CISCO路由器

device(config)#logging on

device(config)#logging

a.b.c.d //日志服务器的IP地址

device(config)#logging facility local1 //facility标识,

RFC3164 规定的本地设备标识为 local0 - local7

device(config)#logging trap errors

//日志记录级别,可用"?"查看详细内容

device(config)#logging source-interface e0 //日志发出用的源IP地址

device(config)#service timestamps log datetime localtime show-timezone

//日志记录的时间戳设置,将时间标记以MMM DD HH:MM:SS的格式添加,可根据需要具体配置

device#sh logging

//检验

2.2. CISCO交换机

IOS命令行交换机的配置:(同Cisco路由器配置一样)

device(config)#logging

on

device(config)#logging a.b.c.d //日志服务器的IP地址

device(config)#logging

facility local1 //facility标识, RFC3164 规定的本地设备标识为 local0 -

local7

device(config)#logging trap errors

//日志记录级别,可用"?"查看详细内容

device(config)#logging source-interface e0 //日志发出用的源IP地址

device(config)#service timestamps log datetime localtime show-timezone

//日志记录的时间戳设置,将时间标记以MMM DD HH:MM:SS的格式添加,可根据需要具体配置

device#sh logging

//检验

SET命令行交换机的配置:

Console> (enable) set logging server

enable

Console> (enable) set logging server a.b.c.d

Console>

(enable) set logging server facility local5

Console> (enable) set logging

server severity 5

2.3. 华为交换机

Quidway(config)# logging on

//开启日志系统

Quidway(config)# set logging host 202.38.1.10 language English

//将IP地址为202.38.1.10的主机用作日志主机,设置严重等级阈值为informational,输出语言为英文

Quidway(config)#

set source rstp channel 5 log level informational

Quidway(config)# set source

ip channel 4 log level informational

2.4. 华为路由器

Quidway(config)# logging

on //开启日志系统

Quidway(config)# logging host a.b.c.d English

//将IP地址为a.b.c.d的主机用作日志主机设置严重等级阈值为informational

输出语言为英文模式

Quidway(config)#logging host   { local | ip-address }{ emergencies

| alerts | critical | errors | warningsnotifications | informational | debugging

}//允许向日志主机输出带优先级的日志信息

3. UNIX操作系统

3.1. HP-UX

Before you can send system

log messages to a UNIX syslog server, you must configure the syslog daemon on

the UNIX server.

Make sure that your syslogd is started with -r argument.

-r, this option will enable the facility to receive message from the network

using an Internet domain socket with the syslog services. The default setting is

not enabled.

Step 1 Add a line such as the following to the file

/etc/syslog.conf:

user.debug /var/log/myfile.log

--------------------------------------------------------------------------------

Note There must be five tab characters between user.debug and

/var/log/myfile.log. Refer to entries in the /etc/syslog.conf file for further

examples.

--------------------------------------------------------------------------------

Step 2 Create the log file by entering these commands at the UNIX shell

prompt:

$ touch /var/log/myfile.log

$ chmod 666 /var/log/myfile.log

Step 3 Make sure the syslog daemon reads the new changes by entering this

command:

$ kill -HUP Qcat /etc/syslog.pid

3.2. IBM

AIX

跟HP和SUN的类似。

3.3. SUN Solaris

配置示例是在SunOS 4.0 上完成的在其它厂商的Unix

操作系统上的配置

操作基本与之相同部分命令细节上的差异请参考各自的命令手册。

(1) 以root 超级用户的身份执行以下命令

# mkdir

/var/log/Quidway

# touch /var/log/Quidway/config

# touch

/var/log/Quidway/security

(2) 以root 的身份编辑文件/etc/syslog.conf

加入以下选择/动作组合

selector/action pairs

# Quidway configuration

messages

Local4.crit /var/log/Quidway/config

说明:

在编辑/etc/syslog.conf

时应注意以下问题:注释只允许独立成行并以字符# 开头,选择/动作组合之间必须以一个制表符分隔而不能输入空格,在文件名之后不得有多余的空格。

(3)

当建立了日志文件config 和security 且/etc/syslog.conf 文件被修改了之后应通过执行以下命令给系统守护进程Syslogd 一个HUP

信号来使Syslogd 重新读取它的配置文件/etc/syslog.conf

# ps -ae | grep syslogd

147

#

kill -HUP 147

进行以上操作之后路由器就可以在相应的日志文件中记录信息了。

说明:

综合配置Facility

设备名称Severity 严重等级阈值Filter 过滤器,及syslog.conf 文件可以进行相当细致的分类从而达到信息筛选的目的。

4.

Linux操作系统

用vi命令编辑 /etc/sysconfig/syslog,把 SYSLOGD_OPTIONS="-m 0" 修改为

SYSLOGD_OPTIONS="-r -m 0" 然后重新启动syslog 进程 /etc/rc.d/init.d/syslog restart

vi

编辑/etc/rc.conf中添加

syslogd_enable="yes"

5. 安全设备

5.1. CISCO

PIX防火墙

pix(config)#logging on

pix(config)#logging host in_if_name

a.b.c.d

pix(config)#logging message level levelid

5.2. Netscreen防火墙

set

syslog config a.b.c.d auth/sec local0

set syslog ***

set syslog

enable

5.3.

天融信防火墙

天融信“网络卫士”系列防火墙都配有专门的日志服务器和审计软件,这里所描述的防火墙日志是指通过防火墙查看日志,日志的内容是暂存在防火墙上的。日志所包含的内容没有专门的日志服务器所提供的内容详细,但也能供用户对通过防火墙的信息及对防火墙的操作做一个大致的了解,同时能为用户查找***者提供重要的信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 安装要求: 系统:windows 2012 R2 Standerd 环境:安装.net3.5和web服务 软件版本:K + SolarWinds Event Log Forwarder for Windows 日志服务器IP: 2. 安装过程: 运行开始安装: 至此,Kiwi Syslog server安装完成,开始激活。 3. 软件激活: 1)打开任务管理器: 2)找到文件夹下的,复制替换C:\Program Files (x86)\Syslogd下的相同文件, 3)运行Kiwi Syslog Server,Help-Enter license details,开始激活: 4)单击"Copy Unique Machine ID"复制Machine ID: 5)以管理员身份运行下的Keygen: 6)粘贴刚才复制的Machine ID,输入任意用户名,单击生成激活文件: 7)将激活文件放置任意位置,方便一会使用: 8)选择激活文件: 9)至此,激活成功。 4. 主要配置: 5. 客户端SolarWinds Event LogForwarder的安装: 安装操作简易,这里不做详细。 运行软件: 至此,windows下syslog搭建好,接下来是Linux配置syslog服务器。 6. CentOS配置rsyslog客户端远程记录日志: 1. 安装Rsyslog守护进程: # rpm -qa " grep rsyslog # rsyslogd –v 若rsyslog守护进程没有出现在系统中,使用以下命令来安装: # yum install rsyslog 2. 配置Rsyslog守护进程为客户端: # vi /etc/rsyslog.conf 添加以下声明,将IP地址替换为你的远程rsyslog服务器的IP地址: *.* @192.168.4.14:514 // UDP端口 ( 若需要可靠地协议,*.* @@192.168.4.14:514//TCP端口 若想要发服务器上的指定设备的日志消息,如内核设备, kern.* @192.168.4.14:514 ) 修改配置文件后,重启进程以激活修改:CentOS 7: # systemctl restart rsyslog.service CentOS 6:# service rsyslog restart 3. 让Rsyslog进程自动启动,运行以下命令: CentOS 7:# systemctl enable rsyslog.service CentOS 6:# chkconfig rsyslog on 7. 华为交换机设置Syslog日志服务器日志获取: <Huawei> system-view [Huawei]info-center enable //开启信息中心 [Huawei] info-center loghost 192.168.4.14 channel loghost //指定向日志主机输出日志信息的通道为 loghost 通道 [Huawei] info-center source default channel loghost debug state off log state off trap state off //关闭所有模块日志主机的 log、trap、debug 的状态 [Huawei]info-center loghost facility local7 language English //将IP地址为的主机作为日志主机,输出语言为英文 [Huawei]info-center source default channel loghost log level informational //设置信息级别为informational,允许输出信息的模块为所有模块 8. 日志服务器搭建成功后效果截图: ----------------------- Kiwi-Syslog日志服务器搭建全文共2页,当前为第1页。 Kiwi-Syslog日志服务器搭建全文共2页,当前为第2页。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值