Set up comprehensive SNMP monitoring in Nagios Core with automated network device discovery, custom templates for switches and routers, and real-time alerting for network infrastructure monitoring.
Prerequisites
- Nagios Core 4.5 installed and configured
- Network devices with SNMP enabled
- Basic understanding of SNMP and network protocols
- Root or sudo access to the monitoring server
What this solves
Network administrators need comprehensive monitoring of switches, routers, and other SNMP-enabled devices to maintain network performance and availability. This tutorial configures Nagios Core with SNMP monitoring capabilities, automated device discovery, and customizable templates for different network equipment types.
Prerequisites
Before starting, ensure you have a working Nagios Core installation. If you haven't installed Nagios yet, follow our Nagios Core installation guide. You'll also need network devices with SNMP enabled and proper community strings configured.
Step-by-step configuration
Install SNMP utilities and MIB libraries
Install the necessary SNMP tools and Management Information Base (MIB) libraries for querying network devices.
sudo apt update
sudo apt install -y snmp snmp-mibs-downloader libsnmp-perl
Download and configure MIB files
Download standard MIB files and configure SNMP to use them for better device identification and monitoring.
sudo download-mibs
sudo sed -i 's/^mibs :/# mibs :/' /etc/snmp/snmp.conf
Test SNMP connectivity to network devices
Verify SNMP communication with your network devices before configuring Nagios monitoring.
snmpwalk -v2c -c public 203.0.113.10 1.3.6.1.2.1.1.1.0
snmpget -v2c -c public 203.0.113.10 1.3.6.1.2.1.1.5.0
Create SNMP command definitions
Define reusable SNMP commands in Nagios for common network monitoring tasks.
# SNMP System Information
define command{
command_name check_snmp_system
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.1.3.0 -w $ARG2$ -c $ARG3$
}
SNMP Interface Status
define command{
command_name check_snmp_interface
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.2.2.1.8.$ARG2$ -r 1 -w 1 -c 1
}
SNMP Interface Utilization
define command{
command_name check_snmp_interface_util
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.2.2.1.10.$ARG2$,1.3.6.1.2.1.2.2.1.16.$ARG2$ -w $ARG3$ -c $ARG4$
}
SNMP CPU Utilization
define command{
command_name check_snmp_cpu
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.9.9.109.1.1.1.1.7.1 -w $ARG2$ -c $ARG3$
}
SNMP Memory Utilization
define command{
command_name check_snmp_memory
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.9.9.48.1.1.1.5.1,1.3.6.1.4.1.9.9.48.1.1.1.6.1 -w $ARG2$ -c $ARG3$
}
Create network device host template
Define a reusable host template for network devices with common SNMP monitoring settings.
# Generic Network Device Template
define host{
name generic-network-device
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,u,r
contact_groups admins
register 0
}
Switch Template
define host{
name switch-template
use generic-network-device
hostgroups switches
icon_image switch.png
vrml_image switch.png
statusmap_image switch.gd2
register 0
}
Router Template
define host{
name router-template
use generic-network-device
hostgroups routers
icon_image router.png
vrml_image router.png
statusmap_image router.gd2
register 0
}
Create service templates for SNMP monitoring
Define service templates for common network device monitoring tasks.
# SNMP Service Template
define service{
name generic-snmp-service
use generic-service
check_interval 5
retry_interval 1
max_check_attempts 3
notification_interval 30
register 0
}
Network Interface Service Template
define service{
name network-interface-service
use generic-snmp-service
normal_check_interval 2
retry_check_interval 1
register 0
}
Create host groups for network devices
Organize network devices into logical groups for easier management and monitoring.
# Network Device Host Groups
define hostgroup{
hostgroup_name switches
alias Network Switches
members
}
define hostgroup{
hostgroup_name routers
alias Network Routers
members
}
define hostgroup{
hostgroup_name firewalls
alias Network Firewalls
members
}
define hostgroup{
hostgroup_name wireless-aps
alias Wireless Access Points
members
}
Configure network devices for monitoring
Create individual host definitions for your network devices using the templates.
# Core Switch
define host{
use switch-template
host_name core-switch-01
alias Core Switch 01
address 203.0.113.10
hostgroups switches
parents
}
Access Switch
define host{
use switch-template
host_name access-switch-01
alias Access Switch 01
address 203.0.113.11
hostgroups switches
parents core-switch-01
}
Border Router
define host{
use router-template
host_name border-router-01
alias Border Router 01
address 203.0.113.1
hostgroups routers
parents
}
Configure SNMP services for network devices
Define specific SNMP monitoring services for each type of network device.
# System Uptime Monitoring
define service{
use generic-snmp-service
host_name core-switch-01,access-switch-01,border-router-01
service_description System Uptime
check_command check_snmp_system!public!100000!50000
}
Interface Status Monitoring (GigabitEthernet1/0/1)
define service{
use network-interface-service
host_name core-switch-01
service_description Interface Gi1/0/1 Status
check_command check_snmp_interface!public!1
}
Interface Status Monitoring (GigabitEthernet1/0/2)
define service{
use network-interface-service
host_name core-switch-01
service_description Interface Gi1/0/2 Status
check_command check_snmp_interface!public!2
}
CPU Utilization (Cisco devices)
define service{
use generic-snmp-service
host_name border-router-01
service_description CPU Utilization
check_command check_snmp_cpu!public!80!95
}
Memory Utilization (Cisco devices)
define service{
use generic-snmp-service
host_name border-router-01
service_description Memory Utilization
check_command check_snmp_memory!public!80!95
}
Create automated device discovery script
Implement a script for automated discovery of SNMP-enabled devices on your network.
#!/bin/bash
SNMP Network Device Discovery Script
Usage: ./snmp_discovery.sh network_range community_string
NETWORK_RANGE=${1:-"203.0.113.0/24"}
COMMUNITY=${2:-"public"}
OUTPUT_FILE="/tmp/discovered_devices.txt"
CONFIG_FILE="/usr/local/nagios/etc/objects/discovered-devices.cfg"
echo "Starting SNMP device discovery on network: $NETWORK_RANGE"
echo "Using community string: $COMMUNITY"
Clear previous results
> $OUTPUT_FILE
> $CONFIG_FILE
Scan network range for SNMP devices
nmap -sU -p 161 --open $NETWORK_RANGE | grep -E "^Nmap scan report" | awk '{print $5}' > /tmp/potential_devices.txt
while read -r ip; do
# Test SNMP connectivity
sysname=$(snmpget -v2c -c $COMMUNITY -t 2 -r 1 $ip 1.3.6.1.2.1.1.5.0 2>/dev/null | awk -F'STRING: ' '{print $2}' | tr -d '"')
sysdesc=$(snmpget -v2c -c $COMMUNITY -t 2 -r 1 $ip 1.3.6.1.2.1.1.1.0 2>/dev/null | awk -F'STRING: ' '{print $2}' | tr -d '"')
if [ ! -z "$sysname" ]; then
echo "$ip|$sysname|$sysdesc" >> $OUTPUT_FILE
echo "Found device: $ip - $sysname"
# Generate basic Nagios configuration
hostname=$(echo $sysname | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
echo "# Auto-discovered device: $sysname" >> $CONFIG_FILE
echo "define host{" >> $CONFIG_FILE
echo " use generic-network-device" >> $CONFIG_FILE
echo " host_name $hostname" >> $CONFIG_FILE
echo " alias $sysname" >> $CONFIG_FILE
echo " address $ip" >> $CONFIG_FILE
echo " hostgroups discovered-devices" >> $CONFIG_FILE
echo "}" >> $CONFIG_FILE
echo "" >> $CONFIG_FILE
# Add basic SNMP service
echo "define service{" >> $CONFIG_FILE
echo " use generic-snmp-service" >> $CONFIG_FILE
echo " host_name $hostname" >> $CONFIG_FILE
echo " service_description System Uptime" >> $CONFIG_FILE
echo " check_command check_snmp_system!$COMMUNITY!100000!50000" >> $CONFIG_FILE
echo "}" >> $CONFIG_FILE
echo "" >> $CONFIG_FILE
fi
done < /tmp/potential_devices.txt
echo "Discovery complete. Found $(wc -l < $OUTPUT_FILE) SNMP devices."
echo "Configuration written to: $CONFIG_FILE"
echo "Please review and restart Nagios to apply changes."
Make discovery script executable and create hostgroup
Set proper permissions for the discovery script and create a hostgroup for discovered devices.
sudo chmod 755 /usr/local/nagios/libexec/snmp_discovery.sh
sudo chown nagios:nagios /usr/local/nagios/libexec/snmp_discovery.sh
# Add this to your existing hostgroups configuration
define hostgroup{
hostgroup_name discovered-devices
alias Auto-discovered Network Devices
members
}
Create interface monitoring script
Implement automated interface discovery and monitoring for network devices.
#!/bin/bash
Network Interface Discovery Script
Usage: ./interface_discovery.sh device_ip community_string
DEVICE_IP=$1
COMMUNITY=$2
OUTPUT_FILE="/tmp/interfaces_${DEVICE_IP}.cfg"
if [ -z "$DEVICE_IP" ] || [ -z "$COMMUNITY" ]; then
echo "Usage: $0 "
exit 1
fi
echo "Discovering interfaces on device: $DEVICE_IP"
Clear previous results
> $OUTPUT_FILE
Get interface information
snmpwalk -v2c -c $COMMUNITY $DEVICE_IP 1.3.6.1.2.1.2.2.1.2 2>/dev/null | while read line; do
interface_index=$(echo $line | awk -F'.' '{print $NF}' | awk '{print $1}')
interface_name=$(echo $line | awk -F'STRING: ' '{print $2}' | tr -d '"')
# Skip loopback and null interfaces
if [[ $interface_name == "Loopback" ]] || [[ $interface_name == "Null" ]]; then
continue
fi
# Get interface operational status
oper_status=$(snmpget -v2c -c $COMMUNITY $DEVICE_IP 1.3.6.1.2.1.2.2.1.8.$interface_index 2>/dev/null | awk '{print $NF}')
admin_status=$(snmpget -v2c -c $COMMUNITY $DEVICE_IP 1.3.6.1.2.1.2.2.1.7.$interface_index 2>/dev/null | awk '{print $NF}')
if [ ! -z "$interface_name" ] && [ "$admin_status" == "1" ]; then
service_name=$(echo "Interface $interface_name Status" | sed 's/[^a-zA-Z0-9 ]/_/g')
hostname=$(snmpget -v2c -c $COMMUNITY $DEVICE_IP 1.3.6.1.2.1.1.5.0 2>/dev/null | awk -F'STRING: ' '{print $2}' | tr -d '"' | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
echo "# Interface: $interface_name (Index: $interface_index)" >> $OUTPUT_FILE
echo "define service{" >> $OUTPUT_FILE
echo " use network-interface-service" >> $OUTPUT_FILE
echo " host_name $hostname" >> $OUTPUT_FILE
echo " service_description $service_name" >> $OUTPUT_FILE
echo " check_command check_snmp_interface!$COMMUNITY!$interface_index" >> $OUTPUT_FILE
echo "}" >> $OUTPUT_FILE
echo "" >> $OUTPUT_FILE
echo "Found interface: $interface_name (Index: $interface_index)"
fi
done
echo "Interface discovery complete for $DEVICE_IP"
echo "Configuration written to: $OUTPUT_FILE"
Make interface discovery script executable
Set proper permissions for the interface discovery script.
sudo chmod 755 /usr/local/nagios/libexec/interface_discovery.sh
sudo chown nagios:nagios /usr/local/nagios/libexec/interface_discovery.sh
Update main Nagios configuration
Include the new configuration files in the main Nagios configuration.
# Add these lines to include SNMP monitoring configurations
cfg_file=/usr/local/nagios/etc/objects/network-devices.cfg
cfg_file=/usr/local/nagios/etc/objects/network-services.cfg
cfg_file=/usr/local/nagios/etc/objects/discovered-devices.cfg
cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg
Validate configuration and restart Nagios
Check the Nagios configuration for syntax errors and restart the service.
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
sudo systemctl restart nagios
sudo systemctl status nagios
Run automated discovery
Execute the discovery scripts to automatically find and configure network devices for monitoring.
# Discover SNMP devices on your network
sudo /usr/local/nagios/libexec/snmp_discovery.sh 203.0.113.0/24 public
Discover interfaces on a specific device
sudo /usr/local/nagios/libexec/interface_discovery.sh 203.0.113.10 public
Validate and reload configuration
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
sudo systemctl reload nagios
Configure custom monitoring templates
Create specialized monitoring templates for different types of network equipment with vendor-specific OIDs and thresholds.
# Cisco Switch Template
define host{
name cisco-switch-template
use switch-template
hostgroups cisco-switches
register 0
}
Cisco Router Template
define host{
name cisco-router-template
use router-template
hostgroups cisco-routers
register 0
}
HP/Aruba Switch Template
define host{
name hp-switch-template
use switch-template
hostgroups hp-switches
register 0
}
Juniper Router Template
define host{
name juniper-router-template
use router-template
hostgroups juniper-routers
register 0
}
Verify your setup
Test SNMP connectivity and verify that Nagios is properly monitoring your network devices.
# Test SNMP connectivity
snmpwalk -v2c -c public 203.0.113.10 1.3.6.1.2.1.1
Check Nagios service status
sudo systemctl status nagios
Verify configuration syntax
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Check active services in Nagios log
sudo tail -f /usr/local/nagios/var/nagios.log
View discovered devices
cat /tmp/discovered_devices.txt
Access the Nagios web interface at http://your-server-ip/nagios to view the network device monitoring status and configure additional alerting as needed. For enhanced visualization, consider integrating with Grafana dashboards.
Common issues
| Symptom | Cause | Fix |
|---|---|---|
| SNMP timeout errors | Incorrect community string or device IP | Verify community string and test with snmpget |
| No data returned from SNMP queries | SNMP service disabled on device | Enable SNMP on network device with proper community |
| Discovery script finds no devices | Network range incorrect or SNMP blocked | Check network range and firewall rules for UDP port 161 |
| Interface monitoring shows incorrect status | Wrong interface index or OID | Use snmpwalk to verify interface indices and OIDs |
| Nagios configuration validation fails | Syntax errors in configuration files | Check file syntax and ensure proper template inheritance |
| Services show "UNKNOWN" status | Check command not found or permissions | Verify check_snmp plugin exists and is executable |
Next steps
- Configure network monitoring with SNMP and Grafana dashboards for enhanced visualization
- Integrate SNMP monitoring with InfluxDB and Telegraf for long-term data storage
- Implement advanced SNMP device auto-discovery with network scanning capabilities
- Configure SNMP traps and passive monitoring for real-time event handling
- Set up distributed SNMP monitoring across multiple network segments
Automated install script
Run this to automate the entire setup
#!/usr/bin/env bash
set -euo pipefail
# Nagios SNMP Network Device Monitoring Setup Script
# Configures SNMP monitoring with automated discovery and templates
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Global variables
NAGIOS_DIR="/usr/local/nagios"
NAGIOS_CFG_DIR="${NAGIOS_DIR}/etc"
NAGIOS_USER="nagios"
NAGIOS_GROUP="nagios"
COMMUNITY_STRING="public"
usage() {
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -c, --community STRING SNMP community string (default: public)"
echo " -h, --help Show this help message"
exit 1
}
log() {
echo -e "${GREEN}[INFO]${NC} $1"
}
warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
error() {
echo -e "${RED}[ERROR]${NC} $1"
}
cleanup() {
if [ $? -ne 0 ]; then
error "Installation failed. Check the logs above for details."
fi
}
trap cleanup ERR
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-c|--community)
COMMUNITY_STRING="$2"
shift 2
;;
-h|--help)
usage
;;
*)
error "Unknown option: $1"
usage
;;
esac
done
# Check if running as root
if [[ $EUID -ne 0 ]]; then
error "This script must be run as root or with sudo"
exit 1
fi
# Auto-detect distribution
if [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
ubuntu|debian)
PKG_MGR="apt"
PKG_INSTALL="apt install -y"
PKG_UPDATE="apt update"
SNMP_MIBS_PKG="snmp-mibs-downloader"
SNMP_CONF="/etc/snmp/snmp.conf"
;;
almalinux|rocky|centos|rhel|ol|fedora)
PKG_MGR="dnf"
PKG_INSTALL="dnf install -y"
PKG_UPDATE="dnf update -y"
SNMP_MIBS_PKG=""
SNMP_CONF="/etc/snmp/snmp.conf"
;;
amzn)
PKG_MGR="yum"
PKG_INSTALL="yum install -y"
PKG_UPDATE="yum update -y"
SNMP_MIBS_PKG=""
SNMP_CONF="/etc/snmp/snmp.conf"
;;
*)
error "Unsupported distribution: $ID"
exit 1
;;
esac
else
error "Cannot detect distribution. /etc/os-release not found."
exit 1
fi
# Check if Nagios is installed
if [ ! -d "$NAGIOS_DIR" ] || [ ! -f "${NAGIOS_CFG_DIR}/nagios.cfg" ]; then
error "Nagios Core installation not found in $NAGIOS_DIR"
error "Please install Nagios Core before running this script"
exit 1
fi
echo "[1/8] Installing SNMP utilities and libraries..."
$PKG_UPDATE
if [ "$PKG_MGR" = "apt" ]; then
$PKG_INSTALL snmp $SNMP_MIBS_PKG libsnmp-perl
else
$PKG_INSTALL net-snmp net-snmp-utils net-snmp-perl
fi
echo "[2/8] Configuring MIB files..."
mkdir -p /usr/share/snmp/mibs
if [ "$PKG_MGR" = "apt" ] && [ -n "$SNMP_MIBS_PKG" ]; then
download-mibs
if [ -f "$SNMP_CONF" ]; then
sed -i 's/^mibs :/# mibs :/' "$SNMP_CONF"
fi
else
# Download essential MIBs for RHEL-based systems
wget -q -O /usr/share/snmp/mibs/RFC1213-MIB "http://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib" || warn "Could not download RFC1213-MIB"
fi
echo "[3/8] Creating SNMP command definitions..."
cat > "${NAGIOS_CFG_DIR}/objects/snmp-commands.cfg" << 'EOF'
# SNMP Commands for Network Device Monitoring
# SNMP System Information
define command{
command_name check_snmp_system
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.1.3.0 -w $ARG2$ -c $ARG3$
}
# SNMP Interface Status
define command{
command_name check_snmp_interface
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.2.2.1.8.$ARG2$ -r 1 -w 1 -c 1
}
# SNMP Interface Utilization
define command{
command_name check_snmp_interface_util
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.2.1.2.2.1.10.$ARG2$,1.3.6.1.2.1.2.2.1.16.$ARG2$ -w $ARG3$ -c $ARG4$
}
# SNMP CPU Utilization
define command{
command_name check_snmp_cpu
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.9.9.109.1.1.1.1.7.1 -w $ARG2$ -c $ARG3$
}
# SNMP Memory Utilization
define command{
command_name check_snmp_memory
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.9.9.48.1.1.1.5.1,1.3.6.1.4.1.9.9.48.1.1.1.6.1 -w $ARG2$ -c $ARG3$
}
EOF
echo "[4/8] Creating network device host templates..."
cat > "${NAGIOS_CFG_DIR}/objects/network-templates.cfg" << 'EOF'
# Network Device Templates
# Generic Network Device Template
define host{
name generic-network-device
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,u,r
contact_groups admins
register 0
}
# Switch Template
define host{
name switch-template
use generic-network-device
hostgroups switches
register 0
}
# Router Template
define host{
name router-template
use generic-network-device
hostgroups routers
register 0
}
EOF
echo "[5/8] Creating service templates..."
cat > "${NAGIOS_CFG_DIR}/objects/network-services.cfg" << EOF
# Network Device Services
# SNMP System Uptime
define service{
name snmp-system-uptime
service_description System Uptime
check_command check_snmp_system!${COMMUNITY_STRING}!10000!5000
use generic-service
register 0
}
# Interface Status Service
define service{
name snmp-interface-status
service_description Interface Status
check_command check_snmp_interface!${COMMUNITY_STRING}!1
use generic-service
register 0
}
EOF
echo "[6/8] Creating host groups..."
cat > "${NAGIOS_CFG_DIR}/objects/network-hostgroups.cfg" << 'EOF'
# Network Device Host Groups
define hostgroup{
hostgroup_name switches
alias Network Switches
}
define hostgroup{
hostgroup_name routers
alias Network Routers
}
define hostgroup{
hostgroup_name network-devices
alias All Network Devices
}
EOF
echo "[7/8] Creating example device configuration..."
cat > "${NAGIOS_CFG_DIR}/objects/network-devices.cfg" << EOF
# Example Network Device Configurations
# Uncomment and modify these examples for your devices
# define host{
# use switch-template
# host_name switch-01
# alias Core Switch 01
# address 192.168.1.10
# hostgroups switches,network-devices
# }
# define service{
# use snmp-system-uptime
# host_name switch-01
# }
# define service{
# use snmp-interface-status
# host_name switch-01
# service_description Port 1 Status
# check_command check_snmp_interface!${COMMUNITY_STRING}!1
# }
EOF
# Update main nagios.cfg to include new configuration files
echo "[8/8] Updating Nagios configuration..."
for cfg_file in snmp-commands.cfg network-templates.cfg network-services.cfg network-hostgroups.cfg network-devices.cfg; do
if ! grep -q "objects/${cfg_file}" "${NAGIOS_CFG_DIR}/nagios.cfg"; then
echo "cfg_file=${NAGIOS_CFG_DIR}/objects/${cfg_file}" >> "${NAGIOS_CFG_DIR}/nagios.cfg"
fi
done
# Set proper ownership and permissions
chown -R $NAGIOS_USER:$NAGIOS_GROUP "${NAGIOS_CFG_DIR}/objects/"
chmod 644 "${NAGIOS_CFG_DIR}/objects/"*.cfg
# Verify Nagios configuration
log "Verifying Nagios configuration..."
if $NAGIOS_DIR/bin/nagios -v $NAGIOS_CFG_DIR/nagios.cfg; then
log "Configuration verification successful"
else
error "Configuration verification failed"
exit 1
fi
# Restart Nagios service
if systemctl is-active --quiet nagios; then
log "Restarting Nagios service..."
systemctl restart nagios
elif systemctl is-active --quiet nagios3; then
log "Restarting Nagios service..."
systemctl restart nagios3
else
warn "Could not detect Nagios service. Please restart manually."
fi
log "SNMP monitoring setup completed successfully!"
echo
echo "Next steps:"
echo "1. Edit ${NAGIOS_CFG_DIR}/objects/network-devices.cfg to add your devices"
echo "2. Test SNMP connectivity: snmpwalk -v2c -c ${COMMUNITY_STRING} <device-ip> 1.3.6.1.2.1.1.1.0"
echo "3. Reload Nagios configuration after adding devices"
Review the script before running. Execute with: bash install.sh