v1.1: Add CIDR subnet filtering and Agent filter in Devices page
This commit is contained in:
commit
966058e2fe
422 files changed
+54656
No files matched your search
@@ -0,0 +1,24 @@
|
||||
const mongoose = require('mongoose');
|
||||
const path = require('path');
|
||||
require('dotenv').config({ path: path.join(__dirname, '..', '.env.local') });
|
||||
|
||||
async function checkDb() {
|
||||
await mongoose.connect(process.env.MONGODB_URI);
|
||||
const db = mongoose.connection.db;
|
||||
|
||||
const apps = await db.collection('app_stats').countDocuments();
|
||||
console.log('Apps records:', apps);
|
||||
|
||||
const protos = await db.collection('protocol_stats').countDocuments();
|
||||
console.log('Protocols records:', protos);
|
||||
|
||||
const countries = await db.collection('country_stats').countDocuments();
|
||||
console.log('Country records:', countries);
|
||||
|
||||
const agents = await db.collection('agent_registry').find().toArray();
|
||||
console.log('Agents:', agents.map(a => ({uuid: a.uuid, label: a.label, activated: a.activated, last_seen_at: a.last_seen_at})));
|
||||
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
checkDb().catch(console.error);
|
||||
Reference in new issue
Block a user