Compare commits

...

2 Commits

Author SHA1 Message Date
Kameron Kenny ad2f04e6a0 web hosts 2024-12-30 11:00:56 -05:00
Kameron Kenny 370e4ce9be organize 2024-12-30 10:43:14 -05:00
9 changed files with 152 additions and 158 deletions

View File

@ -12,7 +12,7 @@ services:
build: build:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: nagios container_name: nagios
image: docker-registry1.in.thelinuxpro.net:5000/tlp/nagios:241228.0.3 image: docker-registry1.in.thelinuxpro.net:5000/tlp/nagios:241230.0.1
networks: networks:
infra_dev_net: infra_dev_net:
ipv4_address: 10.99.23.36 ipv4_address: 10.99.23.36

View File

@ -143,9 +143,14 @@ define command{
# 'check_http' command definition # 'check_http' command definition
define command{ define command{
command_name check_http command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ command_line $USER1$/check_http -I $HOSTADDRESS$ -H $HOSTNAME$
} }
# 'check_https' command definition
define command{
command_name check_https
command_line $USER1$/check_http -S -I $HOSTADDRESS$ -H $HOSTNAME$
}
# 'check_ssh' command definition # 'check_ssh' command definition
define command{ define command{

View File

@ -67,7 +67,7 @@ define host{
name linux-server ; The name of this host template name linux-server ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock check_period 24x7 ; By default, Linux hosts are checked round the clock
check_interval 5 ; Actively check the host every 5 minutes check_interval 2 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each Linux host 10 times (max) max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts check_command check-host-alive ; Default command to check Linux hosts
@ -80,44 +80,38 @@ define host{
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
} }
### Host Template
define host{
# Windows host definition template - This is NOT a real host, just a template! name docker-host
use generic-host
hostgroups docker-hosts
check_period 24x7
check_interval 3
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 host{ define host{
name windows-server ; The name of this host template name web-host
use generic-host ; Inherit default values from the generic-host template use generic-host
check_period 24x7 ; By default, Windows servers are monitored round the clock hostgroups web-hosts
check_interval 5 ; Actively check the server every 5 minutes check_period 24x7
retry_interval 1 ; Schedule host check retries at 1 minute intervals check_interval 2
max_check_attempts 10 ; Check each server 10 times (max) retry_interval 1
check_command check-host-alive ; Default command to check if servers are "alive" max_check_attempts 3
notification_period 24x7 ; Send notification out at any time - day or night check_command check-host-alive
notification_interval 30 ; Resend notifications every 30 minutes notification_period 24x7
notification_options d,r ; Only send notifications for specific host states notification_interval 120
contact_groups admins ; Notifications get sent to the admins by default notification_options d,u,r
hostgroups windows-servers ; Host groups that Windows servers should be a member of contact_groups admins
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE register 0
} }
# We define a generic printer template that can be used for most printers we monitor
define host{
name generic-printer ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, printers are monitored round the clock
check_interval 5 ; Actively check the printer every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each printer 10 times (max)
check_command check-host-alive ; Default command to check if printers are "alive"
notification_period workhours ; Printers are only used during the workday
notification_interval 30 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}
# Define a template for switches that we can reuse # Define a template for switches that we can reuse
define host{ define host{
@ -164,8 +158,8 @@ define service{
is_volatile 0 ; The service is not volatile is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
check_interval 10 ; Check the service every 10 minutes under normal conditions check_interval 2 ; Check the service every 10 minutes under normal conditions
retry_interval 2 ; Re-check the service every two minutes until a hard state can be determined retry_interval 1 ; Re-check the service every two minutes until a hard state can be determined
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 60 ; Re-notify about service problems every hour notification_interval 60 ; Re-notify about service problems every hour

View File

@ -0,0 +1,28 @@
### Hosts
define host{
use docker-host
host_name pi501.in.thelinuxpro.net
alias pi501
address 10.99.22.51
}
define host{
use docker-host
host_name pi502.in.thelinuxpro.net
alias pi502
address 10.99.22.52
}
define host{
use docker-host
host_name pi503.in.thelinuxpro.net
alias pi503
address 10.99.22.53
}
define host{
use docker-host
host_name pi504.in.thelinuxpro.net
alias pi504
address 10.99.22.54
}

View File

@ -0,0 +1,14 @@
### Hosts
define host{
use web-host
host_name kameronkenny.com
alias kameronkenny.com
address 204.8.15.81
}
define host{
use web-host
host_name thelinux.pro
alias thelinux.pro
address 204.8.15.81
}

View File

@ -4,3 +4,10 @@ define hostgroup{
alias Docker Hosts alias Docker Hosts
members pi501.in.thelinuxpro.net,pi502.in.thelinuxpro.net,pi503.in.thelinuxpro.net,pi504.in.thelinuxpro.net members pi501.in.thelinuxpro.net,pi502.in.thelinuxpro.net,pi503.in.thelinuxpro.net,pi504.in.thelinuxpro.net
} }
### Hostgroup
define hostgroup{
hostgroup_name web-hosts
alias web Hosts
members kameronkenny.com,thelinux.pro
}

View File

@ -0,0 +1,43 @@
### Service definitions for all docker hosts
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description Docker Daemon
check_command check_nrpe!check_proc_docker
}
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description Disk: /
check_command check_nrpe!check_disk
}
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description Disk: /var/lib/docker/volumes
check_command check_nrpe!check_disk_docker
}
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description System: Load
check_command check_nrpe!check_load
}
define service{
use generic-service,graphed-service
hostgroup_name docker-hosts
service_description System: Total Processes
check_command check_nrpe!check_procs
}

View File

@ -0,0 +1,14 @@
### Service definitions for all web hosts
define service{
use generic-service,graphed-service
hostgroup_name web-hosts
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use generic-service,graphed-service
hostgroup_name web-hosts
service_description HTTPS
check_command check_https
}

View File

@ -1,114 +1,3 @@
### Host Template
define host{
name docker-host
use generic-host
hostgroups docker-hosts
check_period 24x7
check_interval 5
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
}
### Hosts
define host{
use docker-host
host_name pi501.in.thelinuxpro.net
alias pi501
address 10.99.22.51
}
define host{
use docker-host
host_name pi502.in.thelinuxpro.net
alias pi502
address 10.99.22.52
}
define host{
use docker-host
host_name pi503.in.thelinuxpro.net
alias pi503
address 10.99.22.53
}
define host{
use docker-host
host_name pi504.in.thelinuxpro.net
alias pi504
address 10.99.22.54
}
### Service definitions for all docker hosts
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description Docker Daemon
check_command check_nrpe!check_proc_docker
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description Disk: /
check_command check_nrpe!check_disk
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description Disk: /var/lib/docker/volumes
check_command check_nrpe!check_disk_docker
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description System: Load
check_command check_nrpe!check_load
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description System: Total Processes
check_command check_nrpe!check_procs
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description System: Zombie Processes
check_command check_nrpe!check_procs
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description System: Logged In users
check_command check_nrpe!check_users
}
define service{
use local-service,graphed-service
hostgroup_name docker-hosts
service_description DNS Query: A Record
check_command check_dns_a
}
### Service Definitions per docker host ### Service Definitions per docker host
define service{ define service{
use local-service,graphed-service use local-service,graphed-service