feat(daemon): Add UPSD (NUT) protocol support, Proxmox VM shutdown action, pause/resume monitoring, and network-loss/unreachable handling; bump config version to 4.2

This commit is contained in:
2026-02-20 11:51:59 +00:00
parent 782c8c9555
commit 42b8eaf6d2
30 changed files with 2183 additions and 697 deletions

View File

@@ -1,4 +1,5 @@
import { NupstSnmp } from './snmp/manager.ts';
import { NupstUpsd } from './upsd/client.ts';
import { NupstDaemon } from './daemon.ts';
import { NupstSystemd } from './systemd.ts';
import denoConfig from '../deno.json' with { type: 'json' };
@@ -17,6 +18,7 @@ import type { INupstAccessor, IUpdateStatus } from './interfaces/index.ts';
*/
export class Nupst implements INupstAccessor {
private readonly snmp: NupstSnmp;
private readonly upsd: NupstUpsd;
private readonly daemon: NupstDaemon;
private readonly systemd: NupstSystemd;
private readonly upsHandler: UpsHandler;
@@ -34,7 +36,8 @@ export class Nupst implements INupstAccessor {
// Initialize core components
this.snmp = new NupstSnmp();
this.snmp.setNupst(this); // Set up bidirectional reference
this.daemon = new NupstDaemon(this.snmp);
this.upsd = new NupstUpsd();
this.daemon = new NupstDaemon(this.snmp, this.upsd);
this.systemd = new NupstSystemd(this.daemon);
// Initialize handlers
@@ -52,6 +55,13 @@ export class Nupst implements INupstAccessor {
return this.snmp;
}
/**
* Get the UPSD manager for NUT protocol communication
*/
public getUpsd(): NupstUpsd {
return this.upsd;
}
/**
* Get the daemon manager for background monitoring
*/