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:
12
ts/nupst.ts
12
ts/nupst.ts
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user