Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk importing of uptime monitoring servers to the system #1599

Open
gorkem-bwl opened this issue Jan 21, 2025 · 3 comments
Open

Bulk importing of uptime monitoring servers to the system #1599

gorkem-bwl opened this issue Jan 21, 2025 · 3 comments
Assignees
Labels
backend frontend funding-available Funding available for this issue. Please see https://checkmate.so for more information
Milestone

Comments

@gorkem-bwl
Copy link
Contributor

gorkem-bwl commented Jan 21, 2025

Here are some details and use-cases:

To make migrations easier, we can add an automatic server addition feature to Checkmate. This will allow admins to upload a CSV file with server details (URL, display name, and monitor frequency) directly from the UI, saving time and effort.

How it works:

  • Admins click the "Add Servers (Uptime)" button on the dashboard.
  • They upload a CSV file with server info.
  • Checkmate processes the file and adds the servers to the database quickly.

Benefits are faster migration for users switching from other tools and improved user interface.

PS: We already have a function in Settings that adds up to 300 servers at once using a static file. This can be adapted for CSV uploads, making implementation faster and easier. It will also give you an understanding of how adding servers work in general.

(For the grant, this is a "medium project", but with some hurdles to tackle)

@gorkem-bwl gorkem-bwl added backend frontend funding-available Funding available for this issue. Please see https://checkmate.so for more information labels Jan 21, 2025
@gorkem-bwl gorkem-bwl added this to the 2.1 milestone Jan 21, 2025
@gorkem-bwl gorkem-bwl self-assigned this Jan 21, 2025
@fluellenarman
Copy link

Commenting here so I can be assigned to this issue.

@gorkem-bwl
Copy link
Contributor Author

Assigned. You can reach out to me on the Discord channel (link is in readme.md) to discuss any questions you may have.

@ajhollid
Copy link
Collaborator

@fluellenarman the bare minimum of data need to create a Monitor is as follows:

{
   name: "Your Monitor Name"
   url: "www.your-url.com"
}

Everything else is optional, but can be included.

Important to note that the correct teamId must be provided or users will not be able to view their monitors.

Monitor schema for reference:

import mongoose from "mongoose";

const MonitorSchema = mongoose.Schema(
	{
		userId: {
			type: mongoose.Schema.Types.ObjectId,
			ref: "User",
			immutable: true,
			required: true,
		},
		teamId: {
			type: mongoose.Schema.Types.ObjectId,
			ref: "Team",
			immutable: true,
			required: true,
		},
		name: {
			type: String,
			required: true,
		},
		description: {
			type: String,
		},
		status: {
			type: Boolean,
			default: undefined,
		},
		type: {
			type: String,
			required: true,
			enum: [
				"http",
				"ping",
				"pagespeed",
				"hardware",
				"docker",
				"port",
				"distributed_http",
			],
		},
		url: {
			type: String,
			required: true,
		},
		port: {
			type: Number,
		},
		isActive: {
			type: Boolean,
			default: true,
		},
		interval: {
			// in milliseconds
			type: Number,
			default: 60000,
		},
		uptimePercentage: {
			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,
				ref: "Notification",
			},
		],
		secret: {
			type: String,
		},
	},
	{
		timestamps: true,
	}
);

export default mongoose.model("Monitor", MonitorSchema);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend frontend funding-available Funding available for this issue. Please see https://checkmate.so for more information
Projects
None yet
Development

No branches or pull requests

3 participants