Nord is a simple monitoring and collection tool. It's designed to be a plugin-based system for gathering data from various sources (local system, network devices via SSH/SNMP, etc.) and can send this data to remote endpoints.
- Plugin-based Architecture: Easily extendable with new data collection modules.
- Data Collection (
--collect): Gathers metrics from configured hosts and plugins, storing results indata/collection.json. - Network Perception (
--perception): Discovers hosts on the network usingnmapand identifies available services, storing results indata/perception.json. - Remote Data Sending (
--remote): Sends collected data to configured remote API endpoints. - Local System Monitoring: Collects CPU, memory, and uptime metrics.
- Network Checks: Performs ping, SSH port, and URL availability checks.
- SSH Collection: Connects to devices via SSH, runs commands, and parses output based on device-specific definitions.
- Mail Server Monitoring: Gathers Postfix mail queue and service status.
- SNMP Collection: Queries network devices via SNMP for specified OIDs.
- Go: Go 1.16 or higher.
- nmap: For the network perception feature (
--perception). Install via your system's package manager (e.g.,sudo apt install nmapon Debian/Ubuntu,brew install nmapon macOS). - sudo: Some features (like
nmapand Postfix control) requiresudoprivileges.
- Navigate to the project directory:
cd observer - Install Go Modules: This will download all necessary dependencies.
go mod tidy
The tool relies on data/config.json for its operational parameters.
{
"lang": "en",
"debug": 0,
"remote": {
"destinations": {
"primary_server": {
"endpoint": "http://your-remote-server.com/api/endpoint",
"token": "YOUR_SECRET_TOKEN",
"active": true
}
}
},
"perception": {
"local_network": {
"ranges": ["192.168.1.0/24"],
"method": "nmap",
"enabled": true,
"detection": ["network.ping", "network.ssh"]
}
},
"hosts": {
"internet": {
"address": "8.8.8.8",
"name": "Internet",
"collect": [
{"metric": "network.ping"}
]
},
"router": {
"address": "192.168.1.254",
"name": "Router",
"collect": [
{"metric": "network.ping"},
{"metric": "network.ssh"},
{"metric": "sshcollect", "credentials": "router"},
{"metric": "snmpcollect", "credentials": "router_snmp"}
]
}
},
"credentials": {
"router": {
"user": "admin",
"pass": "admin",
"host": "192.168.1.254",
"port": 22,
"type": "nokia2425"
},
"router_snmp": {
"host": "192.168.1.254",
"port": 161,
"type": "generic",
"community": "public",
"version": "2c"
}
}
}remote: Defines endpoints for sending collected data.perception: Configures network discovery scans.hosts: Lists devices to monitor and the collection tasks for each.credentials: Stores sensitive access information for devices.
- SSH Devices: SSH command sequences and parsing rules are defined in JSON files located in
observer/plugins/sshcollect/devices/(e.g.,nokia2425.json). - SNMP Devices: SNMP OID definitions are in JSON files located in
observer/plugins/snmp/devices/(e.g.,generic.json).
Run the tool from the observer/ directory.
cd observer- Collect All Data: Runs all configured collection tasks for all hosts.
go run . --collect - Run Network Perception: Discovers hosts on the network.
go run . --perception - Send Data Remotely: Sends the contents of
data/collection.jsonto configured remote endpoints.go run . --remote
You can also run specific actions on individual plugins:
# Example: Run a specific action on the mail plugin
go run . -p mail -a pause
# Example: Run a specific action on the network plugin (e.g., perception)
go run . -p network -a perception- Create a new directory for your plugin under
observer/plugins/(e.g.,observer/plugins/myplugin). - Create a
.gofile inside your plugin directory (e.g.,myplugin.go). - Define a struct that embeds
plugin.BasePluginand implements theplugin.Plugininterface. - Add an
init()function to your plugin file that callsplugins.Register(&MyPlugin{}). - Add an import for your new plugin package in
observer/plugins.go(e.g.,_ "observer/plugins/myplugin"). - Run
go mod tidyto ensure dependencies are updated.
go: go.mod file not found: Rungo mod init observerin theobserver/directory.no required module provides package ...: Rungo mod tidy.nmapnot found: Ensurenmapis installed and in your system's PATH.sudopassword prompt: Some commands requiresudoprivileges.panic: interface conversion: Check yourdata/config.jsonfor missing or incorrectly formatted fields.