Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

2.7 KB
Raw Blame
import type { BackupAlertConfig, SnapshotAlertConfig } from '@/types/alerts';

export const FACTORY_GUEST_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 90,
  diskRead: -1,
  diskWrite: -1,
  networkIn: -1,
  networkOut: -1,
};

export const FACTORY_NODE_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 90,
  temperature: 80,
};

export const FACTORY_PBS_DEFAULTS = {
  cpu: 80,
  memory: 85,
};

export const FACTORY_KUBERNETES_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 90,
  diskRead: -1,
  diskWrite: -1,
  networkIn: -1,
  networkOut: -1,
};

export const FACTORY_TRUENAS_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 85,
  usage: 85,
  temperature: 80,
  diskRead: -1,
  diskWrite: -1,
  networkIn: -1,
  networkOut: -1,
};

// TrueNAS disk temperature has no flat factory value. Unset, each TrueNAS disk
// follows Disk temperature by type, as the backend resolves it
// (trueNASDiskTemperatureDefaultNoLock); a saved value applies to every
// TrueNAS disk.
export const FACTORY_TRUENAS_DISK_DEFAULTS: Record<string, number | undefined> = {
  temperature: undefined,
};

export const FACTORY_VMWARE_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 90,
  usage: 85,
  diskRead: -1,
  diskWrite: -1,
  networkIn: -1,
  networkOut: -1,
};

export const FACTORY_AGENT_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 90,
  diskTemperature: 55,
  smartHealthFailure: 1,
  smartReallocated: 1,
  smartPending: 1,
  smartUncorrectable: 1,
  smartMediaErrors: 1,
  smartCrcErrorDelta: 1,
  smartLifeWarning: 10,
  smartLifeCritical: 5,
  smartSpareWarning: 20,
  smartSpareCritical: 10,
};

// Mirrors the backend's seeded DiskTempByType defaults (trigger °C).
export const FACTORY_DISK_TEMP_BY_TYPE: Record<string, number> = {
  nvme: 70,
  sas: 65,
  sata: 55,
};

export const FACTORY_DOCKER_DEFAULTS = {
  cpu: 80,
  memory: 85,
  disk: 85,
  restartCount: 3,
  restartWindow: 300,
  memoryWarnPct: 90,
  memoryCriticalPct: 95,
  serviceWarnGapPercent: 10,
  serviceCriticalGapPercent: 50,
  // Hours before an available image update raises an alert; -1 disables update alerts.
  updateAlertDelayHours: 24,
};

export const FACTORY_DOCKER_STATE_DISABLE_CONNECTIVITY = false;
export const FACTORY_DOCKER_STATE_SEVERITY: 'warning' | 'critical' = 'warning';
export const FACTORY_STORAGE_DEFAULT = 85;

export const FACTORY_SNAPSHOT_DEFAULTS: SnapshotAlertConfig = {
  enabled: false,
  warningDays: 30,
  criticalDays: 45,
  // 0 disables size-based snapshot alerts; the engine only fires on sizes > 0.
  warningSizeGiB: 0,
  criticalSizeGiB: 0,
};

export const FACTORY_BACKUP_DEFAULTS: BackupAlertConfig = {
  enabled: false,
  warningDays: 7,
  criticalDays: 14,
  freshHours: 24,
  staleHours: 72,
  alertOrphaned: true,
  ignoreVMIDs: [],
};