Nagios之NRPE监控Linux/UNIX主机

本文的测试服务器信息:

监控端IP:172.16.56.131,主机名:monitors

被监控端IP:192.183.3.145,主机名:kk

2.1 远程主机端(被监控端)的NRPE安装与配置

从3.0的版本开始,NRPE在众多的操作系统中的安装都变得更为简单,如有问题可访问https://community.nagios.org/

1.增加nagios用户

1
[root@kk ~] #useradd nagios

2.下载安装nagios plugins

1
2
3
4
5
[root@kk ~] #cd /home/softwares/  
[root@kk softwares] #wget http://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz  
[root@kk softwares] #tar -xzf nagios-plugins-2.1.2.tar.gz   
[root@kk softwares] #cd nagios-plugins-2.1.2  
[root@kk nagios-plugins-2.1.2] #./configure  --with-nagios-user=nagios --with-nagios-group=nagios

注意:要监控MySQL需要添加 --with-mysql

wKiom1iiaO7DpBe4AAApBLdEcpc343.png-wh_50

1
2
[root@kk nagios-plugins-2.1.2] #make  
[root@kk nagios-plugins-2.1.2] #make install

修改nagios插件安装目录权限:

1
2
[root@kk nagios-plugins-2.1.2] # chown nagios.nagios /usr/local/nagios
[root@kk nagios-plugins-2.1.2] # chown -R nagios.nagios /usr/local/nagios/libexec

3.安装NRPE

NRPE下载地址https://sourceforge.net/projects/nagios/files/nrpe-3.x/,本文下载版本是nrpe-3.0.1.tar.gz。

1
2
3
4
5
[root@kk nagios-plugins-2.1.2] #cd ..  
[root@kk softwares] #tar zxf nrpe-3.0.1.tar.gz   
[root@kk softwares] #cd nrpe-3.0.1  
[root@kk nrpe-3.0.1] #yum -y install openssl openssl-devel  
[root@kk nrpe-3.0.1] #./configure --with-nagios-user=nagios --with-nagios-group=nagios

wKiom1iiaaaxj9yYAAAcn-JY0bk287.png-wh_50

1
[root@kk nrpe-3.0.1] #make all

wKiom1iiadeSI0qRAAA7CRwXw1Y708.png-wh_50

4.安装NRPE的plugin、deamon等

1
[root@kk nrpe-3.0.1] #make install-plugin

wKioL1iiag2yAlGdAAAek7yCi_s391.png-wh_50

1
[root@kk nrpe-3.0.1] #make install-daemon

wKioL1iiairTlMLRAAAZYEu3VjQ156.png-wh_50

1
[root@kk nrpe-3.0.1] #make install-daemon-config

wKioL1iiak_wdMZqAAANGH-aJhk080.png-wh_50

这是nrpe该版本的一个bug,详见https://github.com/NagiosEnterprises/nrpe/issues/50

解决:

wKiom1iiamSg4g63AAANuwAohwk106.png-wh_50

1
[root@kk nrpe-3.0.1] #make install-config

如果需要打开5666端口,则需要下列命令(本案例默认关闭的防火墙):

1
2
# iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT  
# service iptables save

4.配置NRPE命令

1
[root@kk nrpe-3.0.1] #vim /usr/local/nagios/etc/nrpe.cfg

修改allowed_hosts=192.183.3.145,172.16.56.131,允许Nagios服务器端访问;

在命令行测试如下的监测命令,这里根据自己的监测需求对命令进行修改,并写入nrpe.cfg文件:

1
2
3
4
5
/usr/local/nagios/libexec/check_nrpe  -H localhost -c check_users
/usr/local/nagios/libexec/check_nrpe  -H localhost -c check_load
/usr/local/nagios/libexec/check_nrpe  -H localhost -c check_sda1
/usr/local/nagios/libexec/check_nrpe  -H localhost -c check_total_procs
/usr/local/nagios/libexec/check_nrpe  -H localhost -c check_zombie_procs

查看配置结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@kk libexec] #grep -v '^#' /usr/local/nagios/etc/nrpe.cfg |sed '/^$/d'
log_facility=daemon
debug=0
pid_file= /usr/local/nagios/var/nrpe .pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=192.183.3.145,172.16.56.131
dont_blame_nrpe=0
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300
command [check_users]= /usr/local/nagios/libexec/check_users  -w 5 -c 10
command [check_load]= /usr/local/nagios/libexec/check_load  -w 15,10,5 -c 30,25,20
command [check_sda1]= /usr/local/nagios/libexec/check_disk  -w 20% -c 10% -p  /dev/sda1
command [check_zombie_procs]= /usr/local/nagios/libexec/check_procs  -w 5 -c 10 -s Z
command [check_total_procs]= /usr/local/nagios/libexec/check_procs  -w 150 -c 200

5.启动NRPE

1
2
[root@kk nrpe-3.0.1] # /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d  
[root@kk nrpe-3.0.1] #netstat -tulpn | grep nrpe

wKioL1iibvGBQ8e6AAAO3d-QHvU625.png-wh_50

有两种方式用于管理nrpe服务,nrpe有两种运行模式:
-i        # Run as a service under inetd or xinetd   
-d        # Run as a standalone daemon
可以为nrpe编写启动脚本,使得nrpe以standard alone方式运行:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@kk nrpe-3.0.1] #vi /etc/init.d/nrped  
#!/bin/bash  
# chkconfig: 2345 88 12     
# description: NRPE DAEMON     
NRPE= /usr/local/nagios/bin/nrpe    
NRPECONF= /usr/local/nagios/etc/nrpe .cfg     
case  "$1"  in   
     start)     
         echo  -n  "Starting NRPE daemon..."   
         $NRPE -c $NRPECONF -d     
         echo  " done."   
         ;;     
     stop)     
         echo  -n  "Stopping NRPE daemon..."   
         pkill -u nagios nrpe     
         echo  " done."   
     ;;     
     restart)     
         $0 stop     
         sleep  2     
         $0 start     
         ;;     
     *)     
         echo  "Usage: $0 start|stop|restart"   
         ;;     
     esac    
exit  0
1
2
3
4
5
[root@kk nrpe-3.0.1] #chmod +x /etc/init.d/nrped   
[root@kk nrpe-3.0.1] #chkconfig --add nrped    
[root@kk nrpe-3.0.1] #chkconfig nrped on  
[root@kk nrpe-3.0.1] #service nrped start   
Starting NRPE daemon...  done .

2.2 监控端NRPE安装与配置

1.安装依赖包

1
[root@monitors ~] # yum -y install openssl openssl-devel

否则编译nrpe时会出现如下问题:

wKiom1iia36AxTIpAAAMXLBrl4w012.png-wh_50

原因是缺少openssl-devel包。

2. NRPE下载与安装

1
2
3
4
5
[root@monitors ~] # cd /home/nagios/  
[root@monitors nagios] # wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-3.0.1.tar.gz--2017-01-17 23:36:36--  http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-3.0.1.tar.gz  
[root@monitors nagios] # tar xzvf nrpe-3.0.1.tar.gz   
[root@monitors nagios] # cd nrpe-3.0.1  
[root@monitors nrpe-3.0.1] # ./configure --with-nagios-user=nagios --with-nagios-group=nagios

wKiom1iia7CxR1ABAAAcr9fUsis654.png-wh_50

1
[root@monitors nrpe-3.0.1] # make all

wKioL1iia8niVBrYAAA6QTi3Duo618.png-wh_50

1
[root@monitors nrpe-3.0.1] # make install-plugin

wKiom1iia-CRrv_IAAAdVBa6Y80285.png-wh_50

安装完成后,会在Nagios安装目录的libexec下生成check_nrpe的插件,如下所示:

1
2
[root@monitors nrpe-3.0.1] # ll /usr/local/nagios/libexec/check_nrpe  
-rwxrwxr-x 1 nagios nagios 125293 1月  17 23:47  /usr/local/nagios/libexec/check_nrpe

3.NRPE测试

NRPE命令参数的使用可参详:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
[root@monitors libexec] # ./check_nrpe -h  
NRPE Plugin  for  Nagios  
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)  
Version: 3.0.1  
Last Modified: 09-08-2016  
License: GPL v2 with exemptions (-l  for  more  info)  
SSL /TLS  Available: OpenSSL 0.9.6 or higher required  
   
Usage: check_nrpe -H <host> [-2] [-4] [-6] [-n] [-u] [-V] [-l] [-d <dhopt>]  
        [-P <size>] [-S <ssl version>]  [-L <cipherlist>] [-C <clientcert>]  
        [-K <key>] [-A <ca-certificate>] [-s <logopts>] [-b <bindaddr>]  
        [-f <cfg- file >] [-p <port>] [-t <interval>:<state>]  
        [-c < command >] [-a <arglist...>]  
   
Options:  
  <host>       = The address of the host running the NRPE daemon  
  -2           = Only use Version 2 packets, not Version 3  
  -4           = bind to ipv4 only  
  -6           = bind to ipv6 only  
  -n           = Do no use SSL  
  -u           = (DEPRECATED) Make timeouts  return  UNKNOWN instead of CRITICAL  
  -V           = Show version  
  -l           = Show license  
  <dhopt>      = Anonymous Diffie Hellman use:  
                 0 = Don't use Anonymous Diffie Hellman  
                     (This will be the default  in  a future release.)  
                 1 = Allow Anonymous Diffie Hellman (default)  
                 2 = Force Anonymous Diffie Hellman  
  <size>       = Specify non-default payload size  for  NSClient++  
  <ssl ver>    = The SSL /TLS  version to use. Can be any one of: SSLv2 (only),  
                 SSLv2+ (or above), SSLv3 (only), SSLv3+ (or above),  
                 TLSv1 (only), TLSv1+ (or above DEFAULT), TLSv1.1 (only),  
                 TLSv1.1+ (or above), TLSv1.2 (only), TLSv1.2+ (or above)  
  <cipherlist> = The list of SSL ciphers to use (currently defaults  
                 to  "ALL:!MD5:@STRENGTH" . WILL change  in  a future release.)  
  <clientcert> = The client certificate to use  for  PKI  
  <key>        = The private key to use with the client certificate  
  <ca-cert>    = The CA certificate to use  for  PKI  
  <logopts>    = SSL Logging Options  
  <bindaddr>   = bind to  local  address  
  <cfg- file >   = configuration  file  to use  
  [port]       = The port on  which  the daemon is running (default=5666)  
  [ command ]    = The name of the  command  that the remote daemon should run  
  [arglist]    = Optional arguments that should be passed to the  command ,  
                 separated by a space.  If provided, this must be the last  
                 option supplied on the  command  line.  
   
  NEW TIMEOUT SYNTAX  
  -t <interval>:<state>  
     <interval> = Number of seconds before connection  times  out (default=10)  
     <state> = Check state to  exit  with  in  the event of a timeout (default=CRITICAL)  
     Timeout state must be a valid state name ( case -insensitive) or integer:  
     (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)  
   
Note:  
This plugin requires that you have the NRPE daemon running on the remote host.  
You must also have configured the daemon to associate a specific plugin  command  
with the [ command ] option you are specifying here.  Upon receipt of the  
[ command ] argument, the NRPE daemon will run the appropriate plugin  command  and  
send the plugin output and  return  code back to *this* plugin.  This allows you  
to execute plugins on remote hosts and  'fake'  the results to  make  Nagios think  
the plugin is being run locally.

通过NRPE监控远程Linux主机要使用chech_nrpe插件进行,其语法格式如下:
check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

1
2
[root@monitors libexec] # ./check_nrpe -H 192.183.3.145 -p 5666  
NRPE v3.0.1

1.创建命令定义

1
2
3
4
5
6
[root@monitors libexec] # cd /usr/local/nagios/etc/objects/  
[root@monitors objects] # vim commands.cfg  
define  command {  
         command_name    check_nrpe  
         command_line    $USER1$ /check_nrpe  -H  "$HOSTADDRESS$"   -c  "$ARG1$"  
}

2.创建host与service定义

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[root@monitors objects] # vim linuxserver.cfg   
#############################################################  
#create a new template for linux boxes  
#############################################  
   
define host{  
name linux-box ; Name of this template  
use generic-host ; Inherit default values  
check_period 24x7  
check_interval 5  
retry_interval 1  
max_check_attempts 10  
check_command check-host-alive  
notification_period 24x7  
notification_interval 30  
notification_options d,r  
contact_groups admins  
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE  
}  
########################################################  
#defie a new host for the remote Linux/Unix box   
#that references the newly created linux-box host template  
########################################################  
define host{  
use linux-box ; Inherit default values from a template  
host_name remotehost ; The name we're giving to this  
server  
alias  centos6_kk ; A longer name  for  the server  
address 192.183.3.145 ; IP address of the server  
}  
######################################################################################  
#The following service will monitor the CPU load on the remote host.  
# The "check_load" argument that  is passed to the check_nrpe command  
# defiition tells the NRPE daemon to run the "check_load" comman#d as defied in the nrpe.cfg fie  
######################################################################################  
define service{  
use generic-service  
host_name remotehost  
service_description CPU Load  
check_command check_nrpe!check_load  
}  
##############################################################################################  
#The following service will monitor the number of currently logged in users on the remote host  
############################################################################################  
define service{  
use generic-service  
host_name remotehost  
service_description Current Users  
check_command check_nrpe!check_users  
}  
#############################################################################################  
#The following service will monitor the free drive space on /dev/sda1 on the remote host.  
  view plain copy print?
#<span style="color:#ff0000;">
#注意:这里的/dev/sda1是通过被检测主机df命令获得,切勿根据官方文档盲目填写/dev/hda1 
############################################################################################  
define service{  
use generic-service  
host_name remotehost  
service_description  /dev/sda1  Free Space  
check_command check_nrpe!check_sda1  
}  
##############################################################################################  
#The following service will monitor the total number of processes on the remote host.  
##############################################################################################  
define service{  
use generic-service  
host_name remotehost  
service_description Total Processes  
check_command check_nrpe!check_total_procs  
}  
###########################################################################################  
#The following service will monitor the number of zombie processes on the remote host.  
###########################################################################################  
define service{  
use generic-service  
host_name remotehost  
service_description Zombie Processes  
check_command check_nrpe!check_zombie_procs  
}

注意:监控端(Nagios服务端)定义的service命令与被监控端NRPE中内置的监控命令一致。

3.启动所定义的命令和服务

1
2
3
[root@monitors objects] # vim /usr/local/nagios/etc/nagios.cfg  
添加一行:  
cfg_file= /usr/local/nagios/etc/objects/linuxserver .cfg

配置语法检查:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[root@monitors objects] # service nagios configtest  
或者  
[root@monitors objects] # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  
Nagios Core 4.2.0  
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors  
Copyright (c) 1999-2009 Ethan Galstad  
Last Modified: 08-01-2016  
License: GPL  
Website: https: //www .nagios.org  
Reading configuration data...  
    Read main config  file  okay...  
    Read object config files okay...  
Running pre-flight check on configuration data...  
Checking objects...  
     Checked 15 services.  
Warning: Host  'kk'  has no default contacts or contactgroups defined!  
     Checked 2 hosts.  
     Checked 1 host  groups .  
     Checked 1 service  groups .  
     Checked 1 contacts.  
     Checked 1 contact  groups .  
     Checked 26 commands.  
     Checked 5  time  periods.  
     Checked 0 host escalations.  
     Checked 0 service escalations.  
Checking  for  circular paths...  
     Checked 2 hosts  
     Checked 0 service dependencies  
     Checked 0 host dependencies  
     Checked 5 timeperiods  
Checking global event handlers...  
Checking obsessive compulsive processor commands...  
Checking misc settings...  
Total Warnings: 1  
Total Errors:   0  
Things  look  okay - No serious problems were detected during the pre-flight check

重启nagios:

1
2
3
4
[root@monitors objects] #  service nagios restart  
Running configuration check...  
Stopping nagios:  done .  
Starting nagios:  done .

登录Nagios web监控页面查看配置的监控是否生效:

wKioL1iibTWDUYxCAACEqzJiWYk254.png-wh_50

至此,NRPE的简单安装与配置结束!

4. NRPE自定义配置


如果需要监控远程主机(Linux/UNIX)更多的服务,需要:

  • 在远程主机端的nrpe.cfg文件中增加新的命令定义;

  • 在监控端的nagios配置文件中增加新的服务监控定义;

比如说增加swap空间的使用率监控。

1.被监控远程主机端配置

在本例中假定想要的结果是当swap空闲率低于10%将会有“critical”警告,低于20%将有“warning”警告;

1
2
[root@kk libexec] #/usr/local/nagios/libexec/check_swap -w 20% -c 10%
SWAP OK - 59%  free  (2251 MB out of 3823 MB) |swap=2251MB;764;382;0;3823

将该命令添加至nrpe.cfg文件中:

1
2
[root@kk libexec] #vi /usr/local/nagios/etc/nrpe.cfg
command [check_swap]= /usr/local/nagios/libexec/check_swap  -w 20% -c 10%

重启nrpe进程:

1
2
3
[root@kk libexec] #service nrped  restart
Stopping NRPE daemon...  done .
Starting NRPE daemon...  done .

2.监控端的配置

1
2
3
4
5
6
7
[root@monitors ~] # vim /usr/local/nagios/etc/objects/linuxserver.cfg 
define service{
use generic-service
host_name remotehost
service_description Swap Usage
check_command check_nrpe!check_swap
}

验证配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[root@monitors ~] # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  
Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL
Website: https: //www .nagios.org
Reading configuration data...
    Read main config  file  okay...
    Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 16 services.
Warning: Host  'kk'  has no default contacts or contactgroups defined!
Checked 2 hosts.
Checked 1 host  groups .
Checked 1 service  groups .
Checked 1 contacts.
Checked 1 contact  groups .
Checked 26 commands.
Checked 5  time  periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking  for  circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 1
Total Errors:   0
Things  look  okay - No serious problems were detected during the pre-flight check


重启nagios

1
2
3
4
[root@monitors ~] # service nagios restart
Running configuration check...
Stopping nagios:  done .
Starting nagios:  done .

刷新nagios监控页面:

wKiom1iisFnxHj4PAACfVZDgLxU614.png-wh_50

成功!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1 目标检测的定义 目标检测(Object Detection)的任务是找出图像中所有感兴趣的目标(物体),确定它们的类别和位置,是计算机视觉领域的核心问题之一。由于各类物体有不同的外观、形状和姿态,加上成像时光照、遮挡等因素的干扰,目标检测一直是计算机视觉领域最具有挑战性的问题。 目标检测任务可分为两个关键的子任务,目标定位和目标分类。首先检测图像中目标的位置(目标定位),然后给出每个目标的具体类别(目标分类)。输出结果是一个边界框(称为Bounding-box,一般形式为(x1,y1,x2,y2),表示框的左上角坐标和右下角坐标),一个置信度分数(Confidence Score),表示边界框中是否包含检测对象的概率和各个类别的概率(首先得到类别概率,经过Softmax可得到类别标签)。 1.1 Two stage方法 目前主流的基于深度学习的目标检测算法主要分为两类:Two stage和One stage。Two stage方法将目标检测过程分为两个阶段。第一个阶段是 Region Proposal 生成阶段,主要用于生成潜在的目标候选框(Bounding-box proposals)。这个阶段通常使用卷积神经网络(CNN)从输入图像中提取特征,然后通过一些技巧(如选择性搜索)来生成候选框。第二个阶段是分类和位置精修阶段,将第一个阶段生成的候选框输入到另一个 CNN 中进行分类,并根据分类结果对候选框的位置进行微调。Two stage 方法的优点是准确度较高,缺点是速度相对较慢。 常见Tow stage目标检测算法有:R-CNN系列、SPPNet等。 1.2 One stage方法 One stage方法直接利用模型提取特征值,并利用这些特征值进行目标的分类和定位,不需要生成Region Proposal。这种方法的优点是速度快,因为省略了Region Proposal生成的过程。One stage方法的缺点是准确度相对较低,因为它没有对潜在的目标进行预先筛选。 常见的One stage目标检测算法有:YOLO系列、SSD系列和RetinaNet等。 2 常见名词解释 2.1 NMS(Non-Maximum Suppression) 目标检测模型一般会给出目标的多个预测边界框,对成百上千的预测边界框都进行调整肯定是不可行的,需要对这些结果先进行一个大体的挑选。NMS称为非极大值抑制,作用是从众多预测边界框中挑选出最具代表性的结果,这样可以加快算法效率,其主要流程如下: 设定一个置信度分数阈值,将置信度分数小于阈值的直接过滤掉 将剩下框的置信度分数从大到小排序,选中值最大的框 遍历其余的框,如果和当前框的重叠面积(IOU)大于设定的阈值(一般为0.7),就将框删除(超过设定阈值,认为两个框的里面的物体属于同一个类别) 从未处理的框中继续选一个置信度分数最大的,重复上述过程,直至所有框处理完毕 2.2 IoU(Intersection over Union) 定义了两个边界框的重叠度,当预测边界框和真实边界框差异很小时,或重叠度很大时,表示模型产生的预测边界框很准确。边界框A、B的IOU计算公式为: 2.3 mAP(mean Average Precision) mAP即均值平均精度,是评估目标检测模型效果的最重要指标,这个值介于0到1之间,且越大越好。mAP是AP(Average Precision)的平均值,那么首先需要了解AP的概念。想要了解AP的概念,还要首先了解目标检测中Precision和Recall的概念。 首先我们设置置信度阈值(Confidence Threshold)和IoU阈值(一般设置为0.5,也会衡量0.75以及0.9的mAP值): 当一个预测边界框被认为是True Positive(TP)时,需要同时满足下面三个条件: Confidence Score > Confidence Threshold 预测类别匹配真实值(Ground truth)的类别 预测边界框的IoU大于设定的IoU阈值 不满足条件2或条件3,则认为是False Positive(FP)。当对应同一个真值有多个预测结果时,只有最高置信度分数的预测结果被认为是True Positive,其余被认为是False Positive。 Precision和Recall的概念如下图所示: Precision表示TP与预测边界框数量的比值 Recall表示TP与真实边界框数量的比值 改变不同的置信度阈值,可以获得多组Precision和Recall,Recall放X轴,Precision放Y轴,可以画出一个Precision-Recall曲线,简称P-R
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值