Tip of the day: Log files can use JSON logging. You can also send the JSON data to IRCOps on IRC.

The JSON is machine readable and contains lots of details about every log event.

JSON-RPC:Connthrottle

From UnrealIRCd documentation wiki
Jump to navigation Jump to search

The connthrottle.* JSON RPC calls allow you to control the Connthrottle module. Such as seeing the status and enabling/disabling the protection.

Below is the API for UnrealIRCd 6.2.3+. In UnrealIRCd 6.2.2 there also was a preliminary API but in 6.2.2 connthrottle.set did not work and connthrottle.status used different fields / a different structure.

API Calls

connthrottle.status

Get Connthrottle status.

Request arguments

None

Response

Returns connthrottle settings.

Example:

{
  "jsonrpc": "2.0",
  "method": "connthrottle.status",
  "id": 123,
  "result": {
    "enabled": true,
    "throttling_this_minute": false,
    "throttling_previous_minute": false,
    "state": "monitoring",
    "start_delay_remaining": 0,
    "reputation_gathering": false,
    "counters": {
      "local_count": 0,
      "global_count": 0
    },
    "stats_last_minute": {
      "rejected_clients": 0,
      "allowed_except": 0,
      "allowed_unknown_users": 0
    },
    "config": {
      "local_throttle_count": 20,
      "local_throttle_period": 60,
      "global_throttle_count": 30,
      "global_throttle_period": 60,
      "start_delay": 180,
      "except": {
        "identified": true,
        "reputation_score": 24
      }
    }
  }
}

Most of these fields should speak for themselves, but some additional info:

  • enabled: if this is false, the entire module is disabled (THROTTLE OFF) and won't monitor nor take any action
  • state can be one of
    • monitoring: module is actively monitoring but not blocking anyone (normal operations)
    • throttling: module is actively throttling connections (under attack)
    • disabled_by_oper: module is disabled (THROTTLE OFF)
    • start_delay: server just booted up (set::connthrottle::disabled-when::start-delay), module will not monitor nor take any action.
    • reputation_gathering: server is relatively new and does not have a good database with reputation scores yet (set::connthrottle::disabled-when::reputation-gathering), module will not monitor nor take any action.

connthrottle.set

Set Connthrottle protection.

Request arguments

Mandatory:

  • enabled: true or false

Response

{
  "jsonrpc": "2.0",
  "method": "connthrottle.set",
  "id": 1,
  "result": {
    "success": true,
    "enabled": "false",
  }
}

connthrottle.reset

Reset Connthrottle counters and timers.

Request arguments

None

Response

{
  "jsonrpc": "2.0",
  "method": "connthrottle.reset",
  "id": 1,
  "result": {
    "success": true
  }
}