Monitor batch pipelines via API and email alerts — install and deploy on Linux servers from PyPI
Project description
inferyx-monitoring — Server deployment
Monitor batch jobs from CSV, poll status via API, and send email alerts for failures, missed runs, long-running jobs, and missing API data.
Package: inferyx-monitoring
CLI: inferyx-monitoring
Paths
| Item | Path |
|---|---|
| Install directory | /opt/pipeline-monitor |
| Config | /opt/pipeline-monitor/.env |
| Batch list | /opt/pipeline-monitor/jfl_batch.csv |
| Log file | /opt/pipeline-monitor/pipeline_script.log |
| Python venv | /opt/pipeline-monitor/venv |
| Service user | inferyx |
| systemd unit | inferyx-monitoring.service |
1. Install
sudo apt update
sudo apt install -y python3 python3-venv python3-pip
Service user — check first; create only if missing:
id inferyx
If the command returns no such user, create the user:
sudo useradd --system --home-dir /opt/pipeline-monitor --shell /usr/sbin/nologin inferyx
If the user already exists, skip the command above and continue.
sudo mkdir -p /opt/pipeline-monitor
sudo chown inferyx:inferyx /opt/pipeline-monitor
sudo -u inferyx python3 -m venv /opt/pipeline-monitor/venv
sudo -u inferyx /opt/pipeline-monitor/venv/bin/pip install --upgrade pip inferyx-monitoring
2. Create config files (first time)
cd /opt/pipeline-monitor
sudo -u inferyx /opt/pipeline-monitor/venv/bin/inferyx-monitoring \
--init-config \
--work-dir /opt/pipeline-monitor
Creates .env and jfl_batch.csv only if missing.
pip install --upgrade never overwrites your live .env or jfl_batch.csv.
3. Configure .env
sudo -u inferyx vi /opt/pipeline-monitor/.env
sudo chmod 600 /opt/pipeline-monitor/.env
Required
| Variable | Description |
|---|---|
PIPELINE_SMTP_HOST |
SMTP server (e.g. smtp.office365.com) |
PIPELINE_SMTP_PORT |
SMTP port (usually 587) |
PIPELINE_SMTP_USERNAME |
SMTP login / sender email |
PIPELINE_FROM_NAME |
Display name in From header |
PIPELINE_SMTP_PASSWORD |
SMTP password |
PIPELINE_MAIL_TO |
Primary alert recipients (comma-separated) |
PIPELINE_API_BASE_URL |
API path only — no name= in URL |
PIPELINE_API_TOKEN |
API authentication token |
PIPELINE_API_TOKEN_HEADER |
Header name for token (usually token) |
PIPELINE_DEVOPS_EMAIL |
Recipient for no_data and script-failure alerts |
API example
PIPELINE_API_BASE_URL=http://your-host:8080/framework/metadata/getBaseEntityStatusByCriteria
PIPELINE_API_TOKEN=your_token_here
PIPELINE_API_TOKEN_HEADER=token
PIPELINE_API_FILTER_BY_SCHEDULE_DATE=false
- Use the base path only. The monitor adds
name=<batch>for each row injfl_batch.csv. - Keep
PIPELINE_API_FILTER_BY_SCHEDULE_DATE=falseunless your API supportsstartDate/endDate.
Email templates (optional)
| Variable | Purpose |
|---|---|
PIPELINE_MAIL_CC |
CC recipients |
PIPELINE_MAIL_SUBJECT_* |
Subject per alert: DEFAULT, NO_DATA, FAILED, RUNNING, MISSED |
PIPELINE_MAIL_BODY_* |
HTML body per alert (same keys as subjects) |
PIPELINE_MAIL_SIGNATURE |
HTML footer on every alert |
Placeholders: {batch_name}, {issue_type}, {issue_type_upper}, {status}, {error}, {error_line}, {expected_start_time}, {expected_end_time}, {frequency}, {avg_time}, {current_time}, {signature}
Scheduling (optional)
| Variable | Default | Meaning |
|---|---|---|
PIPELINE_CHECK_INTERVAL |
60 |
Seconds between poll cycles |
PIPELINE_SCHEDULE_GRACE_MINUTES |
5 |
Minutes after expected start before missed/no-data alerts |
PIPELINE_POST_RUN_GRACE_MINUTES |
60 |
Minutes after expected end to keep polling |
PIPELINE_ALERT_COOLDOWN_MINUTES |
60 |
Cooldown between repeat alerts |
PIPELINE_FAILED_ALERT_ONCE_PER_DAY |
true |
One failed alert per day per batch |
PIPELINE_ALERT_ONCE_PER_DAY_ALL_SCENARIOS |
true |
One alert per issue type per day |
4. Configure jfl_batch.csv
sudo -u inferyx vi /opt/pipeline-monitor/jfl_batch.csv
Rules:
- One batch per line.
- Quote values with commas:
"09:00,10:00","3 mins". - Use 24-hour time:
0:30:00,16:30:00.
| Column | Required | Description |
|---|---|---|
Name |
Yes | Batch name as in the API |
Frequency |
Yes | Daily, Hourly, Monthly, weekday name, etc. |
ExpectedStartTime |
Scheduled | 9:30:00 or "09:00,10:00,11:00" |
AvgExecutionTime |
Recommended | "3 mins", "10 mins", "1 Hr" |
ExpectedDayOfMonth |
Monthly | Day 1–31 |
Status |
Optional | Active or Suspended (default: Active) |
Example
Name,Frequency,ExpectedStartTime,AvgExecutionTime,ExpectedDayOfMonth,Status
batch_appdb_events,Daily,"09:00,10:00,11:00,12:00","3 mins",,Active
batch_appsflyer,Daily,0:30:00,"10 mins",,Active
batch_appdb_jiosense_bronze_silver,Daily,"01:00,08:00,15:00,21:00","12 mins",,Active
dashboard_batch_my_finances,Daily,5:45:00,"10 mins",,Active
dashboard_batch_ppl_rewards,Daily,6:50:00,"4 mins",,Active
batch_ignosis_part1,Daily,11:00:00,"80 mins",,Active
dashboard_batch_agentic,Daily,8:40:00,"10 mins",,Suspended
5. Test
sudo -u inferyx /opt/pipeline-monitor/venv/bin/inferyx-monitoring \
--once \
--work-dir /opt/pipeline-monitor \
--env-file /opt/pipeline-monitor/.env \
--csv-file /opt/pipeline-monitor/jfl_batch.csv
tail -100 /opt/pipeline-monitor/pipeline_script.log
6. Start service (systemd)
sudo tee /etc/systemd/system/inferyx-monitoring.service <<'EOF'
[Unit]
Description=Inferyx Pipeline Batch Monitor
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=inferyx
Group=inferyx
WorkingDirectory=/opt/pipeline-monitor
ExecStart=/opt/pipeline-monitor/venv/bin/inferyx-monitoring --work-dir /opt/pipeline-monitor --env-file /opt/pipeline-monitor/.env --csv-file /opt/pipeline-monitor/jfl_batch.csv
Restart=always
RestartSec=10
Environment=PYTHONUNBUFFERED=1
Environment=PIPELINE_ENV_FILE=/opt/pipeline-monitor/.env
Environment=PIPELINE_LOG_FILE=/opt/pipeline-monitor/pipeline_script.log
Environment=PIPELINE_CSV_FILE=/opt/pipeline-monitor/jfl_batch.csv
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now inferyx-monitoring.service
sudo systemctl status inferyx-monitoring.service
Logs:
sudo journalctl -u inferyx-monitoring.service -f
7. Upgrade package
When a newer version is available on PyPI:
sudo -u inferyx /opt/pipeline-monitor/venv/bin/pip install --upgrade inferyx-monitoring
sudo systemctl restart inferyx-monitoring.service
Your .env and jfl_batch.csv are not changed by upgrade.
Troubleshooting
| Symptom | Fix |
|---|---|
| API error / empty response | PIPELINE_API_FILTER_BY_SCHEDULE_DATE=false; remove name= from PIPELINE_API_BASE_URL |
| Wrong batch in API URL | Base URL must not contain a fixed batch name |
| CSV errors | One batch per line; quote "3 mins" and multi-times |
| No email | Check SMTP settings in .env |
| Skip a batch | Status=Suspended in CSV |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inferyx_monitoring-1.0.12.tar.gz.
File metadata
- Download URL: inferyx_monitoring-1.0.12.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b5bb0b364dab799e1744c283f5fd7dde07ed72f8727c1e5c38810ab94179e02
|
|
| MD5 |
b50889f0da6bc393e66e6681249da0ee
|
|
| BLAKE2b-256 |
dfe7f0febdff5d7a822ebd90559c72131f273575be6c49472a0b527f4006e3cc
|
File details
Details for the file inferyx_monitoring-1.0.12-py3-none-any.whl.
File metadata
- Download URL: inferyx_monitoring-1.0.12-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78288a2de577d77a3eb364abf5a192243dbb4d6aa7916d981f1901e7c66cdaa9
|
|
| MD5 |
5c272fb457eda482e3f88899d96455bb
|
|
| BLAKE2b-256 |
913201ff4b5b4857bab56fd29fee9f43b11f0ec264ce57e62883aee5c033f0d1
|