浏览代码

feat(integrations): add a node vendor mode for pushers on the monitored host (#2272) (#2273)

Nacho 2 天之前
父节点
当前提交
d7f6377e33

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 ### Added
 
+- The vendor catalog accepts a third mode, `node`, for pushers that must run on the monitored host itself: a Kubernetes node that reads its own kubelet and `/proc`, a Docker host, a storage box. The Integrations page registers the row, issues the token and shows the environment to set, and the server never downloads, installs, starts or stops anything there. Start and stop answer `not_managed`, update only refreshes the published version so the page can point at the download, edit keeps to the label and the interval, and the row stays `pending` until the pusher's first push makes it live (#2272).
 - A host that runs other machines - an RKE2 node, a PVE box, a Docker host - can report the guests nested inside it through an optional `workloads` section in the push: stable id, name, kind and state per guest. The server keeps the census as reported and shows it on the unit's detail page, a count and a list with each workload's state. It is detail data, not graph data: a node with a hundred pods does not draw a hundred clients (#2227). Thanks to @brainnoms for the contract.
 - A unit that is not the gateway can keep the neighbours of its uplink out of its client list. The agent reports its logical networks with their Linux devices, the router detail page shows a Client discovery panel with Automatic, On or Off per network, and Automatic ignores the network that carries the unit's uplink (`br-*` bridges excepted, where an AP's uplink is its own LAN). Only devices attributed from ARP alone are filtered: a wireless association or an FDB entry still wins (#2235).
 - An invalid MAC that a poll, a push or a beacon drops is now logged once per value instead of silently. Each subsystem keeps its own logger, forgets after 24 hours, and caps at 64 keys before a single suppression line (#2240).

+ 9 - 2
app/public/locales/en/translation.json

@@ -917,6 +917,9 @@
       "fieldArch": "Architecture",
       "modeLocalHint": "This pusher runs on the NetPulse host.",
       "modeSshHint": "In SSH mode the pusher is installed inside the router.",
+      "modeNodeHint": "This pusher runs on the monitored host: you install and restart it there. The server only registers it, issues the token and shows the environment to set.",
+      "fieldNodeLabel": "Node label",
+      "fieldNodeLabelHint": "Shown on the row. Optional, defaults to the slug.",
       "submit": "Create",
       "creating": "Creating..."
     },
@@ -930,7 +933,10 @@
       "tokenDesc": "Copy the token now. It is shown only once and will not be shown again.",
       "copyToken": "Copy token",
       "copied": "Copied",
-      "copyHint": "Copy the token to a safe place."
+      "copyHint": "Copy the token to a safe place.",
+      "nodeEnvTitle": "Environment for the node",
+      "nodeEnvDesc": "Set these variables in the pusher unit on the monitored host. The token is shown only once.",
+      "copyEnv": "Copy environment"
     },
     "meta": {
       "version": "Version",
@@ -963,7 +969,8 @@
       "fieldPasswordSshHint": "Also updates the SSH password the server uses to reach the router. Leave blank to keep both.",
       "save": "Save and restart",
       "saving": "Saving",
-      "restartHint": "Saving rewrites the pusher environment and restarts it, so the new values take effect at once."
+      "restartHint": "Saving rewrites the pusher environment and restarts it, so the new values take effect at once.",
+      "restartHintNode": "The server only stores the label and the interval. Restart the pusher on the node for the new interval to take effect."
     }
   },
   "roaming": {

+ 9 - 2
app/public/locales/es/translation.json

@@ -917,6 +917,9 @@
       "fieldArch": "Arquitectura",
       "modeLocalHint": "Este pusher corre en el host de NetPulse.",
       "modeSshHint": "En modo SSH el pusher se instala dentro del router.",
+      "modeNodeHint": "Este pusher corre en el host monitorizado: lo instalas y lo reinicias tú allí. El servidor solo lo registra, emite el token y muestra el entorno que hay que poner.",
+      "fieldNodeLabel": "Etiqueta del nodo",
+      "fieldNodeLabelHint": "Se muestra en la fila. Opcional, por defecto el slug.",
       "submit": "Crear",
       "creating": "Creando..."
     },
@@ -930,7 +933,10 @@
       "tokenDesc": "Copia el token ahora. Solo se muestra una vez y no se volverá a mostrar.",
       "copyToken": "Copiar token",
       "copied": "Copiado",
-      "copyHint": "Guarda el token en un lugar seguro."
+      "copyHint": "Guarda el token en un lugar seguro.",
+      "nodeEnvTitle": "Entorno para el nodo",
+      "nodeEnvDesc": "Pon estas variables en la unidad del pusher en el host monitorizado. El token solo se muestra una vez.",
+      "copyEnv": "Copiar entorno"
     },
     "meta": {
       "version": "Versión",
@@ -963,7 +969,8 @@
       "fieldPasswordSshHint": "También actualiza la contraseña SSH que el servidor usa para conectar al router. En blanco conserva ambas.",
       "save": "Guardar y reiniciar",
       "saving": "Guardando",
-      "restartHint": "Al guardar se reescribe el entorno del pusher y se reinicia, así que los valores nuevos entran en vigor al momento."
+      "restartHint": "Al guardar se reescribe el entorno del pusher y se reinicia, así que los valores nuevos entran en vigor al momento.",
+      "restartHintNode": "El servidor solo guarda la etiqueta y el intervalo. Reinicia el pusher en el nodo para que el intervalo nuevo surta efecto."
     }
   },
   "roaming": {

+ 9 - 2
app/public/locales/ru/translation.json

@@ -926,6 +926,9 @@
       "fieldArch": "Архитектура",
       "modeLocalHint": "Этот pusher работает на хосте NetPulse.",
       "modeSshHint": "В режиме SSH pusher устанавливается внутри роутера.",
+      "modeNodeHint": "Этот pusher работает на наблюдаемом хосте: вы устанавливаете и перезапускаете его там. Сервер только регистрирует его, выдаёт токен и показывает переменные окружения.",
+      "fieldNodeLabel": "Метка узла",
+      "fieldNodeLabelHint": "Показывается в строке. Необязательно, по умолчанию slug.",
       "submit": "Создать",
       "creating": "Создание..."
     },
@@ -939,7 +942,10 @@
       "tokenDesc": "Скопируйте токен сейчас. Он показывается только один раз и больше не появится.",
       "copyToken": "Копировать токен",
       "copied": "Скопировано",
-      "copyHint": "Сохраните токен в надёжное место."
+      "copyHint": "Сохраните токен в надёжное место.",
+      "nodeEnvTitle": "Окружение для узла",
+      "nodeEnvDesc": "Задайте эти переменные в юните pusher на наблюдаемом хосте. Токен показывается один раз.",
+      "copyEnv": "Скопировать окружение"
     },
     "meta": {
       "version": "Версия",
@@ -972,7 +978,8 @@
       "fieldPasswordSshHint": "Также обновляет SSH-пароль, которым сервер подключается к роутеру. Оставьте пустым, чтобы оставить оба.",
       "save": "Сохранить и перезапустить",
       "saving": "Сохранение",
-      "restartHint": "При сохранении перезаписывается env-файл и pusher перезапускается, так что новые значения вступают в силу сразу."
+      "restartHint": "При сохранении перезаписывается env-файл и pusher перезапускается, так что новые значения вступают в силу сразу.",
+      "restartHintNode": "Сервер хранит только метку и интервал. Перезапустите pusher на узле, чтобы новый интервал вступил в силу."
     }
   },
   "roaming": {

+ 8 - 1
app/public/locales/zh/translation.json

@@ -3298,6 +3298,9 @@
       "fieldArch": "架构",
       "modeLocalHint": "这个 pusher 运行在 NetPulse 主机上。",
       "modeSshHint": "SSH 模式下,pusher 会被安装到路由器内部。",
+      "modeNodeHint": "这个 pusher 运行在被监控的主机上:由你在那里安装并重启。服务器只负责登记、签发令牌并显示需要设置的环境变量。",
+      "fieldNodeLabel": "节点标签",
+      "fieldNodeLabelHint": "显示在列表中。可选,默认使用 slug。",
       "submit": "创建",
       "creating": "正在创建…",
       "fieldPasswordSshHint": "安装以及后续操作会用该密码通过 SSH 登录路由器。仍优先使用已授权的密钥:当路由器只接受密码时(例如原厂 Asuswrt)才填写此项。"
@@ -3307,7 +3310,10 @@
       "tokenDesc": "请立即复制令牌。它只显示这一次,之后不会再出现。",
       "copyToken": "复制令牌",
       "copied": "已复制",
-      "copyHint": "请把令牌保存到安全的地方。"
+      "copyHint": "请把令牌保存到安全的地方。",
+      "nodeEnvTitle": "节点环境变量",
+      "nodeEnvDesc": "在被监控主机上的 pusher 单元中设置这些变量。令牌只显示一次。",
+      "copyEnv": "复制环境变量"
     },
     "meta": {
       "version": "版本",
@@ -3340,6 +3346,7 @@
       "save": "保存并重启",
       "saving": "正在保存",
       "restartHint": "保存会重写 pusher 的运行环境并重启它,因此新值立即生效。",
+      "restartHintNode": "服务器只保存标签和间隔。请在节点上重启 pusher,让新的间隔生效。",
       "fieldPasswordSshHint": "同时更新服务器连接路由器所用的 SSH 密码。留空则两者都保留。"
     },
     "unmanagedTitle": "由 NetPulse 外部管理",

+ 14 - 4
app/src/lib/integrationsApi.ts

@@ -6,7 +6,9 @@
 export interface Integration {
   slug: string
   vendor: string
-  mode: 'local' | 'ssh'
+  /** local: managed child on the server host. ssh: installed in the router.
+   *  node: installed by the operator on the monitored host (#2272). */
+  mode: 'local' | 'ssh' | 'node'
   host: string
   username: string
   version: string
@@ -42,7 +44,9 @@ export interface IntegrationListResponse {
 
 export interface Vendor {
   id: string
-  mode: 'local' | 'ssh'
+  /** local: the server runs it. ssh: installed in the router. node: the
+   *  operator installs it on the monitored host (#2272). */
+  mode: 'local' | 'ssh' | 'node'
   arches: string[]
   tagPrefix: string
   description: string
@@ -58,7 +62,10 @@ export interface VendorsResponse {
 export interface CreateIntegrationInput {
   slug: string
   vendor: string
+  /** Row label. Mode "node" pushers use it only as a display name (optional). */
   host: string
+  /** Credentials of the device. Empty for mode "node", which runs on the
+   *  monitored host and is configured there. */
   username: string
   password: string
   intervalS: number
@@ -123,8 +130,11 @@ export function fetchIntegrations(): Promise<IntegrationListResponse> {
 
 export function createIntegration(
   input: CreateIntegrationInput,
-): Promise<{ integration: Integration; token: string }> {
-  return req<{ integration: Integration; token: string }>('/api/integrations', json('POST', input))
+): Promise<{ integration: Integration; token: string; env?: Record<string, string> }> {
+  return req<{ integration: Integration; token: string; env?: Record<string, string> }>(
+    '/api/integrations',
+    json('POST', input),
+  )
 }
 
 export function startIntegration(slug: string): Promise<{ integration: Integration }> {

+ 189 - 93
app/src/pages/Integrations.tsx

@@ -124,6 +124,9 @@ export default function Integrations({
   // Token modal + confirmación de borrado + acciones en vuelo por fila.
   const [token, setToken] = useState<string | null>(null)
   const [tokenCopied, setTokenCopied] = useState(false)
+  // Env de un alta modo node (#2272): el operador lo copia en el nodo.
+  const [nodeEnv, setNodeEnv] = useState<Record<string, string> | null>(null)
+  const [envCopied, setEnvCopied] = useState(false)
   const [confirmDelete, setConfirmDelete] = useState<Integration | null>(null)
   // Edición en linea: se rellena con los valores actuales salvo la contraseña,
   // que en blanco significa "conservar la que ya tiene".
@@ -172,6 +175,10 @@ export default function Integrations({
   }, [load, isDemo])
 
   const selectedVendor = vendors.find((v) => v.id === vendorId)
+  // #2272: un vendor "node" lo instala y lo supervisa el operador en el host
+  // monitorizado. El formulario no pide credenciales y la fila no se arranca
+  // ni se para desde aquí.
+  const nodeVendor = selectedVendor?.mode === 'node'
 
   const onHostChange = (value: string) => {
     setHost(value)
@@ -191,7 +198,15 @@ export default function Integrations({
   const submit = async (e: React.FormEvent) => {
     e.preventDefault()
     if (submitting) return
-    if (!vendorId || !host.trim() || !SLUG_RE.test(slug.trim()) || intervalInvalid || password === '') return
+    const hostRequired = !nodeVendor
+    if (
+      !vendorId ||
+      (hostRequired && !host.trim()) ||
+      !SLUG_RE.test(slug.trim()) ||
+      intervalInvalid ||
+      (hostRequired && password === '')
+    )
+      return
     setSubmitting(true)
     setError('')
     try {
@@ -199,8 +214,8 @@ export default function Integrations({
         slug: slug.trim(),
         vendor: vendorId,
         host: host.trim(),
-        username: username.trim(),
-        password,
+        username: nodeVendor ? '' : username.trim(),
+        password: nodeVendor ? '' : password,
         intervalS: interval,
       }
       if (selectedVendor && selectedVendor.arches.length > 1 && arch) {
@@ -210,6 +225,7 @@ export default function Integrations({
       }
       const res = await createIntegration(input)
       setToken(res.token)
+      setNodeEnv(res.env ?? null)
       setShowForm(false)
       setSlug('')
       setHost('')
@@ -257,8 +273,14 @@ export default function Integrations({
     setError('')
   }
 
+  const editNode = editing?.mode === 'node'
+
   const editInvalid =
-    !editHost.trim() || !editUsername.trim() || !Number.isFinite(editInterval) || editInterval < 10 || editInterval > 86_400
+    !editHost.trim() ||
+    (!editNode && !editUsername.trim()) ||
+    !Number.isFinite(editInterval) ||
+    editInterval < 10 ||
+    editInterval > 86_400
 
   const submitEdit = async (e: React.FormEvent) => {
     e.preventDefault()
@@ -266,12 +288,14 @@ export default function Integrations({
     setSavingEdit(true)
     setError('')
     try {
-      const body: { host: string; username: string; intervalS: number; password?: string } = {
+      const body: { host: string; intervalS: number; username?: string; password?: string } = {
         host: editHost.trim(),
-        username: editUsername.trim(),
         intervalS: editInterval,
       }
-      if (editPassword) body.password = editPassword
+      if (!editNode) {
+        body.username = editUsername.trim()
+        if (editPassword) body.password = editPassword
+      }
       await editIntegration(editing.slug, body)
       setEditing(null)
       await load(true)
@@ -305,6 +329,19 @@ export default function Integrations({
     window.setTimeout(() => setTokenCopied(false), 1500)
   }
 
+  const envText = nodeEnv
+    ? Object.entries(nodeEnv)
+        .map(([k, v]) => `${k}=${v}`)
+        .join('\n')
+    : ''
+
+  const copyEnv = async () => {
+    if (!envText) return
+    const ok = await copyToClipboard(envText)
+    setEnvCopied(ok)
+    window.setTimeout(() => setEnvCopied(false), 1500)
+  }
+
   /** "hace X min" (unidades i18n) o fecha corta para eventos muy antiguos. */
   const agoLabel = (ms: number): string => {
     if (!ms || !Number.isFinite(ms) || ms <= 0) return t('integrations.never')
@@ -439,41 +476,50 @@ export default function Integrations({
               )}
             </label>
             <label className="block">
-              <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldHost')}</span>
+              <span className="text-label uppercase text-text-muted">
+                {nodeVendor ? t('integrations.form.fieldNodeLabel') : t('integrations.form.fieldHost')}
+              </span>
               <input
                 type="text"
                 value={host}
                 onChange={(e) => onHostChange(e.target.value)}
                 placeholder={t('integrations.form.fieldHostPlaceholder')}
-                aria-label={t('integrations.form.fieldHost')}
+                aria-label={nodeVendor ? t('integrations.form.fieldNodeLabel') : t('integrations.form.fieldHost')}
                 className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none"
               />
-            </label>
-            <label className="block">
-              <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldUsername')}</span>
-              <input
-                type="text"
-                value={username}
-                onChange={(e) => setUsername(e.target.value)}
-                aria-label={t('integrations.form.fieldUsername')}
-                autoComplete="off"
-                className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
-              />
-            </label>
-            <label className="block">
-              <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldPassword')}</span>
-              <input
-                type="password"
-                value={password}
-                onChange={(e) => setPassword(e.target.value)}
-                aria-label={t('integrations.form.fieldPassword')}
-                autoComplete="new-password"
-                className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
-              />
-              {selectedVendor && selectedVendor.mode === 'ssh' && (
-                <span className="mt-1 block text-xs text-text-muted">{t('integrations.form.fieldPasswordSshHint')}</span>
+              {nodeVendor && (
+                <span className="mt-1 block text-xs text-text-muted">{t('integrations.form.fieldNodeLabelHint')}</span>
               )}
             </label>
+            {!nodeVendor && (
+              <>
+                <label className="block">
+                  <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldUsername')}</span>
+                  <input
+                    type="text"
+                    value={username}
+                    onChange={(e) => setUsername(e.target.value)}
+                    aria-label={t('integrations.form.fieldUsername')}
+                    autoComplete="off"
+                    className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
+                  />
+                </label>
+                <label className="block">
+                  <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldPassword')}</span>
+                  <input
+                    type="password"
+                    value={password}
+                    onChange={(e) => setPassword(e.target.value)}
+                    aria-label={t('integrations.form.fieldPassword')}
+                    autoComplete="new-password"
+                    className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
+                  />
+                  {selectedVendor && selectedVendor.mode === 'ssh' && (
+                    <span className="mt-1 block text-xs text-text-muted">{t('integrations.form.fieldPasswordSshHint')}</span>
+                  )}
+                </label>
+              </>
+            )}
             <label className="block">
               <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldInterval')}</span>
               <input
@@ -514,14 +560,18 @@ export default function Integrations({
             <p className="mt-3 text-caption text-text-muted">
               {selectedVendor.mode === 'ssh'
                 ? t('integrations.form.modeSshHint')
-                : t('integrations.form.modeLocalHint')}
+                : selectedVendor.mode === 'node'
+                  ? t('integrations.form.modeNodeHint')
+                  : t('integrations.form.modeLocalHint')}
             </p>
           )}
 
           <div className="mt-3 flex items-center gap-2">
             <button
               type="submit"
-              disabled={submitting || !vendorId || !host.trim() || slugInvalid || intervalInvalid}
+              disabled={
+                submitting || !vendorId || (!nodeVendor && !host.trim()) || slugInvalid || intervalInvalid
+              }
               className="inline-flex h-9 items-center gap-1.5 rounded-lg bg-accent px-3 text-sm font-medium text-canvas transition-opacity hover:opacity-90 disabled:opacity-40"
             >
               {submitting && <Loader2 className="h-4 w-4 animate-spin" strokeWidth={1.75} />}
@@ -580,34 +630,38 @@ export default function Integrations({
                     )}
                   </div>
                   <div className="flex shrink-0 items-center gap-1.5">
-                    <button
-                      type="button"
-                      onClick={() => void runAction(it.slug, 'start', () => startIntegration(it.slug))}
-                      disabled={running || installing || isBusy}
-                      aria-label={t('integrations.actions.start')}
-                      title={t('integrations.actions.start')}
-                      className="flex h-7 w-7 items-center justify-center rounded-lg border border-border text-text-muted transition-colors duration-150 hover:border-accent/40 hover:text-accent disabled:opacity-50"
-                    >
-                      {busy[it.slug] === 'start' ? (
-                        <Loader2 className="h-3.5 w-3.5 animate-spin" strokeWidth={1.75} />
-                      ) : (
-                        <Play className="h-3.5 w-3.5" strokeWidth={1.75} />
-                      )}
-                    </button>
-                    <button
-                      type="button"
-                      onClick={() => void runAction(it.slug, 'stop', () => stopIntegration(it.slug))}
-                      disabled={!running || installing || isBusy}
-                      aria-label={t('integrations.actions.stop')}
-                      title={t('integrations.actions.stop')}
-                      className="flex h-7 w-7 items-center justify-center rounded-lg border border-border text-text-muted transition-colors duration-150 hover:border-accent/40 hover:text-accent disabled:opacity-50"
-                    >
-                      {busy[it.slug] === 'stop' ? (
-                        <Loader2 className="h-3.5 w-3.5 animate-spin" strokeWidth={1.75} />
-                      ) : (
-                        <Square className="h-3.5 w-3.5" strokeWidth={1.75} />
-                      )}
-                    </button>
+                    {it.mode !== 'node' && (
+                      <>
+                        <button
+                          type="button"
+                          onClick={() => void runAction(it.slug, 'start', () => startIntegration(it.slug))}
+                          disabled={running || installing || isBusy}
+                          aria-label={t('integrations.actions.start')}
+                          title={t('integrations.actions.start')}
+                          className="flex h-7 w-7 items-center justify-center rounded-lg border border-border text-text-muted transition-colors duration-150 hover:border-accent/40 hover:text-accent disabled:opacity-50"
+                        >
+                          {busy[it.slug] === 'start' ? (
+                            <Loader2 className="h-3.5 w-3.5 animate-spin" strokeWidth={1.75} />
+                          ) : (
+                            <Play className="h-3.5 w-3.5" strokeWidth={1.75} />
+                          )}
+                        </button>
+                        <button
+                          type="button"
+                          onClick={() => void runAction(it.slug, 'stop', () => stopIntegration(it.slug))}
+                          disabled={!running || installing || isBusy}
+                          aria-label={t('integrations.actions.stop')}
+                          title={t('integrations.actions.stop')}
+                          className="flex h-7 w-7 items-center justify-center rounded-lg border border-border text-text-muted transition-colors duration-150 hover:border-accent/40 hover:text-accent disabled:opacity-50"
+                        >
+                          {busy[it.slug] === 'stop' ? (
+                            <Loader2 className="h-3.5 w-3.5 animate-spin" strokeWidth={1.75} />
+                          ) : (
+                            <Square className="h-3.5 w-3.5" strokeWidth={1.75} />
+                          )}
+                        </button>
+                      </>
+                    )}
                     <button
                       type="button"
                       onClick={() => void runAction(it.slug, 'update', () => updateIntegration(it.slug))}
@@ -696,42 +750,48 @@ export default function Integrations({
                     <div className="text-label uppercase text-text-muted">{t('integrations.edit.title')}</div>
                     <div className="mt-2 grid gap-3 sm:grid-cols-2">
                       <label className="block">
-                        <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldHost')}</span>
+                        <span className="text-label uppercase text-text-muted">
+                          {editNode ? t('integrations.form.fieldNodeLabel') : t('integrations.form.fieldHost')}
+                        </span>
                         <input
                           type="text"
                           value={editHost}
                           onChange={(e) => setEditHost(e.target.value)}
-                          aria-label={t('integrations.form.fieldHost')}
+                          aria-label={editNode ? t('integrations.form.fieldNodeLabel') : t('integrations.form.fieldHost')}
                           spellCheck={false}
                           className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
                         />
                       </label>
-                      <label className="block">
-                        <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldUsername')}</span>
-                        <input
-                          type="text"
-                          value={editUsername}
-                          onChange={(e) => setEditUsername(e.target.value)}
-                          aria-label={t('integrations.form.fieldUsername')}
-                          autoComplete="off"
-                          className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
-                        />
-                      </label>
-                      <label className="block">
-                        <span className="text-label uppercase text-text-muted">{t('integrations.edit.fieldPassword')}</span>
-                        <input
-                          type="password"
-                          value={editPassword}
-                          onChange={(e) => setEditPassword(e.target.value)}
-                          aria-label={t('integrations.edit.fieldPassword')}
-                          autoComplete="new-password"
-                          placeholder={t('integrations.edit.fieldPasswordKeep')}
-                          className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none"
-                        />
-                        {editing && editing.mode === 'ssh' && (
-                          <span className="mt-1 block text-xs text-text-muted">{t('integrations.edit.fieldPasswordSshHint')}</span>
-                        )}
-                      </label>
+                      {!editNode && (
+                        <>
+                          <label className="block">
+                            <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldUsername')}</span>
+                            <input
+                              type="text"
+                              value={editUsername}
+                              onChange={(e) => setEditUsername(e.target.value)}
+                              aria-label={t('integrations.form.fieldUsername')}
+                              autoComplete="off"
+                              className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"
+                            />
+                          </label>
+                          <label className="block">
+                            <span className="text-label uppercase text-text-muted">{t('integrations.edit.fieldPassword')}</span>
+                            <input
+                              type="password"
+                              value={editPassword}
+                              onChange={(e) => setEditPassword(e.target.value)}
+                              aria-label={t('integrations.edit.fieldPassword')}
+                              autoComplete="new-password"
+                              placeholder={t('integrations.edit.fieldPasswordKeep')}
+                              className="mt-1 w-full rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none"
+                            />
+                            {editing && editing.mode === 'ssh' && (
+                              <span className="mt-1 block text-xs text-text-muted">{t('integrations.edit.fieldPasswordSshHint')}</span>
+                            )}
+                          </label>
+                        </>
+                      )}
                       <label className="block">
                         <span className="text-label uppercase text-text-muted">{t('integrations.form.fieldInterval')}</span>
                         <input
@@ -747,7 +807,11 @@ export default function Integrations({
                         />
                       </label>
                     </div>
-                    <p className="mt-2 text-caption text-text-muted">{t('integrations.edit.restartHint')}</p>
+                    <p className="mt-2 text-caption text-text-muted">
+                      {editNode
+                        ? t('integrations.edit.restartHintNode')
+                        : t('integrations.edit.restartHint')}
+                    </p>
                     <div className="mt-3 flex items-center gap-2">
                       <button
                         type="submit"
@@ -808,7 +872,15 @@ export default function Integrations({
         </>
       )}
 
-      <Dialog open={token !== null} onOpenChange={(open) => !open && setToken(null)}>
+      <Dialog
+        open={token !== null}
+        onOpenChange={(open) => {
+          if (!open) {
+            setToken(null)
+            setNodeEnv(null)
+          }
+        }}
+      >
         {token !== null && (
           <DialogContent className="max-w-md">
             <DialogHeader>
@@ -833,6 +905,30 @@ export default function Integrations({
             <p className="text-caption text-text-muted">
               {tokenCopied ? t('integrations.token.copied') : t('integrations.token.copyHint')}
             </p>
+            {nodeEnv && (
+              <div className="mt-4">
+                <p className="text-label uppercase text-text-muted">{t('integrations.token.nodeEnvTitle')}</p>
+                <p className="mt-1 text-caption text-text-muted">{t('integrations.token.nodeEnvDesc')}</p>
+                <div className="mt-2 flex items-start gap-2 rounded-lg border border-border bg-canvas px-3 py-2">
+                  <pre className="min-w-0 flex-1 overflow-x-auto font-mono text-mono-sm text-text-primary">
+                    {envText}
+                  </pre>
+                  <button
+                    type="button"
+                    onClick={() => void copyEnv()}
+                    aria-label={t('integrations.token.copyEnv')}
+                    title={t('integrations.token.copyEnv')}
+                    className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
+                  >
+                    {envCopied ? (
+                      <Check className="h-4 w-4 text-ok" strokeWidth={1.75} />
+                    ) : (
+                      <Copy className="h-4 w-4" strokeWidth={1.75} />
+                    )}
+                  </button>
+                </div>
+              </div>
+            )}
           </DialogContent>
         )}
       </Dialog>

+ 12 - 0
docs/external-integrations.md

@@ -40,6 +40,18 @@ The split of responsibility is deliberate:
 
 A vendor integration is not a reason to make the NetPulse server larger for every user. It is also not a reason to build a second monitoring server. The external agent should translate into the existing ingestion contract.
 
+## Where the pusher runs
+
+The catalog entry declares one of three modes, and the mode decides who installs and supervises the process (#2272):
+
+| Mode | Who installs it | Who supervises it |
+| --- | --- | --- |
+| `local` | NetPulse downloads the release and extracts the binary on the server host | NetPulse, as a managed child process |
+| `ssh` | NetPulse installs it inside the router over SSH | The router's init system |
+| `node` | The operator, on the monitored host | The operator, on the monitored host |
+
+`node` exists for pushers that must read the machine they describe and cannot live on the NetPulse server: a Kubernetes node that reads its own kubelet and `/proc`, a Docker host, a storage box. The Integrations page still registers the row, issues the ingest token and shows the environment to set (`NETPULSE_SERVER`, `NETPULSE_TOKEN`, `NETPULSE_SLUG`, `NETPULSE_INTERVAL` and the TLS pin keys when the URL needs one), but the server never downloads, installs, starts or stops anything there. Start and stop answer `not_managed`, update only refreshes the published version so the page can point at the download, and the row stays `pending` until the pusher's first push makes it live.
+
 ## Start with an issue
 
 Open an issue before implementing a core change or proposing a new integration for the documentation. Include:

+ 134 - 27
server-go/internal/httpapi/integrations.go

@@ -254,8 +254,10 @@ func (s *server) watchIntegrations() {
 // entorno 0600 ya existente (el token y la contraseña solo viven ahí); en
 // modo ssh el pusher corre dentro del router y no hay nada que arrancar en el
 // servidor, pero el estado guardado deja de decir running (no verificado
-// hasta el próximo check/start). Un fallo se loga y deja la fila en estado
-// error: nunca tira el arranque del servidor.
+// hasta el próximo check/start). En modo node el pusher corre en el host
+// monitorizado: la fila vuelve a pending y el primer push la pone viva. Un
+// fallo se loga y deja la fila en estado error: nunca tira el arranque del
+// servidor.
 func (s *server) resumeIntegrations() {
 	if s.integrations == nil || s.db == nil {
 		return
@@ -270,7 +272,15 @@ func (s *server) resumeIntegrations() {
 		if !row.Enabled {
 			continue
 		}
-		if row.Mode != "local" {
+		if row.Mode == rintegration.ModeNode {
+			// Nadie en el servidor instala ni arranca esto (#2272): lo
+			// supervisa el operador en el host monitorizado.
+			if row.State != "pending" {
+				_ = store.SetState(row.Slug, "pending", "")
+			}
+			continue
+		}
+		if row.Mode != rintegration.ModeLocal {
 			// El proceso vive en el router: sin verificar tras el reinicio
 			// del servidor; check/start lo reconcilian.
 			if row.State == "running" {
@@ -407,7 +417,15 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 		writeError(w, http.StatusBadRequest, "invalid_vendor", "unknown vendor")
 		return
 	}
-	if body.Host == "" || body.Username == "" || body.Password == "" {
+	if vendor.OperatorInstalled() {
+		// #2272: en modo node el host es solo la etiqueta de la fila. La
+		// conexión del pusher (token del apiserver, kubelet, rutas) la
+		// configura el operador en el propio nodo, así que el alta no pide
+		// usuario ni contraseña.
+		if body.Host == "" {
+			body.Host = body.Slug
+		}
+	} else if body.Host == "" || body.Username == "" || body.Password == "" {
 		writeError(w, http.StatusBadRequest, "invalid_input", "host, username and password are required")
 		return
 	}
@@ -439,9 +457,11 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 		return
 	}
 
-	// Resolver y descargar el último release verificado. En modo local se
-	// extrae el binario aquí (corre en este host); en modo ssh solo se
-	// verifica: el router descarga el asset él mismo.
+	// Resolver el último release verificado. En modo local se extrae el
+	// binario aquí (corre en este host); en modo ssh solo se verifica: el
+	// router descarga el asset él mismo; en modo node no se descarga ni se
+	// verifica nada, porque instala el operador (#2272) y la fila solo
+	// conserva versión y nombre del asset para que la UI apunte a la descarga.
 	fetch := s.integrationFetcher()
 	res, err := fetch.ResolveLatest(vendor, arch)
 	if err != nil {
@@ -449,7 +469,7 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 		return
 	}
 	binPath := ""
-	if vendor.Mode == "local" {
+	if vendor.ServerManaged() {
 		if s.integrations == nil {
 			writeError(w, http.StatusServiceUnavailable, "unavailable", "integrations supervisor not configured")
 			return
@@ -460,7 +480,7 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 			writeError(w, http.StatusBadGateway, "download_failed", err.Error())
 			return
 		}
-	} else {
+	} else if vendor.Mode == rintegration.ModeSSH {
 		if s.pool == nil {
 			writeError(w, http.StatusServiceUnavailable, "ssh_unavailable", "el servidor no tiene pool SSH")
 			return
@@ -486,7 +506,7 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 	// #1708: en modo ssh la misma contraseña del formulario es la credencial
 	// SSH del alta y de las acciones posteriores: se guarda en el fichero
 	// compañero (0600) antes de conectar, nunca en la base de datos.
-	if vendor.Mode == "ssh" && s.integrations != nil {
+	if vendor.Mode == rintegration.ModeSSH && s.integrations != nil {
 		if err := s.integrations.WriteSSHPassword(body.Slug, body.Password); err != nil {
 			_ = store.Delete(body.Slug)
 			writeError(w, http.StatusInternalServerError, "ssh_password_write", err.Error())
@@ -507,11 +527,11 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 	s.syncRouters()
 
 	rollback := func() {
-		if vendor.Mode == "local" && s.integrations != nil {
+		if vendor.ServerManaged() && s.integrations != nil {
 			_ = s.integrations.Stop(body.Slug)
 			_ = s.integrations.Cleanup(body.Slug)
 		}
-		if vendor.Mode == "ssh" && s.integrations != nil {
+		if vendor.Mode == rintegration.ModeSSH && s.integrations != nil {
 			_ = s.integrations.RemoveSSHPassword(body.Slug)
 		}
 		_ = routerstore.RemoveRouter(s.db.DB, body.Slug)
@@ -519,9 +539,17 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 		_ = store.Delete(body.Slug)
 	}
 
+	// #2272: en modo node la rotación de token no arranca ni instala nada; el
+	// env que el operador debe copiar en el nodo sale en la respuesta una sola
+	// vez, como el token.
+	var nodeEnv map[string]string
 	token, err := s.rotateAgentTokenAtomic(body.Slug, func(tok string) error {
+		if vendor.OperatorInstalled() {
+			nodeEnv = s.operatorEnv(row, serverURL, tok)
+			return nil
+		}
 		env := s.pusherEnv(vendor, row, body.Password, serverURL, tok)
-		if vendor.Mode == "local" {
+		if vendor.ServerManaged() {
 			return s.integrations.Start(body.Slug, env, binPath)
 		}
 		return s.runSSHInstall(vendor, row, env, res.URL, res.SHA256)
@@ -532,15 +560,21 @@ func (s *server) handleIntegrationsCreate(w http.ResponseWriter, r *http.Request
 		return
 	}
 
-	_ = store.SetState(body.Slug, "running", "")
-	_ = store.SetLastStart(body.Slug, time.Now().UnixMilli())
+	if !vendor.OperatorInstalled() {
+		_ = store.SetState(body.Slug, "running", "")
+		_ = store.SetLastStart(body.Slug, time.Now().UnixMilli())
+	}
 	s.broadcastIntegrations()
 
 	item, _ := s.getIntegrationRow(body.Slug)
-	writeJSON(w, http.StatusCreated, map[string]any{
+	out := map[string]any{
 		"integration": s.integrationItemOf(item),
 		"token":       token,
-	})
+	}
+	if nodeEnv != nil {
+		out["env"] = nodeEnv
+	}
+	writeJSON(w, http.StatusCreated, out)
 }
 
 func vendorSupportsArch(v rintegration.Vendor, arch string) bool {
@@ -552,13 +586,31 @@ func vendorSupportsArch(v rintegration.Vendor, arch string) bool {
 	return false
 }
 
+// operatorEnv builds the environment an operator has to set on a mode "node"
+// pusher (#2272): only the ingest side, because the vendor-specific knobs
+// (credentials, endpoints, file paths) live on the monitored host and the
+// server never learns them. Mirrors pusherEnv for the shared keys so a pusher
+// that speaks the standard contract needs no translation.
+func (s *server) operatorEnv(row rintegration.Row, serverURL, token string) map[string]string {
+	env := map[string]string{
+		"NETPULSE_SERVER":   serverURL,
+		"NETPULSE_TOKEN":    token,
+		"NETPULSE_SLUG":     row.Slug,
+		"NETPULSE_INTERVAL": strconv.Itoa(row.IntervalS) + "s",
+	}
+	for k, v := range pusherPinEnv(serverURL) {
+		env[k] = v
+	}
+	return env
+}
+
 // pusherEnv construye el entorno del pusher. En modo ssh el pusher corre en el
 // propio router, así que el host del dispositivo es la propia unidad
 // (127.0.0.1) en lugar del host SSH de la tabla.
 func (s *server) pusherEnv(v rintegration.Vendor, row rintegration.Row, password, serverURL, token string) map[string]string {
 	prefix := strings.ToUpper(v.ID) + "_"
 	host := row.Host
-	if v.Mode == "ssh" {
+	if v.Mode == rintegration.ModeSSH {
 		host = "127.0.0.1"
 	}
 	env := map[string]string{
@@ -661,8 +713,14 @@ func (s *server) handleIntegrationStart(w http.ResponseWriter, r *http.Request)
 		writeError(w, http.StatusInternalServerError, "invalid_vendor")
 		return
 	}
+	if vendor.OperatorInstalled() {
+		// #2272: no hay proceso en el servidor que arrancar. Lo supervisa el
+		// operador en el host monitorizado.
+		writeError(w, http.StatusConflict, "not_managed", "this pusher runs on the monitored host: start it there")
+		return
+	}
 	store := s.integrationsStore()
-	if vendor.Mode == "local" {
+	if vendor.ServerManaged() {
 		if s.integrations == nil {
 			writeError(w, http.StatusServiceUnavailable, "unavailable", "integrations supervisor not configured")
 			return
@@ -703,7 +761,12 @@ func (s *server) handleIntegrationStop(w http.ResponseWriter, r *http.Request) {
 		writeError(w, http.StatusInternalServerError, "invalid_vendor")
 		return
 	}
-	if vendor.Mode == "local" {
+	if vendor.OperatorInstalled() {
+		// #2272: nada que parar desde el servidor.
+		writeError(w, http.StatusConflict, "not_managed", "this pusher runs on the monitored host: stop it there")
+		return
+	}
+	if vendor.ServerManaged() {
 		if s.integrations != nil {
 			_ = s.integrations.Stop(slug) // ErrNotRunning es no-op aquí
 		}
@@ -728,8 +791,19 @@ func (s *server) handleIntegrationCheck(w http.ResponseWriter, r *http.Request)
 		writeError(w, http.StatusInternalServerError, "invalid_vendor")
 		return
 	}
+	if vendor.OperatorInstalled() {
+		// #2272: no hay proceso en el servidor que comprobar. La vida la dice
+		// el push (frescura y motivo de offline de la fila), así que el check
+		// no toca el estado guardado y lo declara por lo que es: no gestionado.
+		writeJSON(w, http.StatusOK, map[string]any{
+			"integration": s.integrationItemOf(row),
+			"running":     false,
+			"managed":     false,
+		})
+		return
+	}
 	running := false
-	if vendor.Mode == "local" {
+	if vendor.ServerManaged() {
 		running = s.integrations != nil && s.integrations.Running(slug)
 	} else if s.pool != nil {
 		_, err := s.runIntegrationSSH(row, sshServiceScript(vendor, "check"), 30*time.Second)
@@ -748,6 +822,7 @@ func (s *server) handleIntegrationCheck(w http.ResponseWriter, r *http.Request)
 	writeJSON(w, http.StatusOK, map[string]any{
 		"integration": s.integrationItemOf(row),
 		"running":     running,
+		"managed":     true,
 	})
 }
 
@@ -772,7 +847,17 @@ func (s *server) handleIntegrationUpdate(w http.ResponseWriter, r *http.Request)
 		return
 	}
 	store := s.integrationsStore()
-	if vendor.Mode == "local" {
+	if vendor.OperatorInstalled() {
+		// #2272: el servidor no instala ni reinicia nada en el nodo. Lo único
+		// que puede hacer es refrescar la versión publicada para que la UI
+		// ofrezca la descarga; el operador decide cuándo subirla.
+		_ = store.SetVersion(slug, res.Version, res.AssetName, row.Arch)
+		s.broadcastIntegrations()
+		item, _ := s.getIntegrationRow(slug)
+		writeJSON(w, http.StatusOK, map[string]any{"integration": s.integrationItemOf(item)})
+		return
+	}
+	if vendor.ServerManaged() {
 		if s.integrations == nil {
 			writeError(w, http.StatusServiceUnavailable, "unavailable", "integrations supervisor not configured")
 			return
@@ -859,6 +944,10 @@ func (s *server) handleIntegrationEdit(w http.ResponseWriter, r *http.Request) {
 		changed = true
 	}
 	if body.Username != nil {
+		if vendor.OperatorInstalled() {
+			writeError(w, http.StatusBadRequest, "invalid_input", "username is set on the monitored host, not here")
+			return
+		}
 		u := strings.TrimSpace(*body.Username)
 		if u == "" {
 			writeError(w, http.StatusBadRequest, "invalid_input", "username cannot be empty")
@@ -877,6 +966,10 @@ func (s *server) handleIntegrationEdit(w http.ResponseWriter, r *http.Request) {
 	}
 	password := ""
 	if body.Password != nil {
+		if vendor.OperatorInstalled() {
+			writeError(w, http.StatusBadRequest, "invalid_input", "credentials are set on the monitored host, not here")
+			return
+		}
 		password = *body.Password
 		changed = true
 	}
@@ -885,14 +978,28 @@ func (s *server) handleIntegrationEdit(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	store := s.integrationsStore()
+	if vendor.OperatorInstalled() {
+		// #2272: no hay fichero de entorno en el servidor que reescribir ni
+		// proceso que reiniciar. Host es la etiqueta de la fila e intervalo lo
+		// aplica el operador en el nodo; la fila solo guarda ambos.
+		if err := store.Upsert(row); err != nil {
+			writeError(w, http.StatusInternalServerError, "db_error", err.Error())
+			return
+		}
+		s.broadcastIntegrations()
+		item, _ := s.getIntegrationRow(slug)
+		writeJSON(w, http.StatusOK, map[string]any{"integration": s.integrationItemOf(item)})
+		return
+	}
+
 	prefix := strings.ToUpper(vendor.ID) + "_"
 	host := row.Host
-	if vendor.Mode == "ssh" {
+	if vendor.Mode == rintegration.ModeSSH {
 		host = "127.0.0.1"
 	}
-	store := s.integrationsStore()
 
-	if vendor.Mode == "local" {
+	if vendor.ServerManaged() {
 		if s.integrations == nil {
 			writeError(w, http.StatusServiceUnavailable, "unavailable", "integrations supervisor not configured")
 			return
@@ -980,12 +1087,12 @@ func (s *server) handleIntegrationDelete(w http.ResponseWriter, r *http.Request)
 		return
 	}
 	vendor, _ := s.vendorCatalog.Lookup(row.Vendor)
-	if vendor.Mode == "local" {
+	if vendor.ServerManaged() {
 		if s.integrations != nil {
 			_ = s.integrations.Stop(slug)
 			_ = s.integrations.Cleanup(slug)
 		}
-	} else if s.pool != nil {
+	} else if vendor.Mode == rintegration.ModeSSH && s.pool != nil {
 		_, _ = s.runIntegrationSSH(row, sshUninstallScript(vendor), 60*time.Second)
 	}
 	// #1708: la contraseña SSH del fichero compañero muere con la

+ 291 - 0
server-go/internal/httpapi/integrations_node_test.go

@@ -0,0 +1,291 @@
+// integrations_node_test.go - #2272: modo de catálogo "node" para pushers que
+// corre el operador en el host monitorizado. El servidor registra la fila,
+// emite el token y devuelve el env; no descarga, no instala y no arranca ni
+// para nada. Los tests usan un GitHub falso y un catálogo inyectado.
+package httpapi_test
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"strings"
+	"sync/atomic"
+	"testing"
+
+	"github.com/gnacho/netpulse/server-go/internal/db"
+	"github.com/gnacho/netpulse/server-go/internal/rintegration"
+)
+
+const labNodeCatalog = `{"vendors":[{"id":"labnode","mode":"node","arches":["amd64","arm64"],"tagPrefix":"labnode/v","binary":"labnode-pusher","target":"labnode/cmd/labnode-pusher","description":"Lab node vendor"}]}`
+
+// fakeReleaseServer sirve la API de releases de GitHub para el catálogo. El
+// puntero a version permite simular una publicación nueva entre dos pasos.
+func fakeReleaseServer(t *testing.T, version *atomic.Value) *httptest.Server {
+	t.Helper()
+	mux := http.NewServeMux()
+	var base string
+	mux.HandleFunc("/repos/gnacho/netpulse-integrations/releases", func(w http.ResponseWriter, _ *http.Request) {
+		v := version.Load().(string)
+		asset := fmt.Sprintf("labnode_%s_linux_amd64.tar.gz", v)
+		fmt.Fprintf(w, `[{"tag_name":"labnode/v%s","prerelease":false,"assets":[
+			{"name":%q,"browser_download_url":"%s/assets/%s"},
+			{"name":%q,"browser_download_url":"%s/sha256"}]}]`,
+			v, asset, base, asset, asset+".sha256", base)
+	})
+	mux.HandleFunc("/sha256", func(w http.ResponseWriter, _ *http.Request) {
+		fmt.Fprint(w, strings.Repeat("a", 64))
+	})
+	srv := httptest.NewServer(mux)
+	base = srv.URL
+	t.Cleanup(srv.Close)
+	return srv
+}
+
+// nodeTestServer levanta el servidor completo con el catálogo de un vendor
+// modo node servido por el fetch inyectado y el fetcher apuntando al GitHub
+// falso. El GET de vendors del principio refresca la caché para que el alta
+// resuelva el vendor.
+func nodeTestServer(t *testing.T, releases *httptest.Server) (*testServer, *rintegration.Manager, string) {
+	t.Helper()
+	var apiHits atomic.Int32
+	ts, mgr := makeIntegrationsTestServerFull(t, func(_ *db.DB, mgr *rintegration.Manager) {
+		mgr.Fetch().APIBase = releases.URL
+		mgr.Fetch().Client = releases.Client()
+	}, func(d *db.DB) *rintegration.Catalog {
+		c := rintegration.NewCatalog(d.DB)
+		c.FetchOverride = func(string) ([]byte, error) {
+			apiHits.Add(1)
+			return []byte(labNodeCatalog), nil
+		}
+		return c
+	})
+	_, cookie, _ := loginCookie(t, ts.URL, "admin", "test123456")
+	if res := get(t, ts.URL, "/api/integrations/vendors", cookie); res.StatusCode != http.StatusOK {
+		t.Fatalf("GET vendors: status %d", res.StatusCode)
+	}
+	if apiHits.Load() == 0 {
+		t.Fatalf("the catalog fetch must run to cache the labnode vendor")
+	}
+	return ts, mgr, cookie
+}
+
+func send(t *testing.T, method, url, cookie, body string) *http.Response {
+	t.Helper()
+	req, _ := http.NewRequest(method, url, strings.NewReader(body))
+	req.Header.Set("Content-Type", "application/json")
+	if cookie != "" {
+		req.Header.Set("Cookie", "session="+cookie)
+	}
+	res, err := http.DefaultClient.Do(req)
+	if err != nil {
+		t.Fatalf("%s %s: %v", method, url, err)
+	}
+	return res
+}
+
+// TestIntegrationNodeCreateIssuesTokenWithoutInstalling: el alta crea la fila
+// en pending, emite token y devuelve el env sin descargar el binario, sin
+// escribir fichero de entorno y sin arrancar ningún proceso.
+func TestIntegrationNodeCreateIssuesTokenWithoutInstalling(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, mgr, cookie := nodeTestServer(t, releases)
+
+	res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`)
+	if res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d (%v)", res.StatusCode, readJSON(t, res))
+	}
+	body := readJSON(t, res)
+	token, _ := body["token"].(string)
+	if token == "" {
+		t.Fatalf("create must issue a token: %v", body)
+	}
+	env, ok := body["env"].(map[string]any)
+	if !ok {
+		t.Fatalf("create must return the env the operator has to set: %v", body)
+	}
+	for _, k := range []string{"NETPULSE_SERVER", "NETPULSE_TOKEN", "NETPULSE_SLUG", "NETPULSE_INTERVAL"} {
+		if _, ok := env[k]; !ok {
+			t.Fatalf("env is missing %s: %v", k, env)
+		}
+	}
+	if env["NETPULSE_TOKEN"] != token {
+		t.Fatalf("env token %v does not match the issued token", env["NETPULSE_TOKEN"])
+	}
+	if env["NETPULSE_SLUG"] != "labnode-legion" || env["NETPULSE_INTERVAL"] != "60s" {
+		t.Fatalf("env slug/interval = %v / %v", env["NETPULSE_SLUG"], env["NETPULSE_INTERVAL"])
+	}
+
+	item, _ := body["integration"].(map[string]any)
+	if item["mode"] != "node" {
+		t.Fatalf("integration mode = %v, want node", item["mode"])
+	}
+	if item["state"] != "pending" {
+		t.Fatalf("integration state = %v, want pending (nothing runs on the server)", item["state"])
+	}
+	if item["version"] != "1.2.3" {
+		t.Fatalf("integration version = %v, want the resolved release", item["version"])
+	}
+	if item["host"] != "labnode-legion" {
+		t.Fatalf("host label = %v, want the slug when the form sends none", item["host"])
+	}
+
+	if mgr.Running("labnode-legion") {
+		t.Fatalf("a node pusher must never be started by the server")
+	}
+	if _, err := mgr.Env("labnode-legion"); err == nil {
+		t.Fatalf("a node pusher has no env file on the server")
+	}
+}
+
+// TestIntegrationNodeStartStopNotManaged: start y stop responden 409 sin tocar
+// el estado, porque el proceso vive en el nodo.
+func TestIntegrationNodeStartStopNotManaged(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, _, cookie := nodeTestServer(t, releases)
+
+	if res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`); res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d", res.StatusCode)
+	}
+	for _, action := range []string{"start", "stop"} {
+		res := send(t, "POST", ts.URL+"/api/integrations/labnode-legion/"+action, cookie, "")
+		if res.StatusCode != http.StatusConflict {
+			t.Fatalf("%s: status %d, want 409", action, res.StatusCode)
+		}
+		body := readJSON(t, res)
+		if body["error"] != "not_managed" {
+			t.Fatalf("%s: error = %v, want not_managed", action, body["error"])
+		}
+	}
+	list := readJSON(t, get(t, ts.URL, "/api/integrations", cookie))
+	rows, _ := list["integrations"].([]any)
+	if len(rows) != 1 {
+		t.Fatalf("integrations = %v", rows)
+	}
+	if state, _ := rows[0].(map[string]any)["state"]; state != "pending" {
+		t.Fatalf("state after start/stop = %v, want pending", state)
+	}
+}
+
+// TestIntegrationNodeCheckReportsUnmanaged: el check no finge un proceso ni
+// reconcilia el estado guardado.
+func TestIntegrationNodeCheckReportsUnmanaged(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, _, cookie := nodeTestServer(t, releases)
+
+	if res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`); res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d", res.StatusCode)
+	}
+	res := send(t, "POST", ts.URL+"/api/integrations/labnode-legion/check", cookie, "")
+	if res.StatusCode != http.StatusOK {
+		t.Fatalf("check: status %d", res.StatusCode)
+	}
+	body := readJSON(t, res)
+	if body["managed"] != false {
+		t.Fatalf("check managed = %v, want false", body["managed"])
+	}
+	if body["running"] != false {
+		t.Fatalf("check running = %v, want false", body["running"])
+	}
+	item, _ := body["integration"].(map[string]any)
+	if item["state"] != "pending" {
+		t.Fatalf("check must not touch the stored state, got %v", item["state"])
+	}
+}
+
+// TestIntegrationNodeUpdateRefreshesVersionOnly: el update solo refleja la
+// versión publicada, sin instalar ni arrancar.
+func TestIntegrationNodeUpdateRefreshesVersionOnly(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, mgr, cookie := nodeTestServer(t, releases)
+
+	if res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`); res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d", res.StatusCode)
+	}
+	version.Store("1.3.0")
+	res := send(t, "POST", ts.URL+"/api/integrations/labnode-legion/update", cookie, "")
+	if res.StatusCode != http.StatusOK {
+		t.Fatalf("update: status %d (%v)", res.StatusCode, readJSON(t, res))
+	}
+	item, _ := readJSON(t, res)["integration"].(map[string]any)
+	if item["version"] != "1.3.0" {
+		t.Fatalf("version after update = %v, want 1.3.0", item["version"])
+	}
+	if item["state"] != "pending" {
+		t.Fatalf("state after update = %v, want pending", item["state"])
+	}
+	if mgr.Running("labnode-legion") {
+		t.Fatalf("update must not start a node pusher")
+	}
+}
+
+// TestIntegrationNodeEditOnlyLabelAndInterval: la edición acepta etiqueta e
+// intervalo y rechaza credenciales, que se configuran en el nodo.
+func TestIntegrationNodeEditOnlyLabelAndInterval(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, _, cookie := nodeTestServer(t, releases)
+
+	if res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`); res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d", res.StatusCode)
+	}
+	res := send(t, "PUT", ts.URL+"/api/integrations/labnode-legion", cookie,
+		`{"host":"legion","intervalS":120}`)
+	if res.StatusCode != http.StatusOK {
+		t.Fatalf("edit: status %d (%v)", res.StatusCode, readJSON(t, res))
+	}
+	item, _ := readJSON(t, res)["integration"].(map[string]any)
+	if item["host"] != "legion" || item["intervalS"].(float64) != 120 {
+		t.Fatalf("edited row = %v", item)
+	}
+	if item["state"] != "pending" {
+		t.Fatalf("edit must not set a state, got %v", item["state"])
+	}
+
+	for _, bad := range []string{`{"username":"root"}`, `{"password":"secret"}`} {
+		res := send(t, "PUT", ts.URL+"/api/integrations/labnode-legion", cookie, bad)
+		if res.StatusCode != http.StatusBadRequest {
+			t.Fatalf("edit %s: status %d, want 400", bad, res.StatusCode)
+		}
+	}
+}
+
+// TestIntegrationNodeDeleteLeavesNothingBehind: el borrado quita fila, router y
+// token sin llamar al supervisor ni al pool SSH.
+func TestIntegrationNodeDeleteLeavesNothingBehind(t *testing.T) {
+	var version atomic.Value
+	version.Store("1.2.3")
+	releases := fakeReleaseServer(t, &version)
+	ts, mgr, cookie := nodeTestServer(t, releases)
+
+	if res := send(t, "POST", ts.URL+"/api/integrations", cookie,
+		`{"slug":"labnode-legion","vendor":"labnode","intervalS":60}`); res.StatusCode != http.StatusCreated {
+		t.Fatalf("create: status %d", res.StatusCode)
+	}
+	if res := send(t, "DELETE", ts.URL+"/api/integrations/labnode-legion", cookie, ""); res.StatusCode != http.StatusNoContent {
+		t.Fatalf("delete: status %d", res.StatusCode)
+	}
+	list := readJSON(t, get(t, ts.URL, "/api/integrations", cookie))
+	if rows, _ := list["integrations"].([]any); len(rows) != 0 {
+		t.Fatalf("integration still listed after delete: %v", rows)
+	}
+	if mgr.Running("labnode-legion") {
+		t.Fatalf("delete must not leave a process")
+	}
+	if _, err := mgr.Env("labnode-legion"); err == nil {
+		t.Fatalf("no env file was ever written for a node pusher")
+	}
+}

+ 1 - 1
server-go/internal/rintegration/catalog.go

@@ -115,7 +115,7 @@ func vendorFromEntry(e catalogEntry, seen map[string]bool) (Vendor, bool) {
 	if !catalogIDRe.MatchString(e.ID) || seen[e.ID] {
 		return Vendor{}, false
 	}
-	if e.Mode != "local" && e.Mode != "ssh" {
+	if e.Mode != ModeLocal && e.Mode != ModeSSH && e.Mode != ModeNode {
 		return Vendor{}, false
 	}
 	if e.TagPrefix == "" || e.Binary == "" || len(e.Arches) == 0 {

+ 36 - 0
server-go/internal/rintegration/catalog_test.go

@@ -361,3 +361,39 @@ func TestCatalogRefreshForcesFetch(t *testing.T) {
 		t.Fatalf("failed refresh must keep the previous catalog: %+v", vs)
 	}
 }
+
+// TestVendorModesNode (#2272): "node" es un modo válido del catálogo y ninguno
+// de sus ayudantes lo confunde con un pusher que instala o gestiona el
+// servidor. Un modo desconocido sigue descartándose.
+func TestVendorModesNode(t *testing.T) {
+	entry := catalogEntry{
+		ID: "labnode", Mode: ModeNode, Arches: []string{"amd64"},
+		TagPrefix: "labnode/v", Binary: "labnode-pusher",
+		Target: "labnode/cmd/labnode-pusher", Description: "lab node vendor",
+	}
+	v, ok := vendorFromEntry(entry, map[string]bool{})
+	if !ok {
+		t.Fatal("mode node must be accepted by the catalog")
+	}
+	if !v.OperatorInstalled() || v.ServerManaged() || v.ServerInstalls() {
+		t.Fatalf("node vendor helpers: operator=%v managed=%v installs=%v",
+			v.OperatorInstalled(), v.ServerManaged(), v.ServerInstalls())
+	}
+
+	local := Vendor{Mode: ModeLocal}
+	if !local.ServerManaged() || !local.ServerInstalls() || local.OperatorInstalled() {
+		t.Fatal("local must stay server-managed and server-installed")
+	}
+	ssh := Vendor{Mode: ModeSSH}
+	if ssh.ServerManaged() || !ssh.ServerInstalls() || ssh.OperatorInstalled() {
+		t.Fatal("ssh must stay server-installed but not server-managed")
+	}
+
+	entry.Mode = "manager"
+	if _, ok := vendorFromEntry(entry, map[string]bool{}); ok {
+		t.Fatal("an unknown mode must be discarded")
+	}
+	if ValidMode("manager") {
+		t.Fatal("ValidMode must reject an unknown mode")
+	}
+}

+ 39 - 5
server-go/internal/rintegration/vendors.go

@@ -1,18 +1,32 @@
-// Package rintegration manages external router integrations (#1674): pushers
-// that run on the NetPulse server (mode "local") or on the router itself
-// (mode "ssh") and push data to the agent ingest endpoint with the external
-// agent contract.
+// Package rintegration manages external integrations (#1674): pushers that
+// run on the NetPulse server (mode "local"), on the router itself (mode
+// "ssh") or on the monitored host under the operator's own supervision (mode
+// "node"), and push data to the agent ingest endpoint with the external agent
+// contract.
 package rintegration
 
 import "strings"
 
+// Mode values for Vendor.Mode, as declared by the catalog.
+const (
+	// ModeLocal: NetPulse downloads the binary and runs it as a managed
+	// child on the server host.
+	ModeLocal = "local"
+	// ModeSSH: NetPulse installs the pusher inside the router over SSH.
+	ModeSSH = "ssh"
+	// ModeNode: the operator installs and supervises the pusher on the
+	// monitored host. NetPulse only registers the row, issues the token and
+	// shows what to set (#2272); it never installs, starts or stops it.
+	ModeNode = "node"
+)
+
 // Vendor is one supported external pusher as resolved from the vendor
 // catalog. The catalog entries (vendors.json in netpulse-integrations) decide
 // which vendors exist; the fields the schema does not carry (Repo, AssetTmpl,
 // Init) are derived server-side by the Catalog when it builds this struct.
 type Vendor struct {
 	ID          string // catalog "id"
-	Mode        string // "local" (runs on this host) | "ssh" (installed on the router)
+	Mode        string // "local" (runs on this host) | "ssh" (installed on the router) | "node" (installed on the monitored host)
 	Repo        string // GitHub repo that publishes the releases (derived: CatalogRepo)
 	TagPrefix   string // release tags for this vendor (e.g. "routeros/v")
 	AssetTmpl   string // asset name template with {version} and {arch} (derived)
@@ -32,6 +46,26 @@ func (v Vendor) InitSystem() string {
 	return "procd"
 }
 
+// ServerManaged reports whether NetPulse runs the pusher itself, as a child
+// process of the server. Only mode "local" works that way.
+func (v Vendor) ServerManaged() bool { return v.Mode == ModeLocal }
+
+// ServerInstalls reports whether NetPulse performs the installation of the
+// pusher: it downloads the binary for "local" and installs it over SSH for
+// "ssh". A "node" vendor is installed by the operator, never by the server.
+func (v Vendor) ServerInstalls() bool {
+	return v.Mode == ModeLocal || v.Mode == ModeSSH
+}
+
+// OperatorInstalled reports whether the pusher runs on the monitored host
+// under the operator's own supervision (mode "node").
+func (v Vendor) OperatorInstalled() bool { return v.Mode == ModeNode }
+
+// ValidMode reports whether the catalog may declare this mode.
+func ValidMode(mode string) bool {
+	return mode == ModeLocal || mode == ModeSSH || mode == ModeNode
+}
+
 // AssetName renders the asset name for a resolved version and architecture.
 func (v Vendor) AssetName(version, arch string) string {
 	name := v.AssetTmpl