sdchy 发表于 2019-1-16 13:26:12

nagios流量监控的三种方法


[*]-bash-3.2# /usr/local/nagios/libexec/check_traffic.sh -V 1 -C nagios -H localhost -I 2 -w 12,30 -c 15,35 -M -b
[*]/usr/local/nagios/libexec/check_traffic.sh: line 449: bc: command not found
[*]/usr/local/nagios/libexec/check_traffic.sh: line 454: bc: command not found
[*]/usr/local/nagios/libexec/check_traffic.sh: line 457: bc: command not found
[*]/usr/local/nagios/libexec/check_traffic.sh: line 458: bc: command not found
[*]/usr/local/nagios/libexec/check_traffic.sh: line 461: [: too many arguments
[*]/usr/local/nagios/libexec/check_traffic.sh: line 576: bc: command not found
[*]/usr/local/nagios/libexec/check_traffic.sh: line 577: bc: command not found
[*]Unknown - Can not found data in the history data file. Please to check the file /var/tmp/check_traffic_localhost_2.hist_dat_root__32 ,or use use verbose mode and check the debug file
  3.使用nagios自带的check_mrtgtraf来监控流量,前提是系统上面已经安装了mrtg了。让nagios来读取mrtg的流量日志数据,check_mrtgtraf -h
  Options:
  -h, --help
  Print detailed help screen
  -V, --version
  Print version information
  -F, --filename=STRING
  File to read log from
  -e, --expires=INTEGER
  Minutes after which log expires
  -a, --aggregation=(AVG|MAX)
  Test average or maximum
  -w, --warning
  Warning threshold pair ,
  -c, --critical
  Critical threshold pair ,
  define command{
  command_name    traffic_average
  command_line    /usr/lib/nagios/plugins/check_mrtgtraf '$ARG1$' 10 AVG '$ARG2$' '$ARG
  3$' '$ARG4$' '$ARG5$'
  }
  值得注意的是这里的-F参数后面的日志文件是mrtg获取的日志数据的文件名

页: [1]
查看完整版本: nagios流量监控的三种方法