// case file 07 · Automation & monitoring

Infrastructure Monitoring, Alert Engineering & MSP Automation

Keeping a FortiGate fleet healthy and making monitoring tell the truth: an automation stitch that mitigates a known Node.js memory leak on FortiGate 50Gs, firmware lifecycle work across FortiOS releases, a fleet-level conserve-mode recovery design for 43 devices, and alert and documentation automation.

status
Implemented mitigation + fleet design
role
System Administrator II; author of the team’s Fortinet procedures
context
MSP monitoring across many customer sites
client
██████████

01Executive summary

Monitoring is only useful if the alert that wakes someone up is real and the alert that matters is not buried. Automation is only useful if it is safer than the person it replaces.

This case study covers both: a per-device automation stitch that mitigates a documented Node.js memory leak on FortiGate 50G firewalls, written up as the team’s first Fortinet standard operating procedure; FortiOS firmware lifecycle work; a fleet-level health and recovery design for a 43-device FortiManager environment; and the alert and documentation automation around them.

02Disciplines & technologies

Disciplines

  • Monitoring & alerting
  • Automation design
  • Fleet management
  • Firmware lifecycle
  • Scripting
  • Change risk management

Technologies

  • FortiGate 50G / 70G
  • FortiOS 7.6.6 / 8.0
  • FortiOS automation stitches
  • FortiManager
  • FortiGate Cloud
  • Datto RMM
  • PowerShell
  • Rewst
  • IT Glue
  • GitHub

03The problem

FortiGate 50G firewalls on FortiOS 7.6.6 have a documented memory leak in an internal Node.js process. Memory climbs until the unit approaches or enters conserve mode, where it can start dropping new sessions or skipping inspection. Rebooting buys time but does not stop it coming back.

Around that sits the usual monitoring problem: when a site goes dark, a VPN alert, offline devices, a failed WAN link and an unreachable firewall all arrive at once for one cause.

04Environment & complexity

Scale & variety

  • FortiGate 50Gs and 70Gs across many customer sites
  • A 43-device FortiManager-managed environment
  • Firmware moving through FortiOS 7.6.6, 8.0.0 and 8.0.1
  • Several alert sources: RMM, firewall, VPN, SOC

Risk factors

  • Automated actions on production firewalls
  • Firmware upgrades that can strip custom automation configuration
  • Firmware changes that can break remote-access authentication
  • Loops: automation that keeps acting on a device that keeps failing

05My contributions

  • Built and documented the Node.js leak mitigation stitch and its standard operating procedure: baseline, deployment, five-point verification, documentation and rollback
  • Tested FortiGate Cloud CLI scripts as a deployment path and abandoned it when the Cloud parser broke the script’s shell variables
  • Established the GUI-plus-SSH deployment method after finding that only GUI-created actions get the admin profile the kill command needs
  • FortiGate 50G firmware management and troubleshooting across FortiOS 8.0.0 and 8.0.1, including SAML VPN regressions
  • Designed and assessed fleet-level health monitoring and automated recovery for a 43-device FortiManager environment
  • VPN and WAN alert refinement and false-positive reduction
  • RMM components for silent runtime installs with status reported fleet-wide
  • A scheduled Rewst workflow syncing IT Glue documentation to GitHub every eight hours, excluding credentials

06Featured: the 50G memory leak

The mitigation

An hourly automation stitch on each FortiGate checks memory. Below 75% it only writes a log line. At 75% or higher, if the Node.js process is running, it kills it and logs the action. The process does not respawn on its own, so memory is released until the leak builds up again.

Triggerscheduled · hourlyCheck memoryperformance statusBelow 75%log · do nothing75% or highernode running?Kill nodefnsysctl killallLog resultevent log
Per-device FortiOS automation stitch. Killing node causes a brief management-plane pause; traffic is not affected.
Trigger and stitch (CLI excerpt)
› config system automation-trigger
  › edit "Memory check every 1 hour"
  › set trigger-type scheduled
  › set trigger-frequency hourly
  › next
› end
› config system automation-stitch
  › edit "Process node memory monitor"
  › set trigger "Memory check every 1 hour"
  › next
› end

What made it tricky

  1. PermissionsAn action created in the CLI does not get the super_admin profile, so the kill command fails silently when the stitch fires. The action has to be created in the GUI.
  2. Cloud scriptsPushing the fix through FortiGate Cloud CLI scripts looked faster, but the Cloud parser broke the embedded shell variables. That path was tested and abandoned.
  3. VerificationFive checks before a device counts as done: clean script quoting, correct admin profile, hourly trigger, linked stitch, and a scheduled next run.
  4. FirmwareUpgrades or factory resets can strip custom automation, so the SOP is re-applied after them.
  5. RollbackA three-command cleanup removes the stitch, trigger and action, and is documented alongside the deployment.

Fleet-level design: 43 devices

43 FortiGatesFortiManager-managedHealth signalconserve mode / memoryValidatesustained? repeat?IgnoretransientGuard railswindow · counterEscalatehuman reviewRecovercontrolled actionVerifyonline · memoryLog + notifyticket · auditnoyeslimit hitfails → escalate
Design under evaluation for a 43-device FortiManager environment. Thresholds and actions are set only after testing.

The fleet design goes a step further: recognize memory-related events and conserve mode across a 43-device FortiManager environment, and evaluate controlled automatic recovery. It is a design and assessment; every automatic action needs trigger validation, false-positive protection and a cap so it can never loop.

Alert correlation

Before

Tunnel down, devices offline, WAN failed and firewall unreachable arrive as separate alerts.

Correlated

One site-level incident: the WAN went down, everything else is downstream.

Refined

Thresholds and delays filter brief ISP blips so only outages that last page someone.

07Challenges & decisions

Mitigate the symptom, escalate the cause

The stitch keeps devices healthy between firmware fixes. It is a mitigation, not a cure, and it is written up that way.

Non-disruptive by design

Killing the process causes a one-to-three-second pause in the management plane and no data-plane impact, which is why it can run hourly during business hours.

Automate detection before recovery

Detection and logging are low-risk. Automatic recovery across 43 devices is high-risk, so it stays in design until it is tested.

Write the SOP

A documented procedure with verification and rollback is what lets other technicians deploy it safely.

08Outcomes

  • Completed

    Node.js memory leak mitigation built, tested and documented as a standard operating procedure with verification and rollback.

  • Ongoing

    FortiGate 50G firmware lifecycle across FortiOS 8.0.0 and 8.0.1, including SAML authentication compatibility.

  • Design / assessment

    Fleet-level conserve-mode monitoring and automated recovery for 43 FortiManager-managed devices: designed and assessed.

  • Completed

    IT Glue to GitHub documentation sync running in production every eight hours, excluding credentials.

09Lessons & capabilities

  • An automation that can act on a firewall needs more testing than the firewall
  • How a change is created can matter as much as what it says
  • Guard rails and escalation paths are the design, not extras
  • Fix the cause; automate the recovery only while you do

Capabilities demonstrated

  • FortiOS automation
  • SOP authoring
  • FortiManager
  • Firmware lifecycle
  • Automation design
  • Rewst workflows