Import/Export Data Monitoring
Monitor your file exchanges and data flows
Data imports and exports are the arteries of many businesses. EDI flows with suppliers, accounting exports to the accountant, catalog exchanges with marketplaces, automatic reports for management - these daily processes must work flawlessly.
Yet file flows are notoriously fragile. A partner who changes their format without warning, an unavailable FTP server, an erroneously generated empty file - causes of failure are numerous. And when a flow fails silently, consequences can be severe: unprocessed orders, missed invoices, desynchronized inventory.
Heartbeat monitoring provides the necessary visibility into these critical flows. Each import and export signals its execution, metrics, and result. If a flow fails or shows an anomaly, the alert is immediate.
Concrete Use Cases
Import/export monitoring applies to many business scenarios:
Supplier Catalog Import
Every day, your suppliers send catalog updates: new products, price changes, stock levels. Monitor that the file arrives on time, format is correct, and import executes without errors. A missed import can mean incorrect prices or unavailable products.
Accounting Export
Accounting entries must be exported to the accountant's software. Monitor that the export generates, file contains the right number of entries, and it's successfully deposited on the remote server. A missed export delays monthly closing.
EDI Exchanges (Orders, Invoices)
EDI (Electronic Data Interchange) with large retailers or logistics providers is critical. Orders arrive via EDI, shipping notices and invoices go out via EDI. An unprocessed EDI message can block a shipment or create disputes.
Automatic Reports
Daily sales reports, weekly dashboards, monthly financial statements - these exports must arrive on time for management meetings. Monitor their generation and delivery.
Import Monitoring
A reliable import should be verified at multiple levels:
- Reception: Did the file arrive on time? Whether via FTP, email, or API, verify its presence.
- Format: Does the file follow the expected format? Encoding, separators, required columns.
- Volume: Is the row count consistent? An empty or abnormally small file is suspicious.
- Processing: Did the import execute without errors? Count rows processed vs skipped/errored.
Export Monitoring
A reliable export should also be verified:
- Generation: Did the export run at the scheduled time? The generation process can fail.
- Deposit: Was the file deposited successfully? FTP, SFTP, S3, email - check the return code.
- Content: Does the file contain the right data? Consistent size, expected row count.
- Confirmation: Did the recipient acknowledge receipt? For critical flows, verify the response.
Monitored Import Script
Here's an example of monitoring integration in an import script:
#!/bin/bash
# import_catalog.sh - Supplier catalog import with monitoring
HEARTBEAT_URL="https://monitao.com/ping/YOUR_TOKEN"
IMPORT_DIR="/data/imports"
EXPECTED_FILE="catalog_$(date +%Y%m%d).csv"
# Check file reception
if [ ! -f "$IMPORT_DIR/$EXPECTED_FILE" ]; then
curl -s "$HEARTBEAT_URL/fail?error=file_not_received" > /dev/null
exit 1
fi
# Check format (at least 2 columns, header)
LINES=$(wc -l < "$IMPORT_DIR/$EXPECTED_FILE")
if [ "$LINES" -lt 2 ]; then
curl -s "$HEARTBEAT_URL/fail?error=file_empty&lines=$LINES" > /dev/null
exit 1
fi
# Run import
RESULT=$(php /app/import_catalog.php "$IMPORT_DIR/$EXPECTED_FILE" 2>&1)
EXIT_CODE=$?
# Extract metrics
IMPORTED=$(echo "$RESULT" | grep "imported:" | cut -d: -f2)
ERRORS=$(echo "$RESULT" | grep "errors:" | cut -d: -f2)
if [ $EXIT_CODE -eq 0 ] && [ "$ERRORS" -eq 0 ]; then
curl -s "$HEARTBEAT_URL?imported=$IMPORTED&lines=$LINES" > /dev/null
else
curl -s "$HEARTBEAT_URL/fail?imported=$IMPORTED&errors=$ERRORS&lines=$LINES" > /dev/null
fi
This script verifies each step: file reception, valid format, processing. Metrics enable trend analysis.
Alert Configuration
Configure alerts tailored to each problem type:
- File not received: Expected import didn't arrive on time. Contact partner or check source server.
- Invalid format: File doesn't match expected format. Partner may have changed their structure.
- Export failed: Generation or deposit of export failed. Check logs and connectivity.
- Abnormal volume: Far fewer rows than usual. Source-side problem or truncated file.
Import/Export Checklist
- Inventory of all import and export flows
- Heartbeat created for each flow with appropriate delay
- Format and volume validations implemented
- Scripts instrumented with pings and metrics
- Alerts configured with proper recipients
- Recovery procedures documented
Frequently Asked Questions
Import file sometimes arrives late. How to handle?
Configure the heartbeat with a grace period matching acceptable tolerance (e.g., 2h after theoretical time). If file isn't processed within this delay, alert triggers. Adjust delay based on lateness history.
How do I know if my FTP/SFTP export succeeded?
Check the return code of the ftp/sftp/scp command. Code 0 = success. Some servers return success even when upload fails - verify by listing the remote file after upload to confirm presence and size.
My partner doesn't always send the file. How do I prove missing deliveries?
Document agreed SLAs, configure monitoring with history, and generate monthly incident reports (missing files, late, invalid). Share this report with partner during quality reviews.
How do I handle empty or incomplete files?
Add validations before considering import successful: minimum row count, required column presence, checksum if provided by partner. Send fail ping if validation fails.
How do I monitor imports arriving at variable times?
Two options: 1) A heartbeat with wide window (e.g., "must arrive between midnight and 6am"). 2) A script that watches the directory and pings as soon as a new file arrives. No ping after a certain delay triggers alert.
How do I handle multiple import files per day from the same partner?
Create one heartbeat per file type if their schedules or criticality differ. Otherwise, a single heartbeat can monitor all by counting files processed and alerting if count is below expected.
Secure Your Data Flows
Data imports and exports are often the weak link in automated processes. A file that doesn't arrive, an export that silently fails - these problems can go unnoticed for days with significant operational consequences.
With MoniTao, you have complete visibility into your file flows: reception, processing, deposit. You're alerted immediately when problems occur, and you have the history to analyze trends and discuss with your partners.
Ready to Sleep Soundly?
Start free, no credit card required.