npm package: @spacebridge/n8n-nodes-ipmi-watchdog
Description: n8n community node for SSH-based watchdog checks and Supermicro BMC Redfish reboot automation.
Author: info
Latest version: 0.1.2

# n8n-nodes-ipmi-watchdog

Community node for `n8n` that replicates `ipmi-watchdog` behavior:

- SSH availability probe
- retry logic for each check
- consecutive failure counter between workflow runs
- automatic reboot through Supermicro BMC Redfish
- post-reboot cooldown

## What this node does

Nodes:

- **IPMI Watchdog** (action node, for `Cron -> Check`)
- **IPMI Watchdog Trigger** (self-polling trigger node)

Operation `Check & Reboot If Needed`:

1. Checks server SSH availability.
2. Retries probe `SSH Check Retries` times with `SSH Retry Delay`.
3. Stores consecutive failure counter in n8n workflow static data.
4. When threshold is reached, sends Redfish reset:
   `POST /redfish/v1/Systems/1/Actions/ComputerSystem.Reset`
5. After successful reboot command, starts cooldown (`Reboot Cooldown`).

Operation `Clear Host State`:

- Clears stored counter/cooldown state for selected host key.

## Installation

### Option 1: install from local folder (for self-hosted n8n)

1. Build package:

```bash
cd n8n-ipmi-watchdog
npm install
npm run build
```

2. In your n8n custom extensions folder, install this package:

```bash
cd ~/.n8n/custom
npm install /absolute/path/to/n8n-ipmi-watchdog
```

3. Restart n8n.

### Option 2: link during development

```bash
cd /absolute/path/to/n8n-ipmi-watchdog
npm install
npm run build
npm link

cd ~/.n8n/custom
npm link n8n-nodes-ipmi-watchdog
```

Restart n8n after linking.

## GitHub Actions publish

Workflow file: `.github/workflows/publish.yml`

- Trigger: push to `master`
- Actions: install dependencies, build package, publish to npm and GitHub Packages
- npm registry package name: `n8n-nodes-ipmi-watchdog`
- GitHub Packages name: `@<owner>/n8n-nodes-ipmi-watchdog` (owner is repository owner)
- Required secret: `NPM_TOKEN`
- GitHub Packages auth uses built-in `GITHUB_TOKEN` (workflow has `packages: write`)
- Safety: each publish is skipped if the same version already exists in the target registry

## Credentials

This package provides two credential types:

- `IPMI SSH Auth`
  - Username
  - Password (optional)
  - Private Key (PEM, optional)
  - Passphrase (optional)
- `IPMI BMC Auth`
  - Username
  - Password

At least one SSH auth method must be provided: password or private key.

## Recommended workflow

### Option A: Trigger-based (no Cron)

1. `IPMI Watchdog Trigger`
2. `IF` / `Switch` node on `{{$json.watchdog.event}}`

### Option B: Cron + action node

1. `Cron` node (for example every 1 minute).
2. `IPMI Watchdog` node (`Check & Reboot If Needed`).
3. `IF` / `Switch` node on `{{$json.watchdog.event}}` to route:
   - `ssh_ok`
   - `ssh_failure`
   - `reboot_triggered`
   - `reboot_failed`
   - `reboot_cooldown`

## Output format

Each input item returns input JSON + `watchdog` object:

```json
{
  "watchdog": {
    "event": "ssh_failure",
    "host": "10.10.140.253",
    "stateKey": "10.10.140.253",
    "timestamp": "2026-03-10T11:50:00.000Z",
    "consecutiveFailures": 2
  }
}
```

## Differences vs Python daemon

- In Python version, a single process polls forever.
- In n8n version, you can poll either with `IPMI Watchdog Trigger` or with external `Cron`.
- State survives between workflow runs via node static data.

## License

MIT