@daemonitor/plugins 1.1.26 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/dist/lib/BasePlugin.js +1 -1
- package/dist/lib/MonitoringPlugin.js +1 -1
- package/dist/lib/PluginLoader.js +1 -1
- package/dist/lib/PluginManager.js +2 -2
- package/dist/plugins/index.js +16 -16
- package/dist/plugins/monitoring/DockerPlugin.js +1 -1
- package/dist/plugins/monitoring/LogWatchPlugin.js +1 -1
- package/dist/plugins/monitoring/LxcPlugin.js +1 -1
- package/dist/plugins/monitoring/NetScanPlugin.js +1 -1
- package/dist/plugins/monitoring/OSPlugin.js +2 -2
- package/dist/plugins/monitoring/PM2Plugin.js +1 -1
- package/dist/plugins/monitoring/SnmpPlugin.js +1 -1
- package/dist/plugins/monitoring/ThreeCXPlugin.js +1 -1
- package/dist/plugins/monitoring/TplinkPlugin.js +1 -1
- package/dist/plugins/monitoring/WebsitePlugin.js +1 -1
- package/dist/plugins/monitoring/WordpressPlugin.js +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Export core plugin utilities
|
|
2
|
-
export { PluginConfigProvider } from "./lib/PluginConfigProvider";
|
|
3
|
-
export { PluginManager } from "./lib/PluginManager";
|
|
4
|
-
export { PluginLoader } from "./lib/PluginLoader";
|
|
2
|
+
export { PluginConfigProvider } from "./lib/PluginConfigProvider.js";
|
|
3
|
+
export { PluginManager } from "./lib/PluginManager.js";
|
|
4
|
+
export { PluginLoader } from "./lib/PluginLoader.js";
|
|
5
5
|
// Only export creation functions, not types
|
|
6
|
-
export { createBasePlugin } from "./lib/BasePlugin";
|
|
7
|
-
export { createMonitoringPlugin } from "./lib/MonitoringPlugin";
|
|
6
|
+
export { createBasePlugin } from "./lib/BasePlugin.js";
|
|
7
|
+
export { createMonitoringPlugin } from "./lib/MonitoringPlugin.js";
|
|
8
8
|
// Export the PM2 plugin factory function
|
|
9
|
-
export { createPM2Plugin } from "./plugins/monitoring/PM2Plugin";
|
|
9
|
+
export { createPM2Plugin } from "./plugins/monitoring/PM2Plugin.js";
|
package/dist/lib/BasePlugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginConfigProvider } from "./PluginConfigProvider";
|
|
1
|
+
import { PluginConfigProvider } from "./PluginConfigProvider.js";
|
|
2
2
|
let currentPluginIndex = 0;
|
|
3
3
|
export function createBasePlugin(alias, name, description, setupFn, monitorFn, refreshFn, teardownFn) {
|
|
4
4
|
const config = PluginConfigProvider.get(alias);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginManager } from "./PluginManager";
|
|
1
|
+
import { PluginManager } from "./PluginManager.js";
|
|
2
2
|
let monitoringPluginIndex = 0;
|
|
3
3
|
export function createMonitoringPlugin(alias, name, description, setupFn, monitorFn, refreshFn, teardownFn) {
|
|
4
4
|
const config = PluginManager.getConfig ? PluginManager.getConfig(alias) : {};
|
package/dist/lib/PluginLoader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PluginLoader } from "./PluginLoader";
|
|
2
|
-
import { PluginConfigProvider } from "./PluginConfigProvider";
|
|
1
|
+
import { PluginLoader } from "./PluginLoader.js";
|
|
2
|
+
import { PluginConfigProvider } from "./PluginConfigProvider.js";
|
|
3
3
|
// Singleton state
|
|
4
4
|
const state = {
|
|
5
5
|
availablePlugins: [],
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// Import plugin factory functions
|
|
2
|
-
import { createPM2Plugin } from "./monitoring/PM2Plugin";
|
|
3
|
-
import { createDockerPlugin } from "./monitoring/DockerPlugin";
|
|
4
|
-
import { createLxcPlugin } from "./monitoring/LxcPlugin";
|
|
5
|
-
import { createOSPlugin } from "./monitoring/OSPlugin";
|
|
6
|
-
import { createWebsitePlugin } from "./monitoring/WebsitePlugin";
|
|
7
|
-
import { createWordpressPlugin } from "./monitoring/WordpressPlugin";
|
|
8
|
-
import { createLogWatchPlugin } from "./monitoring/LogWatchPlugin";
|
|
9
|
-
import { createNetScanPlugin } from "./monitoring/NetScanPlugin";
|
|
10
|
-
import { createSnmpPlugin } from "./monitoring/SnmpPlugin";
|
|
11
|
-
import { createThreeCXPlugin } from "./monitoring/ThreeCXPlugin";
|
|
12
|
-
import { createTplinkPlugin } from "./monitoring/TplinkPlugin";
|
|
2
|
+
import { createPM2Plugin } from "./monitoring/PM2Plugin.js";
|
|
3
|
+
import { createDockerPlugin } from "./monitoring/DockerPlugin.js";
|
|
4
|
+
import { createLxcPlugin } from "./monitoring/LxcPlugin.js";
|
|
5
|
+
import { createOSPlugin } from "./monitoring/OSPlugin.js";
|
|
6
|
+
import { createWebsitePlugin } from "./monitoring/WebsitePlugin.js";
|
|
7
|
+
import { createWordpressPlugin } from "./monitoring/WordpressPlugin.js";
|
|
8
|
+
import { createLogWatchPlugin } from "./monitoring/LogWatchPlugin.js";
|
|
9
|
+
import { createNetScanPlugin } from "./monitoring/NetScanPlugin.js";
|
|
10
|
+
import { createSnmpPlugin } from "./monitoring/SnmpPlugin.js";
|
|
11
|
+
import { createThreeCXPlugin } from "./monitoring/ThreeCXPlugin.js";
|
|
12
|
+
import { createTplinkPlugin } from "./monitoring/TplinkPlugin.js";
|
|
13
13
|
// In future, implement other plugin factory functions using the same pattern
|
|
14
|
-
// import { createOSPlugin } from "./monitoring/OSPlugin"
|
|
15
|
-
// import { createMongoDBPlugin } from "./monitoring/MongoDBPlugin"
|
|
16
|
-
// import { createWebsitePlugin } from "./monitoring/WebsitePlugin"
|
|
17
|
-
// import { createCloudflarePlugin } from "./monitoring/CloudflarePlugin"
|
|
18
|
-
// import { createEwelinkPlugin } from "./monitoring/EwelinkPlugin"
|
|
14
|
+
// import { createOSPlugin } from "./monitoring/OSPlugin.js"
|
|
15
|
+
// import { createMongoDBPlugin } from "./monitoring/MongoDBPlugin.js"
|
|
16
|
+
// import { createWebsitePlugin } from "./monitoring/WebsitePlugin.js"
|
|
17
|
+
// import { createCloudflarePlugin } from "./monitoring/CloudflarePlugin.js"
|
|
18
|
+
// import { createEwelinkPlugin } from "./monitoring/EwelinkPlugin.js"
|
|
19
19
|
// Export factory functions to create plugin instances.
|
|
20
20
|
// (Keys are display-only; the manager activates a plugin when its getName()
|
|
21
21
|
// lowercased matches an alias in the config `plugins` array.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { stat, open } from "node:fs/promises";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
3
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
4
4
|
// Cap a single tail read so a rotated-in giant file (or fromStart on a large
|
|
5
5
|
// log) can't blow up memory — read at most the last MAX_READ bytes.
|
|
6
6
|
const MAX_READ = 5 * 1024 * 1024;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
3
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
4
4
|
// LAN device reachability monitor. Pings a configured list of devices (the
|
|
5
5
|
// office infrastructure — switch, printers, APs, extenders, PBX, router, NAS,
|
|
6
6
|
// phones — plus any hosts worth watching) and reports up/down + latency for
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
1
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
2
2
|
import { arch, cpus, freemem, hostname, loadavg, networkInterfaces, platform, release, totalmem, type, uptime, } from "os";
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
|
-
import { parseProcesses, PS_CMD } from "../../lib/processes";
|
|
5
|
+
import { parseProcesses, PS_CMD } from "../../lib/processes.js";
|
|
6
6
|
// Named service processes (nginx / php-fpm / db / …) running on the host.
|
|
7
7
|
function collectProcesses() {
|
|
8
8
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
3
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
4
4
|
// SNMP monitor. First target class: printers (standard Printer-MIB) — model,
|
|
5
5
|
// serial, lifetime page count, and per-supply toner/consumable levels. Shells
|
|
6
6
|
// out to net-snmp's snmpget/snmpwalk (add `snmp` to the client image) rather
|
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import { connect } from "node:net";
|
|
4
4
|
import { hostname } from "node:os";
|
|
5
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
5
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
6
6
|
// 3CX PhoneSystem monitor. Runs ON a 3CX appliance (Debian) and watches the
|
|
7
7
|
// signals that actually break a PBX, using only unprivileged, auth-free reads:
|
|
8
8
|
// - every 3CX* systemd unit is active (a crashed CallFlow/SIP/Media server is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
2
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
3
3
|
// Live sessions per device IP — re-used across polls, rebuilt when they lapse.
|
|
4
4
|
const sessions = {};
|
|
5
5
|
function slug(s) {
|
|
@@ -2,7 +2,7 @@ import * as http from "node:http";
|
|
|
2
2
|
import * as https from "node:https";
|
|
3
3
|
import * as net from "node:net";
|
|
4
4
|
import { URL } from "node:url";
|
|
5
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
5
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
6
6
|
// URL keeps IPv6 hosts bracketed ("[::1]"); net.isIP wants them bare.
|
|
7
7
|
function isIpLiteral(hostname) {
|
|
8
8
|
return net.isIP(hostname.replace(/^\[|\]$/g, "")) !== 0;
|
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import { readdir } from "node:fs/promises";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
-
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin";
|
|
5
|
+
import { createMonitoringPlugin } from "../../lib/MonitoringPlugin.js";
|
|
6
6
|
// WordPress security-posture plugin. Runs on the WP host (where the daemonitor
|
|
7
7
|
// client already runs) and polls the state that the Archpaper intrusions moved
|
|
8
8
|
// through: admin accounts, page statuses, must-use plugins, and the web user's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daemonitor/plugins",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"description": "daemonitor plugins",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
},
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "ISC",
|
|
25
|
-
"packageManager": "pnpm@8.2.0",
|
|
26
25
|
"devDependencies": {
|
|
27
26
|
"@types/node": "^26.1.1",
|
|
28
27
|
"nuxt": "^3.15.4",
|
|
@@ -52,6 +51,9 @@
|
|
|
52
51
|
"overrides": {
|
|
53
52
|
"js-yaml": "^4.3.1"
|
|
54
53
|
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18.17"
|
|
56
|
+
},
|
|
55
57
|
"scripts": {
|
|
56
58
|
"build": "tsc",
|
|
57
59
|
"test": "echo \"Error: no test specified\" && exit 1"
|