天天看點

運維工具整理

下面是我工作中用到的或者将會用到的運維工具,整理下,算作我的工具箱了。

運維工具整理

磁盤檢測工具smartctl 

相關學習連結

http://www.live-in.org/archives/1047.html  

http://xmodulo.com/check-hard-disk-health-linux-smartmontools.html

http://wiki.51osos.com/index.php?title=Smartctl&redirect=no

1.檢測 test result 結果是 PASSED 并不意味着硬碟100%安全,如果結果是Failure一般都有問題

2.修改配置檔案,出現磁盤故障 發郵件通知

# Monitor all attributes except normalized Temperature (usually 194),
# but track Temperature changes >= 4 Celsius, report Temperatures
# >= 45 Celsius and changes in Raw value of Reallocated_Sector_Ct (5).
# Send mail on SMART failures or when Temperature is >= 55 Celsius.
#/dev/hdc -a -I 194 -W 4,45,55 -R 5 -m [email protected]
           
3.具體的安裝,詳細的參數,用的時候再查

Perl 開發的一個日志分析工具Logwatch

Logwatch能夠對Linux 的日志檔案進行分析,并自動發送mail給相關處理人員,可定制需求Logwatch的mail功能是借助宿主系統自帶的mail server 發郵件的,是以系統需安裝mail server , 如sendmail,postfix,Qmail等 支援的service perl腳本目錄/usr/share/logwatch/scripts/services 100多個 相關學習連結 http://chenxy.blog.51cto.com/729966/801248 http://xmodulo.com/monitor-log-file-linux-logwatch.html

rsyslog日志伺服器結合loganalyzer 日志分析工具

rsyslog syslog的增強版,input output parse支援的子產品很多,并且是centos redhat Ubuntu等系統的預設日志服務,相對還說有保障,更新比較活躍。

現在還有另一種組合,logstach=>Elasticsearch 然後Kibana前端展示。

相關配置學習連結:

http://litaotao.blog.51cto.com/6224470/1283871

[性能測試] 系統調試工具之sysdig

Sysdig is open source, system-level exploration: capture system state and activity from a running Linux instance, then save, filter and analyze.

相關的學習連結:

中文版:http://bbs.linuxtone.org/thread-25998-1-1.html

英文版:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html 有圖,安裝說明很詳細

開源PHP監控擴充:witness簡介

ucweb開發并開源的,軟體的介紹:

 witness--證人,它的證詞可以幫助我們還原“犯罪”現場。該系統能讓我們在處理上述問題時,更簡便,更有效率,更全面的得到所有相關資料,進而加快分析問題和處理問題的過程。witness擴充直接從Zend引擎擷取資訊。

witness系統的主要特點如下:

1.非嵌入式監控,無需修改運作的PHP代碼

2.可以通過cookie監控特定的請求

3.輕量級,靈活度高

4.高性能

項目已開源:https://github.com/ucweb/witness

具體的介紹:http://tech.uc.cn/?p=1753

Linux進階入侵檢測aide

AIDE(Adevanced Intrusion Detection Environment,進階入侵檢測環境)是個入侵檢測工具,主要用途是檢查文檔的完整性。

AIDE能夠構造一個指定文檔的資料庫,他使用aide.conf作為其配置文檔。AIDE資料庫能夠儲存文檔的各種屬性,使用下列算法:sha1、md5、rmd160、tiger,以密文形式建立每個文檔的校驗碼或散列号。系統管理者應該建立新系統的AIDE資料庫。這第一個AIDE資料庫是系統的一個快照和以後系統更新的準繩。這個資料庫不應該儲存那些經常變動的文檔資訊,例如:日志文檔、郵件、/proc文檔系統、使用者起始目錄連同臨時目錄。

詳細的介紹:http://blog.sina.com.cn/s/blog_6954b9a901012omx.html

http://www.linuxidc.com/Linux/2013-08/88282.htm

http://xmodulo.com/host-intrusion-detection-system-centos.html

Linux日志檔案總管——logrotate

  logrotate是個十分有用的工具,它可以自動對日志進行截斷(或輪循)、壓縮以及删除舊的日志檔案。例如,你可以設定logrotate,讓/var/log/foo日志檔案每30天輪循,并删除超過6個月的日志。配置完後,logrotate的運作完全自動化,不必進行任何進一步的人為幹預。另外,舊日志也可以通過電子郵件發送 參考連結:http://linux.cn/article-4126-1.html

pythonbrew:管理不同Python版本的利器

Pythonbrew可以安裝不同版本的Python,并且進行版本切換,還整合了Virtualenv。可惜該項目已經不再積極開發中,使用者可以嘗試它替代pyenv。

詳細的介紹:http://hao.jobbole.com/pythonbrew/