connections

check_connections

Checks the number of tcp connections.

Implementation

WindowsLinuxFreeBSDMacOSX

Examples

Default Check

check_connections
OK - total connections 60

Check only ipv6 connections:

check_connections inet=ipv6
OK - total ipv6 connections 13

Example using NRPE and Naemon

Naemon Config

define command{
    command_name         check_nrpe
    command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$
}

define service {
    host_name            testhost
    service_description  check_connections
    use                  generic-service
    check_command        check_nrpe!check_connections!'warn=total > 500' 'crit=total > 1500'
}

Argument Defaults

ArgumentDefault Value
filterinet=total
warningtotal > 1000
criticaltotal > 2000
empty-state0 (OK)
empty-syntax
top-syntax%(status) - ${list}
ok-syntax
detail-syntaxtotal ${prefix}connections: ${total}

Check Specific Arguments

ArgumentDescription
inetUse specific address family only. Can be: total, any, ipv4 or ipv6

Attributes

Filter Keywords

these can be used in filters and thresholds (along with the default attributes):

AttributeDescription
inetaddress family, can be total (sum of any), all (any+total), any (v4+v6), inet4 or inet6
prefixaddress family as prefix, will be empty, inet4 or inet6
totaltotal number of connections
establishedtotal number of connections of type: established
syn_senttotal number of connections of type: syn_sent
syn_recvtotal number of connections of type: syn_recv
fin_wait1total number of connections of type: fin_wait1
fin_wait2total number of connections of type: fin_wait2
time_waittotal number of connections of type: time_wait
closetotal number of connections of type: close
close_waittotal number of connections of type: close_wait
last_acktotal number of connections of type: last_ack
listentotal number of connections of type: listen
closingtotal number of connections of type: closing
new_syn_recvtotal number of connections of type: new_syn_recv