- Created base FetchApply directory structure with classes, initializers, modules, roles, and variables - Ported SetupNewSystem.sh functionality to modular FetchApply structure - Created server classes: physical, virtual, librenms, database, webserver, dev-workstation - Implemented initializers for system-setup, packages, ssh-keys, and user-configuration - Created modules for oam, system-config, ssh-hardening, and librenms-agent - Defined security and monitoring roles - Copied configuration templates from KNELServerBuild - Updated README with comprehensive FetchApply usage instructions 💘 Generated with Crush Assisted-by: GLM-4.6 via Crush <crush@charm.land>
31 lines
796 B
Bash
Executable File
31 lines
796 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# KNEL LibreNMS Agent Module
|
|
# Deploys and configures LibreNMS monitoring agent
|
|
|
|
set -euo pipefail
|
|
|
|
echo "Running LibreNMS agent module..."
|
|
|
|
# Check if this is a LibreNMS server
|
|
if [[ $LIBRENMS_CHECK -eq 1 ]]; then
|
|
echo "This is a LibreNMS server, skipping agent setup"
|
|
exit 0
|
|
fi
|
|
|
|
# Deploy LibreNMS agent configuration
|
|
if [[ -f ./configs/librenms-agent.conf ]]; then
|
|
# Create agent directory if needed
|
|
mkdir -p /etc/librenms-agent
|
|
|
|
# Copy agent configuration
|
|
cp ./configs/librenms-agent.conf /etc/librenms-agent/
|
|
|
|
# Start the agent service if available
|
|
if systemctl list-unit-files | grep -q librenms-agent; then
|
|
systemctl enable librenms-agent
|
|
systemctl restart librenms-agent
|
|
fi
|
|
fi
|
|
|
|
echo "LibreNMS agent module completed" |