This repository contains a Python script that acts as a syslog server, receives syslog messages, parses them, and posts the parsed alerts to Zerto as checkpoints. The script also includes Keycloak authentication to obtain an access token required for Zerto API calls.
The syslog_to_zerto.py
script sets up a UDP syslog server that listens on port 514. Whenever a syslog message is received, the script parses the message, formats it into an alert, and sends the alert to Zerto as a checkpoint. The script uses Keycloak for authentication to obtain the access token needed for the Zerto API.
syslog_to_zerto.py
: The main script that sets up the syslog server, handles incoming syslog messages, and posts alerts to Zerto.send_syslog_message.py
: A helper script to send test syslog messages to the syslog server for testing purposes.
-
Clone the Repository: bash git clone https://github.com/yourusername/syslog-to-zerto.git cd syslog-to-zerto
-
Install Dependencies:
-
Ensure you have Python installed.
-
Install the required Python packages:
pip install requests
-
Update the following configuration variables in syslog_to_zerto.py
with your actual values:
zvmAddress
: IP address or DNS name of your Zerto Virtual Manager.keycloakClientID
: The client ID defined in Keycloak.keycloakClientSecret
: The client secret defined in Keycloak.vpgIdentifier
: The identifier for your Virtual Protection Group (VPG).verifyCertificate
: Set toFalse
if you want to disable SSL certificate verification.
- Run the Syslog Server: sudo python syslog_to_zerto.py
- Run the Test Script: python send_syslog_message.py