Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jalmargyyk/ripe-updater/llms.txt

Use this file to discover all available pages before exploring further.

After every POST, PUT, or DELETE request to the RIPE database — whether it succeeds or fails — RIPE Updater can send you an email report. Each report contains the action taken, the prefix affected, the HTTP response code, any error messages returned by RIPE, a diff of what changed (for updates), the username of the NetBox user who triggered the webhook, and the hostname and IP of the RIPE Updater instance. This makes it straightforward to audit changes, catch failures early, and trace every RIPE DB modification back to the operator who made it in NetBox.

Enabling email reporting

Set MAIL_REPORT=yes and configure your SMTP connection. All four variables below are required when email reporting is enabled.
VariableDefaultDescription
MAIL_REPORTnoSet to yes to enable email reporting
SMTP127.0.0.1Hostname or IP address of your SMTP server
SMTP_STARTTLSnoSet to yes to use STARTTLS when connecting
SENDER_MAILFrom address for outgoing reports
RECIPIENT_MAILDestination address for all reports
MAIL_REPORT=yes
SMTP=smtp.example.com
SMTP_STARTTLS=yes
SENDER_MAIL=ripe-updater@example.com
RECIPIENT_MAIL=noc@example.com
RIPE Updater connects to your SMTP server using Python’s smtplib. If SMTP_STARTTLS=yes, STARTTLS is negotiated after the connection is established. No authentication is configured beyond STARTTLS — if your SMTP server requires credentials, consider using an authenticated relay.
Set MAIL_REPORT=no during initial setup and template testing to avoid noisy reports while you iterate. Switch to yes when you are ready to go live.

When emails are sent

An email is sent after every RIPE REST API call — POST, PUT, and DELETE — regardless of whether the call succeeded or failed. The email is dispatched by the notify() function in functions.py, which is called at the end of post_object(), put_object(), and delete_object(). This means you are always notified even when something goes wrong, so failures in RIPE DB do not go unnoticed.

Email content

Each report is a plain-text email structured as follows:
FieldSource
Subject{ACTION} {prefix} has {succeeded|failed}
ActionHTTP method: POST, PUT, or DELETE
PrefixThe CIDR prefix that was operated on
Statussucceeded if response code is 200, otherwise failed
Response codeRaw HTTP status code from the RIPE REST API
Response codes docLink to the RIPE WHOIS REST API documentation for that action
RIPE errorsError messages extracted from the RIPE API response body
Object diffFor PUT requests: a unified diff of the old vs. new object
Triggered byThe NetBox username from webhook['username']
FQDNHostname of the RIPE Updater server
RIPE-Service source IPResolved IP address of the RIPE Updater server
text = f"""{action} inetnum {prefix} has {status}:
{ripe_errors}
----------------
{ripe_object}
Result: {status}
Action: {action}
Response code: {str(response_code)}
Response codes doc: {RIPE_DOCU_URLS[action]}
Triggered by: {username}
FQDN: {hostname}
RIPE-Service source IP: {ipaddr}
----------------

For more informations check logs

Your awesome RIPE-Service!"""
The ripe_object section contains either the full new object (for POST and DELETE) or a line-by-line diff (for PUT), with + and - prefixes showing what changed.

Example PUT report

The following is a realistic example of what an update email looks like when a prefix’s country attribute is changed from DE to NL:
Subject: PUT 192.0.2.0/24 has succeeded

PUT inetnum 192.0.2.0/24 has succeeded:

----------------
  inetnum:        192.0.2.0 - 192.0.2.255
  netname:        CLOUD-POOL
  org:            ORG-EXMP1-RIPE
- country:        DE
+ country:        NL
  admin-c:        AA1-RIPE
  tech-c:         AA1-RIPE
  status:         ASSIGNED PA
  mnt-by:         EXAMPLE-MNT
  source:         RIPE

Result: succeeded
Action: PUT
Response code: 200
Response codes doc: https://github.com/RIPE-NCC/whois/wiki/WHOIS-REST-API-Update
Triggered by: jsmith
FQDN: ripe-updater.example.com
RIPE-Service source IP: 203.0.113.10
----------------

For more informations check logs

Your awesome RIPE-Service!
Email is sent even when the RIPE API returns an error. If a POST fails due to an overlap that cannot be automatically resolved, for example, you will still receive a report with the RIPE error messages and the HTTP response code — so you can investigate and act manually.

Build docs developers (and LLMs) love