Gluing Systems Together Without Integration Packs
Every vendor has a page of logos. "Integrates with" your ticketing system, your chat tool, your inventory, your cloud. Behind each logo is an integration pack: a bundle of configuration and code, written by someone you will never meet, that promises to connect two products with a few clicks. Sometimes it does. Just as often you discover a problem. The pack maps the wrong fields, needs a licence tier you do not have, or breaks when either product updates. Or it does nine things you did not want and not the one thing you did.
This guide makes the honest case for the alternative: small pieces of glue. These are scripts of a few dozen lines that move one kind of information from one system to another. They are written by you, understood by you, and fixable by you at two in the morning. The guide covers the four patterns that build nearly all such glue and works through the four connections admins most often want. Then, because glue that nobody maintains becomes a liability, it spends real time on keeping it versioned, documented, monitored, and safe to re-run. It closes with the cases where a vendor integration genuinely is the better choice, because sometimes it is.
In this guide
- The honest case for small glue
- Pattern 1: email-to-script, the universal integration
- Pattern 2: webhook, tiny receiver, action
- Pattern 3: the scheduled sync
- Pattern 4: a queue or file drop for decoupling
- Four connections worth building
- Maintaining the glue
- When a vendor integration is the right choice
- Where to go next
The honest case for small glue
A fifty-line script you understand beats a thousand-line integration you do not, for one reason: when it breaks, and everything breaks eventually, you can read it. You can see which field it expected and which one arrived instead. You can add a line of logging, run it by hand, and watch. An integration pack that fails gives you a red icon and a support ticket.
Glue also does exactly what you want and nothing else. An alert-to-ticket pack might insist on creating a ticket for every alert, including the ones you have already tuned to be informational. Your script creates tickets for the alerts you say, with the fields you choose, in the queue you name. And glue is honest about its dependencies: it uses the monitor's API or email, the ticketing system's API or email, and a scheduler. When either product changes, the fix is usually one line.
The trade is that you own it. Nobody will update your script when the ticketing API changes; nobody will document it if you do not. That ownership is manageable, and the second half of this guide is about managing it. But it is real, and it is why the last section exists. Now the patterns. All four assume the vocabulary from APIs and webhooks in plain language.
Pattern 1: email-to-script, the universal integration
Every monitoring system on earth can send email. Every ticketing system, most chat tools, and most other systems can receive it or expose a mailbox. That makes email the integration surface that always exists, even when nothing else does, and it deserves more respect than it usually gets.
The pattern has two halves. The monitor sends an alert email to a dedicated mailbox, say alerts-in@example.local. Something watches that mailbox and acts. It could be a mailbox rule that runs a script when a matching message arrives. Or it could be a small script on a schedule. That script reads the mailbox over a standard mail protocol, processes new messages, and marks them read. In either case, the script parses the message, extracts the host, severity, and text, and does whatever the integration is for: creates a ticket, posts to chat, runs a command.
The whole thing lives or dies on the parsing, so make the email machine-readable on purpose. Most monitors let you customise the notification template. Use a rigid subject line and a body of key: value lines rather than prose:
Subject: [MON] CRITICAL sw-core-01 Interface Gi1/0/24 down host: sw-core-01 check: interface-gi1/0/24 state: CRITICAL alert_id: 981 started: <timestamp> message: Interface Gi1/0/24 operational status down console: https://monitor.example.local/alerts/981
A script that reads that does not need cleverness; a regular expression on the subject and a split on colons for the body is enough:
import re
SUBJECT = re.compile(r"^\[MON\] (?P<state>\w+) (?P<host>\S+) (?P<text>.*)$")
def parse(subject, body):
m = SUBJECT.match(subject)
if not m:
return None # not one of ours; ignore
fields = dict(line.split(":", 1) for line in body.splitlines() if ":" in line)
fields = {k.strip(): v.strip() for k, v in fields.items()}
fields.update(m.groupdict())
return fields
Three gotchas. Send plain text, not HTML, or the script will be parsing tags. Give every message its own subject rather than letting the mail client thread replies together. And guard against loops: if the script's own actions can generate email into the same mailbox, it will happily process its own output forever. Filter on the sender and on the [MON] tag, and never reply to the mailbox from the script. The cost of this pattern is latency, typically a minute or two for mail delivery and the script's schedule. That is fine for tickets and wrong for anything urgent.
Pattern 2: webhook, tiny receiver, action
When the monitor can send a webhook, an HTTP call to a URL of yours the moment an alert changes, the email delay disappears. What you need on your side is a receiver: a very small web service that accepts the call, checks it is genuine, and hands the event on. The receiver should do as little as possible, because every second it spends is a second the monitor waits for a reply. A slow receiver gets its calls timed out and possibly lost. Here is one in a standard-library sketch, deliberately minimal:
from http.server import BaseHTTPRequestHandler, HTTPServer
import json, os, uuid
TOKEN = os.environ["HOOK_TOKEN"]
QUEUE = "/var/spool/glue/incoming"
class Hook(BaseHTTPRequestHandler):
def do_POST(self):
if self.headers.get("X-Hook-Token") != TOKEN:
self.send_response(401); self.end_headers(); return
length = int(self.headers.get("Content-Length", 0))
body = self.rfile.read(length)
try:
json.loads(body) # is it even JSON?
except ValueError:
self.send_response(400); self.end_headers(); return
with open(f"{QUEUE}/{uuid.uuid4()}.json", "wb") as f:
f.write(body) # park it, fast
self.send_response(200); self.end_headers()
HTTPServer(("127.0.0.1", 8080), Hook).serve_forever()
Read what it does and does not do. It checks a shared token in a header, rejects anything that is not JSON, writes the payload to a file in a queue folder, and says 200. It does not create the ticket, post to chat, or run anything; that is a separate worker's job, which is Pattern 4. It listens on the local address only, because in real use it sits behind a reverse proxy. That proxy terminates TLS and, ideally, restricts which source addresses may reach it. The details are in API security and hygiene. In the monitor, you register https://glue.example.local/hook as a webhook target, choose which alert events trigger it, and paste the token into the header configuration.
Pattern 3: the scheduled sync
The third pattern needs no listener and no mailbox. A script runs on a schedule, pulls from system A, pushes to system B, and logs what it did. It is the workhorse for anything where "within the hour" is soon enough. Examples include keeping the ticketing system's asset list in step with the monitor's device list, or the monitor's device list in step with the inventory. Other examples are refreshing a dashboard's data file, or reconciling which alerts have tickets and which do not.
# the shape of every sync script
source_items = pull_from_a() # paginate, filter server-side
target_items = pull_from_b() # so you can diff, not blindly write
for item in source_items:
if item.key not in target_items:
create_in_b(item) # log: created
elif differs(item, target_items[item.key]):
update_in_b(item) # log: updated
else:
pass # log nothing; most rows are unchanged
write_heartbeat("sync-a-to-b", ok=True, created=n_created, updated=n_updated)
Several details separate a good sync from a dangerous one. It diffs before writing, so that running it twice changes nothing the second time. It never deletes on its own, but reports what it would delete for a human to confirm. A bad pull that returns an empty list would otherwise wipe the target. It has a --dry-run flag that logs the plan without acting. And it ends by recording that it ran, which becomes the heartbeat discussed below. The mechanics of the pull half are in pulling data out and of the push half in pushing events in.
Pattern 4: a queue or file drop for decoupling
The receiver in Pattern 2 wrote each event to a folder and stopped. That folder is a queue, and the idea of putting one between "receiving" and "acting" is the most useful trick in this guide. A separate worker script, on a schedule or watching the folder, picks up each file and acts on it. Then it moves the file to a done folder on success or a failed folder on error.
Why bother? Because it separates two things that fail differently. The receiver must be fast and always available, and now it is, since all it does is write a file. The worker can be slow, can retry, and can be stopped for maintenance. It can be run again by hand against the failed folder when the ticketing system comes back from its outage. You also get a replay button for free: if the worker had a bug, fix it and move the affected files back into incoming. And you get an audit trail without trying, because every event that ever arrived is sitting in a folder with a timestamp. A folder of JSON files is not glamorous, but it is a queue, and it needs no extra software.
Four connections worth building
Alert to ticket
The monitor raises an alert. A ticket appears in the right queue with the host, the check, the time, and a link back to the console. The ticket number is written back to the alert as an acknowledgement. Email-to-script or webhook-plus-receiver both work; the worker calls the ticketing system's API or, if it has none, emails its intake address. The hard part is not creation but lifecycle: when the alert clears, should the ticket close, get a comment, or stay for a human? Decide that up front, and match it to the states in the alert lifecycle. The full design space, including two-way sync, is covered under Monitoring, Ticketing and ITSM.
Alert to chat
The same event, posted as a message to the team channel. Most chat tools accept a simple inbound webhook of their own, so the worker is a few lines. It formats the alert into one readable line with a link and POSTs it. Resist the temptation to send everything; a channel that receives every warning becomes wallpaper within a week. Send state changes for the severities people should see, and think about who reads the channel and when. The ChatOps and Monitoring guides go into what belongs in chat and what does not.
Inventory to monitoring
The direction people forget. If your inventory or asset system is the source of truth for what exists, a scheduled sync can pull it. That sync can create or update devices in the monitor. So a server added to the inventory is monitored by the next run without anyone clicking through a wizard. Tag devices with the inventory's owner and environment fields and your alert routing can use them. This is the small-scale start of treating monitoring configuration as data, which Monitoring as Code takes much further.
Alert to remediation script
The alert fires and a script tries the fix: restart the service, clear the temporary folder, bounce the port. This is where glue is most powerful and most dangerous. Keep the receiver and the worker separate. Put a hard limit on how often the same fix may run for the same host; log every action. And make the script post its own result back to the monitor so that a fix that did not work is visible. The guardrails, the rollback thinking, and the question of what should never be automated are in Auto-Remediation, which is worth reading in full before the first restart script goes live.
Maintaining the glue
Here is the uncomfortable truth about glue: the script you wrote in an afternoon will still be running in five years. It will be on a server nobody remembers building, holding a token nobody remembers issuing. The practices that prevent that are cheap if adopted on day one and expensive to retrofit.
- Version control, from the first line. Every glue script lives in a repository. Not a shared folder, not the scheduler's own directory; a repository with history, so that "what changed last Tuesday" has an answer.
- A README per script. Five lines: what it reads, what it writes, where it runs, which credential it uses and where that credential lives, and who owns it. Future you is the reader.
- Monitor the glue itself. Every script writes a heartbeat at the end of a successful run. Ideally, that is an inbound event to the monitor with the script name as the check. A freshness rule alerts when the heartbeat stops. A sync that silently stops running is worse than no sync, because everyone believes it is working.
- Retry, but with limits. Transient failures get a few retries with a growing delay; persistent failures get logged and surfaced, not retried forever. Never let a retry loop become its own outage.
- Idempotency everywhere. Design every action so that doing it twice is harmless. Look before creating a ticket, send state rather than "something happened," and key everything on a stable identifier from the source system.
- Log like you will need it. One line per action with a timestamp, the identifiers involved, and the outcome. Rotate the logs. When the ticketing team asks why ticket 4471 was opened, the answer should be a search away.
- Credentials outside the code. Tokens live in a secrets store or a protected file, never in the script or the repository. Rotate them on a schedule and when the person who created them leaves.
Tip: keep a single page, in the same repository, that lists every piece of glue you run: name, direction, schedule, host, owner. It takes ten minutes to create and it is the first thing you will reach for during a migration, an audit, or a departure. Glue that is not on the list is glue that will surprise you.
When a vendor integration is the right choice
The case for glue is strong, but it is not universal. A vendor integration earns its place when the connection needs to be rich and bidirectional. That means dozens of fields kept in sync both ways, ticket state changes flowing back into alert state, comments mirrored, attachments carried across. Writing and maintaining that yourself is a project, not a script. A vendor integration also earns its place when both products change often and the vendor commits to keeping the integration working. Another case is when an audit or compliance requirement wants a supported, documented path rather than a home-grown one. And another is when the team that would maintain the glue is one person who is already stretched.
A useful test: sketch the glue on paper. If it is one direction, one event type, and a handful of fields, write it. If the sketch needs a second page, look at the pack, and read its documentation to see exactly what it does before turning it on. And even when you adopt a vendor integration, keep the habits above: know which credential it uses, monitor that it is working, and keep a note of where its configuration lives.
Patterns, when to use them, and their risks
| Pattern | Use it when | Main risks |
|---|---|---|
| Email-to-script | The monitor has no API or webhook; a minute or two of delay is acceptable; the receiving system takes email anyway | Fragile parsing of prose emails; mail loops; HTML mail; silent failure when the template changes |
| Webhook to tiny receiver | Seconds matter; the monitor can send webhooks; you can run and expose a small service safely | Receiver down means lost events unless the sender retries; an exposed endpoint needs real protection; a slow receiver gets timed out |
| Scheduled sync | Keeping two lists in step; within-the-hour freshness is fine; no listener wanted | Blind writes that clobber the target; deletions from a bad pull; drift when the script stops and nobody notices |
| Queue or file drop | Any time receiving and acting have different reliability needs; when you want replay and audit | A worker that stops leaves a growing folder; failed items need a human to look at them |
| Alert to remediation | A known problem with a known safe fix, bounded in frequency and scope | Runaway fixes; masking the real cause; fixing the wrong host from a mis-parsed payload |
| Vendor integration pack | Rich two-way sync; frequent product changes; compliance wants a supported path; no one to maintain glue | Does more than you want; opaque failures; licence and version dependencies; you still own the credential |
Where to go next
Four patterns build almost every integration you will ever need. There is email-to-script when nothing else exists, and a webhook into a tiny receiver when speed matters. There is a scheduled sync for keeping lists in step, and a queue between receiving and acting so that each can fail on its own terms. With the discipline of version control, a README, a heartbeat, bounded retries, and idempotent actions, that glue will outlast most integration packs. It will always be readable at two in the morning. And when a connection is genuinely rich and two-way, the honest move is the vendor's pack, watched with the same care.
The pieces this guide leans on each have their own treatment. Pulling data out covers the read side. And pushing events in covers the write side. And API security and hygiene covers the tokens, allowlists, and signatures every one of these patterns depends on. The pillar page Monitoring APIs and Webhooks collects them.
Put this into practice with SysPeep Monitor
Email-to-script is the pattern that works with every monitor, and it works better when the notifications are worth parsing. SysPeep Monitor sends email and other notifications on every alert. Its thresholds and dependency rules keep the noise down before it reaches your mailbox rule. Its reports and dashboards round out the integration surface; check the product documentation for what else is exposed. The free trial installs on a Windows machine if you want to see the notifications you would be gluing to.
Download Free TrialLearn About SysPeep