Add optional threshold fields to Monitor for hardware monitoring
This commit is contained in:
1 parent
b500a451d3
commit
d392317f13
1 file changed
+8
-1
@@ -1,5 +1,4 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import Notification from "./Notification.js";
|
|
||||||
|
|
||||||
const MonitorSchema = mongoose.Schema(
|
const MonitorSchema = mongoose.Schema(
|
||||||
{
|
{
|
||||||
@@ -48,6 +47,14 @@ const MonitorSchema = mongoose.Schema(
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
|
thresholds: {
|
||||||
|
type: {
|
||||||
|
usage_cpu: { type: Number },
|
||||||
|
usage_memory: { type: Number },
|
||||||
|
usage_disk: { type: Number },
|
||||||
|
},
|
||||||
|
_id: false,
|
||||||
|
},
|
||||||
notifications: [
|
notifications: [
|
||||||
{
|
{
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
|||||||
Reference in new issue
Block a user