feat(monitoring): add edge-triggered threshold handling with group action orchestration and HA-aware Proxmox shutdowns
This commit is contained in:
+10
-2
@@ -346,8 +346,8 @@ WantedBy=multi-user.target
|
||||
*/
|
||||
private async displaySingleUpsStatus(ups: IUpsConfig, snmp: NupstSnmp): Promise<void> {
|
||||
try {
|
||||
const defaultShutdownDelay =
|
||||
this.daemon.getConfig().defaultShutdownDelay ?? SHUTDOWN.DEFAULT_DELAY_MINUTES;
|
||||
const defaultShutdownDelay = this.daemon.getConfig().defaultShutdownDelay ??
|
||||
SHUTDOWN.DEFAULT_DELAY_MINUTES;
|
||||
const protocol = ups.protocol || 'snmp';
|
||||
let status;
|
||||
|
||||
@@ -437,6 +437,8 @@ WantedBy=multi-user.target
|
||||
if (action.type === 'shutdown') {
|
||||
const shutdownDelay = action.shutdownDelay ?? defaultShutdownDelay;
|
||||
actionDesc += `, delay=${shutdownDelay}min`;
|
||||
} else if (action.type === 'proxmox' && action.proxmoxHaPolicy === 'haStop') {
|
||||
actionDesc += ', ha=stop';
|
||||
}
|
||||
actionDesc += ')';
|
||||
} else {
|
||||
@@ -444,6 +446,8 @@ WantedBy=multi-user.target
|
||||
if (action.type === 'shutdown') {
|
||||
const shutdownDelay = action.shutdownDelay ?? defaultShutdownDelay;
|
||||
actionDesc += `, delay=${shutdownDelay}min`;
|
||||
} else if (action.type === 'proxmox' && action.proxmoxHaPolicy === 'haStop') {
|
||||
actionDesc += ', ha=stop';
|
||||
}
|
||||
actionDesc += ')';
|
||||
}
|
||||
@@ -520,6 +524,8 @@ WantedBy=multi-user.target
|
||||
if (action.type === 'shutdown') {
|
||||
const shutdownDelay = action.shutdownDelay ?? defaultShutdownDelay;
|
||||
actionDesc += `, delay=${shutdownDelay}min`;
|
||||
} else if (action.type === 'proxmox' && action.proxmoxHaPolicy === 'haStop') {
|
||||
actionDesc += ', ha=stop';
|
||||
}
|
||||
actionDesc += ')';
|
||||
} else {
|
||||
@@ -527,6 +533,8 @@ WantedBy=multi-user.target
|
||||
if (action.type === 'shutdown') {
|
||||
const shutdownDelay = action.shutdownDelay ?? defaultShutdownDelay;
|
||||
actionDesc += `, delay=${shutdownDelay}min`;
|
||||
} else if (action.type === 'proxmox' && action.proxmoxHaPolicy === 'haStop') {
|
||||
actionDesc += ', ha=stop';
|
||||
}
|
||||
actionDesc += ')';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user