diff --git a/overlay/opt/nagios/etc/objects/000-commands.cfg b/overlay/opt/nagios/etc/objects/000-commands.cfg index 5efa83a..9a059bf 100644 --- a/overlay/opt/nagios/etc/objects/000-commands.cfg +++ b/overlay/opt/nagios/etc/objects/000-commands.cfg @@ -235,6 +235,11 @@ define command { command_line $USER1$/check_nrpe -2 -H $HOSTADDRESS$ -c $ARG1$ } +define command{ + command_name check_dns_port_udp + command_line $USER1$/check_udp -H $HOSTADDRESS$ -p 53 +} + ################################################################################ # # SAMPLE PERFORMANCE DATA COMMANDS diff --git a/overlay/opt/nagios/etc/objects/001-templates.cfg b/overlay/opt/nagios/etc/objects/001-templates.cfg index ffe96d3..b8d831b 100644 --- a/overlay/opt/nagios/etc/objects/001-templates.cfg +++ b/overlay/opt/nagios/etc/objects/001-templates.cfg @@ -113,6 +113,22 @@ define host{ register 0 } +define host{ + name network-device + use generic-host + hostgroups network-devices + check_period 24x7 + check_interval 2 + retry_interval 1 + max_check_attempts 3 + check_command check-host-alive + notification_period 24x7 + notification_interval 120 + notification_options d,u,r + contact_groups admins + register 0 +} + # Define a template for switches that we can reuse define host{ name generic-switch ; The name of this host template diff --git a/overlay/opt/nagios/etc/objects/103-network-devices.cfg b/overlay/opt/nagios/etc/objects/103-network-devices.cfg new file mode 100644 index 0000000..abd878c --- /dev/null +++ b/overlay/opt/nagios/etc/objects/103-network-devices.cfg @@ -0,0 +1,73 @@ +### Hosts +define host{ + use network-device + host_name unifi.in.thelinuxpro.net + alias unifi + address 10.200.254.254 +} + +#switches +define host{ + use network-device + host_name sw-0-1-basement-24.in.thelinuxpro.net + alias sw-0-1-basement-24 + address 10.200.254.225 +} + +define host{ + use network-device + host_name sw-0-2-basement-8p.in.thelinuxpro.net + alias sw-0-2-basement-8p + address 10.200.254.226 +} + +define host{ + use network-device + host_name sw-1-1-garage-8p.in.thelinuxpro.net + alias sw-1-1-garage-8p + address 10.200.254.227 +} + +define host{ + use network-device + host_name sw-2-1-office-8p.in.thelinuxpro.net + alias sw-2-1-office-8p + address 10.200.254.228 +} + +#Access Points +define host{ + use network-device + host_name ap-1-1-garage.in.thelinuxpro.net + alias ap-1-1-garage + address 10.200.254.231 +} + +define host{ + use network-device + host_name ap-1-2-office.in.thelinuxpro.net + alias ap-1-2-office + address 10.200.254.232 +} + +define host{ + use network-device + host_name ap-2-1-office.in.thelinuxpro.net + alias ap-2-1-office + address 10.200.254.233 +} + +define host{ + use network-device + host_name ap-2-1-mbr.in.thelinuxpro.net + alias ap-2-1-mbr + address 10.200.254.234 +} + +define host{ + use network-device + host_name ap-2-1-kbr.in.thelinuxpro.net + alias ap-2-1-kbr + address 10.200.254.235 +} + diff --git a/overlay/opt/nagios/etc/objects/200-hostgroups.cfg b/overlay/opt/nagios/etc/objects/200-hostgroups.cfg index 148cd5e..4360651 100644 --- a/overlay/opt/nagios/etc/objects/200-hostgroups.cfg +++ b/overlay/opt/nagios/etc/objects/200-hostgroups.cfg @@ -11,3 +11,24 @@ define hostgroup{ alias web Hosts members kameronkenny.com,thelinux.pro } + +### Hostgroup +define hostgroup{ + hostgroup_name network-devices + alias Network Devices + members unifi.in.thelinuxpro.net,sw-0-1-basement-24.in.thelinuxpro.net,sw-0-2-basement-8p.in.thelinuxpro.net,sw-1-1-garage-8p.in.thelinuxpro.net,sw-2-1-office-8p.in.thelinuxpro.net,ap-1-1-garage.in.thelinuxpro.net,ap-1-2-office.in.thelinuxpro.net,ap-2-1-office.in.thelinuxpro.net,ap-2-2-mbr.in.thelinuxpro.net,ap-2-3-kbr.in.thelinuxpro.net +} + +### Hostgroup - switches +define hostgroup{ + hostgroup_name network-devices-switches + alias Network Devices - Switches + members sw-0-1-basement-24.in.thelinuxpro.net,sw-0-2-basement-8p.in.thelinuxpro.net,sw-1-1-garage-8p.in.thelinuxpro.net,sw-2-1-office-8p.in.thelinuxpro.net +} + +### Hostgroup - access points +define hostgroup{ + hostgroup_name network-devices-aps + alias Network Devices - Access Points + members ap-1-1-garage.in.thelinuxpro.net,ap-1-2-office.in.thelinuxpro.net,ap-2-1-office.in.thelinuxpro.net,ap-2-2-mbr.in.thelinuxpro.net,ap-2-3-kbr.in.thelinuxpro.net +} diff --git a/overlay/opt/nagios/etc/objects/303-network-devices-services-hostgroup.cfg b/overlay/opt/nagios/etc/objects/303-network-devices-services-hostgroup.cfg new file mode 100644 index 0000000..b9b8714 --- /dev/null +++ b/overlay/opt/nagios/etc/objects/303-network-devices-services-hostgroup.cfg @@ -0,0 +1,7 @@ +### Service definitions for all web hosts +define service{ + use generic-service,graphed-service + hostgroup_name network-devices + service_description PING + check_command check_ping!100.0,20%!500.0,60% +} diff --git a/overlay/opt/nagios/etc/objects/403-network-device-services.cfg b/overlay/opt/nagios/etc/objects/403-network-device-services.cfg new file mode 100644 index 0000000..f0b9a05 --- /dev/null +++ b/overlay/opt/nagios/etc/objects/403-network-device-services.cfg @@ -0,0 +1,23 @@ +### Service Definitions per docker host + +## unifi.in.thelinuxpro.net +define service{ + use local-service,graphed-service + host_name unifi.in.thelinuxpro.net + service_description HTTPS + check_command check_https +} + +define service{ + use local-service,graphed-service + host_name unifi.in.thelinuxpro.net + service_description SSH + check_command check_ssh +} + +define service{ + use local-service,graphed-service + host_name unifi.in.thelinuxpro.net + service_description DNS Port - UDP + check_command check_dns_port_udp +}