葉成剛



摘要:網絡在運行過程中,有時會出現一些異常事件,這些異常事件對網絡具有一定的危害性,嚴重的可能會導致網絡故障。現代網絡運維工作中普遍使用Syslog日志記錄網絡設備上發生的各種事件,然而許多網絡運維部門僅僅用Syslog日志分析故障,對日志中所反映的網絡異常情況往往重視不夠。為了改變被動等待故障的工作方式,網絡部門需要全面了解網絡的運行情況,找出可能導致網絡故障的因素,使得運維工作由被動變為主動。Syslog日志分析是主動運維工作中的一項重要內容。由于大型網絡中Syslog日志數量非常龐大,依靠人的分析方法幾乎不可行,而且由于日志消息格式的隨意性,也使得傳統的基于規則的計算機分析方法通用性較差。本文通過對異常事件的特征進行研究,結合實際網絡中的Syslog日志數據,對如何找出網絡中的異常事件和異常設備進行總結。
關鍵詞: 日志; 異常事件; 主動運維; 日志分析
中圖分類號: TP393.08
文獻標志碼: A
文章編號: 2095-2163(2017)05-0050-06
Abstract:Sometimes, the abnormal events may be happened in a running network. The abnormal events are harmful to the network and even lead to network failure. Syslog is widely used in modern network to record events happened with devices. But in many networks, Syslogs are analysed just after network failure and the abnormal events hidden in Syslogs are ignored. In order to change the passive work mode of waiting for network failure, the network department needs to fully understand the health of the network and identify the factors that may lead to network failure. Syslog analysis is an important part of active maintenance work. While it is almost impossible for the people to analyse Syslogs of large scale network because of huge numbers of Syslogs. Also the rule based analysis method for computers is not suitable for other networks due to the arbitrariness of Syslog formats. In this paper, the characteristics of the abnormal events are researched and the Syslog analysis method to find the abnormal events and devices is introduced.
Keywords: Syslog; abnormal event; active operation and maintenance; Syslog analysis
0引言
隨著互聯網技術的飛速發展和移動應用的推廣普及,人們的日常生活與工作已與網絡建立了密切聯系。確保網絡的可用性與穩定性成為了網絡運維部門的重要目標。在傳統運維模式下,運維部門被動響應和處理網絡故障,工作效率低下。而在主動運維模式下,運維人員需要采取各種主動措施,找出網絡中存在的問題。在實際網絡運維中,通常會使用Syslog日志記錄網絡運行過程中設備上發生的事件,所有設備的日志信息將會發送到Syslog服務器集中存儲。Syslog日志在網絡運維中具有較高的分析價值和用途,不僅可以用于故障分析,還能用于發現網絡異常情況、網絡安全威脅、用戶行為分析等諸多方面。本次研究則立足于綜述大型網絡的主動運維工作要求下,如何通過Syslog日志找出網絡中的異常設備,并以實際運維網絡的Syslog日志數據進行分析驗證。
1Syslog介紹
1.1Syslog協議
Syslog協議最早由美國加州伯克利大學研究開發,由于其在運維管理方面呈現重要價值,因此在許多操作系統和網絡設備中都選擇內嵌了該協議。在一個最簡單的Syslog協議模型中,由生成日志的發送器和接收日志的收集器兩部分組成,發送器可以稱為設備,收集器也可稱為Syslog服務器。Syslog使用UDP傳輸協議,源和目標端口通常為514。
1.2Syslog消息結構
完整的Syslog日志格式由優先級(Priority)、消息頭(Header)、消息文本(Content)三部分組成。一個典型的Syslog消息格式如下:
<34>Oct 1 22:33:15 myhost su: 'su root' failed for admin on /dev/pts/8
優先級通常由字符“<”開始,后面是1~3位的數字,然后以“>”結尾。其中的數字部分由日志的程序模塊(Facility)代碼和消息的嚴重級別(Severity)編號計算得出。優先級的數值等于程序模塊代碼乘以8,再加上嚴重級別編號。endprint