Skip to main content

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 (default)

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. Prerequisites

  • Linux with systemd (Ubuntu 20.04+ / 22.04)
  • Python 3.9+
  • Outbound network to PyPI, SMTP, and your batch API
  • sudo for systemd
sudo apt update
sudo apt install -y python3 python3-venv python3-pip

2. Install from PyPI

sudo useradd --system --home-dir /opt/pipeline-monitor --shell /usr/sbin/nologin inferyx || true
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

Private index:

sudo -u inferyx /opt/pipeline-monitor/venv/bin/pip install inferyx-monitoring \
  --index-url https://your-private-pypi/simple/

3. Create config (first time)

cd /opt/pipeline-monitor
sudo -u inferyx /opt/pipeline-monitor/venv/bin/inferyx-monitoring --init-config --work-dir .

Creates .env and jfl_batch.csv only if missing.
pip install --upgrade never overwrites your live .env or jfl_batch.csv.

Edit config:

sudo -u inferyx vi /opt/pipeline-monitor/.env
sudo -u inferyx vi /opt/pipeline-monitor/jfl_batch.csv
sudo chmod 600 /opt/pipeline-monitor/.env

Required .env keys

Variable Description
PIPELINE_SMTP_HOST SMTP hostname
PIPELINE_SMTP_PORT SMTP port (e.g. 587)
PIPELINE_SMTP_USERNAME SMTP login
PIPELINE_FROM_NAME From display name
PIPELINE_SMTP_PASSWORD SMTP password
PIPELINE_MAIL_TO Alert recipients
PIPELINE_API_BASE_URL Batch API URL ({name} placeholder allowed)
PIPELINE_API_TOKEN API token
PIPELINE_API_TOKEN_HEADER Token header (token or Authorization)
PIPELINE_DEVOPS_EMAIL no_data / script-failure recipient

Optional: PIPELINE_MAIL_CC, PIPELINE_MAIL_SUBJECT_*, PIPELINE_MAIL_BODY_*, PIPELINE_MAIL_SIGNATURE, PIPELINE_SCHEDULE_GRACE_MINUTES, PIPELINE_CHECK_INTERVAL. See .env.example after --init-config.

jfl_batch.csv columns

Column Required Notes
Name Yes Batch name in API
Frequency Yes Daily, Hourly, Monthly, weekday name, etc.
ExpectedStartTime Scheduled e.g. 9:30, 16:30:00, 12:00,15:00,18:00
AvgExecutionTime Recommended e.g. 10 mins, 1 Hr
ExpectedDayOfMonth Monthly Day 1–31
Status Optional Active or Suspended (default: Active)

Example:

Name,Frequency,ExpectedStartTime,AvgExecutionTime,ExpectedDayOfMonth,Status
ppl_example,Daily,9:30:00,"10 mins",,Active

4. Test

sudo -u inferyx /opt/pipeline-monitor/venv/bin/inferyx-monitoring \
  --once --work-dir /opt/pipeline-monitor

tail -100 /opt/pipeline-monitor/pipeline_script.log

5. systemd service

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
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

[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


6. Upgrade

sudo -u inferyx /opt/pipeline-monitor/venv/bin/pip install --upgrade inferyx-monitoring
sudo systemctl restart inferyx-monitoring.service

7. Cron (optional, instead of systemd)

* * * * * /opt/pipeline-monitor/venv/bin/inferyx-monitoring --once --work-dir /opt/pipeline-monitor >> /opt/pipeline-monitor/cron.log 2>&1

Troubleshooting

Symptom Check
Service won't start journalctl -u inferyx-monitoring.service -n 50
No email SMTP credentials and firewall on port 587/465
No API data API URL, token, batch names in CSV
Missed alert timing Use 24h time (16:30:00); PIPELINE_SCHEDULE_GRACE_MINUTES
Skip a batch Status=Suspended in CSV

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inferyx_monitoring-1.0.10.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inferyx_monitoring-1.0.10-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file inferyx_monitoring-1.0.10.tar.gz.

File metadata

  • Download URL: inferyx_monitoring-1.0.10.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for inferyx_monitoring-1.0.10.tar.gz
Algorithm Hash digest
SHA256 6cb468fec3b0cbc1891063eb6301543df67394454cbb506026283deb76648c89
MD5 486fd576d24b96d453c774c6542d9d69
BLAKE2b-256 4ed42ab688b3c374e03ab3044647c5f49bcb5d2535b6dfc90e6982f2f09ba4d7

See more details on using hashes here.

File details

Details for the file inferyx_monitoring-1.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for inferyx_monitoring-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 810f4ae9c142abe0aeeab90c3235e95754941304ca4bdc8fc6baae1d63c196af
MD5 ec1a09b924c2418dbac34f61a43dfa66
BLAKE2b-256 c974d2e126b27f2c88883ba163d852b23453898dee212426f376cf706e21a0f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page