Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > 其他操作系统 > FreeBSD Apinger 介绍
【标  题】:FreeBSD Apinger 介绍
【关键字】:in,ping,FreeBSD,Api,BS,BSD,FreeBSD,Apinger
【来  源】:网络

FreeBSD Apinger 介绍

Your Ad Here


 0.名稱
   Apinger - Alarm Pinger

 1.敘述
   Alarm Pinger(apinger)是一個透過ICMP回應來監控多種IP設備的小工具,
   有許多其他的工具可以達到這個目的,但是它們大部分是shell或是perl script
   且當持續監控的狀況之下,他們需要產生較多的process,及消耗較多的CPU資源.

   Alarm Pinger是一個透過C寫出的程式,所以不需要太多的CPU資源.
   Alarm Pinger支援IPv4及IPv6.

   Alarm Pinger透過設定檔設定監控的目標及其他參數.
   apinger需要透過root權限才可以執行(用來創造raw socket),
   但是,一旦apinger開始送出或是接收封包,socket就會被丟棄.

 2.安裝
   
   
   補充:作者有寫了*些許*的說明檔,放在/usr/ports/net/apinger/work/之下,
        有興趣可以看看,前提是..你還沒有進行make clean
   
   啟動檔:/usr/local/etc/rc.d/apinger.sh
   設定檔:/usr/lcoal/etc/apinger.conf.sample 下載apinger.conf --下載apinger設定檔
          (apinger的設定檔,複製更名為apinger.conf)

 3.設定檔
  只列出可能需要修改的部分:紫色表示新增;棕色表示刪除

  # 設定當狀況符合時,送出訊息的程式位址
  ## Mailer to use (default: "/usr/lib/sendmail -t")
  #mailer "/var/qmail/bin/qmail-inject" 
  mailer "/usr/local/sbin/sendmail -t"
  
  # 定義相關的狀況輸出檔案(若不想要輸出,則維持註解狀況即可)
  #status {
  #	## 定義輸出的檔案位址
  #	## File where the status information whould be written to
  #	file "/tmp/apinger.status"
  #
  #	## 定義輸出的間隔時間 預設為5分鐘.
  #	## Interval between file updates
  #	## when 0 or not set, file is written only when SIGUSR1 is received
  #	interval 5m
  #}
  
  # 定義警告相關設定
  alarm default { 
	# 設定將警告訊息送給誰(預設是root).
	## Mailbox where alarm report should be sent
	mailto "root@localhost"

	## 設定信件的envelope-from(通常不用變動)
	## What to put in the "From: " header
	mailfrom "root@localhost"
	
	## 設定信件的envelope sender(通常不用變動)
	## What should be the envelope sender
	#mailenvfrom "root@localhost"
	
	## 設定信件的標題
	## 預設是原因 對於監測目標的敘述 ***警告的名稱***
	圖例:
	
	## Subject of the mail message (default: "%r: %T(%t) *** %a ***")
	#mailsubject "%s %r: %a: %T"
	
	參數代表意思:
	%t - 監測的IP位址 ; %T - 對於監測IP位址的敘述
	%a - 警告的名稱   ; %A - 警告的形式("down"/"loss"/"delay")   
	%r - 發出訊息的原因("ALARM"/"alarm canceled"/"alarm canceled (config reload)")
	%p - 送出的偵測數 ; %P - 收到的偵測數
	%l - 最近平均遺失的封包 ;  %d - 最近平均的延遲狀況
	%s - 目前時間     ; %% - 表示%這個字元

	## 將所有訊息合併送出
	## Combine all alarms that are fired in the 5s interval
	## so one report is send for all of them
	#combine 5s

	## 設定警告訊息送出的間隔及次數
	## 預設是每隔5分鐘進行偵測一次,不停重複
	## Repeat alarm actions each 5 minutes, but max 10 times (0 whould mean no limit)
	#repeat 5m 10
	## 但是一直重複看了很煩..送出幾次就可以了
	}

  ## 定義關於"Down"的設定,預設是30秒沒有回應視為*沒有回應*
  ## This alarm will be fired when target doesn't respond for 30 seconds.
  alarm down "down" {
	time 30s
  }

  ## 定義關於"Delay"(延遲)警告的設定
  ## 當延遲超過200微秒時,會發出相關警告.延遲低於100微秒時,警告會取消
  ## 題外話:當您覺得系統一直不停的送給你delay及cancel訊息,不妨調整一下
  ## This alarm will be fired when responses are delayed more than 200ms
  ## it will be canceled, when the delay drops below 100ms
  alarm delay "delay" {
	delay_low 100ms
	delay_high 200ms
  }

  ## 定義關於封包遺失(loss)的設定,當封包遺失超過20%時發出,低於10%時,警告取消
  ## 題外話:當您覺得系統一直不停的送給你delay及cancel訊息,不妨調整一下
  ## This alarm will be fired when packet loss goes over 20%
  ## it will be canceled, when the loss drops below 10%
  alarm loss "loss" {
  	percent_low 10
  	percent_high 20
  }
  
  ## 定義預設偵測值.
  ## These parameters can be overriden in a specific target configuration
  target default {
	## 定義送出偵測的時間間隔(預設是一秒)
	## How often the probe should be sent	
	interval 1s
	
	## 定義有多少回應被用來評估平均的延遲值
	## How many replies should be used to compute average delay 
	## for controlling "delay" alarms
	avg_delay_samples 10
	
	## 定義有多少偵測被用來評估平均的封包遺失值
	## How many probes should be used to compute average loss
	avg_loss_samples 50

	## 定義在遺失多少封包之後視為全部封包遺失(loss)
	## The delay (in samples) after which loss is computed
	## without this delays larger than interval would be treated as loss
	avg_loss_delay_samples 20

	## 定義對偵測目標要進行的測試
	## Names of the alarms that may be generated for the target
	alarms "down","delay","loss"

	## (關於RRD繪圖的部分,目前不加以說明)
	## Location of the RRD
	#rrd file "/tmp/apinger-%t.rrd"
	}

  ## 定義要偵測的目標
  ## 語法: target <IP位址> { <參數> }
  ## 參數可以採用預設,也就是上方設定的target defult{},並可以加上敘述(description).
  ## Each one defined with:
  ## target <address> { <parameter>... }
  ## The parameters are those described above in the "target default" section
  ## plus the "description" parameter.
  ## the <address> should be IPv4 or IPv6 address (not hostname!)
  target "127.0.0.1" { description "localhost IPv4"; }
  採用預設值偵測 127.0.0.1 , 並對該裝置加上敘述為"localhost IPv4"
  target "::1" { 
	description "localhost IPv6";
	
	# 針對IPv6的localhost偵測,但只偵測"down",
	#也就是當介面沒有回應才發出警告訊息
	# generate _only_ "down" alarms
	# "alarms" directive without "override" keyword adds alarms to the default list
	alarms override "down"; 
  }

 4.FAQ
   1.alarm pinger是一種網路監控工具,可以週期性的偵測網路設備的可達性及其品質.
   2.alarm pinger目前為止,並不能夠針對服務進行監控,因為apinger是透過ICMP的回應判斷.
   3.alarm pinger目前為止,也無法使用非ICMP的協定,如TCP/UDP
   4.由於透過DNS解出的IP可能有很多個,所以apinger也不能使用hostname.
   5.若你不想要收到訊息,你可以透過註解(#)設定檔中的mailto及mailfrom取消. 

 5.作者
  Jacek Konieczny <jajcus@pld.org.pl>
  http://www.bnet.pl/~jajcus/apinger/

 6.參考資料
   apinger.conf
FreeBSD FORCE_PKG_REGISTER:【上一篇】
FreeBSD proftpd problem:【下一篇】
【相关文章】
  • FreeBSD FORCE_PKG_REGISTER
  • FreeBSD ISC BIND 安全公告
  • CERT? Advisory CA-2003-25 Buffer Overflow in Sendmail
  • FreeBSD sendmail 8.12.8管理
  • FreeBSD 升级sendmail版本到8.12.10
  • FreeBSD--4.9-RELEASE
  • 构建小型的 FreeBSD 入侵检测系统
  • FreeBSD 使用watch监视终端
  • FreeBSD 的部分Package简介
  • FreeBSD 5.2 中成功安装Oracle9i手记
  • 【随机文章】
  • C图形编程
  • 客户端连服务器的注意事项
  • 交换机漏洞全面了解
  • 多态性C++[转]
  • www
  • Linux 档案属性与目录配置
  • 中兴的软交换浅谈
  • 路径MTU
  • 用C++设计过程中的规则
  • VisualStudio2005中没有Asp.net Web项目的问题(VS2005 SP1补丁包)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.