Add optional threshold fields to Monitor for hardware monitoring

This commit is contained in:
Alex Holliday committed 2024-10-23 12:05:50 +08:00
1 parent b500a451d3
commit d392317f13
1 file changed
+8 -1
+8 -1
View File
@@ -1,5 +1,4 @@
import mongoose from "mongoose";
import Notification from "./Notification.js";
const MonitorSchema = mongoose.Schema(
{
@@ -48,6 +47,14 @@ const MonitorSchema = mongoose.Schema(
type: Number,
default: undefined,
},
thresholds: {
type: {
usage_cpu: { type: Number },
usage_memory: { type: Number },
usage_disk: { type: Number },
},
_id: false,
},
notifications: [
{
type: mongoose.Schema.Types.ObjectId,