web stuff

This commit is contained in:
Kameron Kenny 2024-12-30 11:31:48 -05:00
parent 98e47f2436
commit 6ab6efa27d
7 changed files with 155 additions and 47 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:241230.0.1 image: docker-registry1.in.thelinuxpro.net:5000/tlp/nagios:241230.0.2
networks: networks:
infra_dev_net: infra_dev_net:
ipv4_address: 10.99.23.36 ipv4_address: 10.99.23.36

View File

@ -1,24 +1,39 @@
command[check_docker_container_status_ns1]=/usr/lib/nagios/plugins/check_docker --status running --containers ns1 command[check_docker_container_status_ns1]=/usr/lib/nagios/plugins/check_docker --status running --containers ns1
command[check_docker_container_cpu_ns1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers ns1 command[check_docker_container_cpu_ns1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers ns1
command[check_docker_container_memory_ns1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers ns1 command[check_docker_container_memory_ns1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers ns1
command[check_docker_container_status_gitea]=/usr/lib/nagios/plugins/check_docker --status running --containers gitea command[check_docker_container_status_gitea]=/usr/lib/nagios/plugins/check_docker --status running --containers gitea
command[check_docker_container_cpu_gitea]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers gitea command[check_docker_container_cpu_gitea]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers gitea
command[check_docker_container_memory_gitea]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers gitea command[check_docker_container_memory_gitea]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers gitea
command[check_docker_container_status_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --status running --containers gitea-db-1 command[check_docker_container_status_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --status running --containers gitea-db-1
command[check_docker_container_cpu_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers gitea-db-1 command[check_docker_container_cpu_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers gitea-db-1
command[check_docker_container_memory_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers gitea-db-1 command[check_docker_container_memory_gitea-db-1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers gitea-db-1
command[check_docker_container_status_docker-registry1]=/usr/lib/nagios/plugins/check_docker --status running --containers docker-registry1 command[check_docker_container_status_docker-registry1]=/usr/lib/nagios/plugins/check_docker --status running --containers docker-registry1
command[check_docker_container_cpu_docker-registry1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers docker-registry1 command[check_docker_container_cpu_docker-registry1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers docker-registry1
command[check_docker_container_memory_docker-registry1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers docker-registry1 command[check_docker_container_memory_docker-registry1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers docker-registry1
command[check_docker_container_status_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --status running --containers thelinux_pro command[check_docker_container_status_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --status running --containers thelinux_pro
command[check_docker_container_cpu_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers thelinux_pro command[check_docker_container_cpu_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers thelinux_pro
command[check_docker_container_memory_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers thelinux_pro command[check_docker_container_memory_thelinux_pro]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers thelinux_pro
command[check_docker_container_status_nginx-certbot-nginx-1]=/usr/lib/nagios/plugins/check_docker --status running --containers nginx-certbot-nginx-1
command[check_docker_container_cpu_nginx-certbot-nginx-1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers nginx-certbot-nginx-1
command[check_docker_container_memory_nginx-certbot-nginx-1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers nginx-certbot-nginx-1
command[check_docker_container_status_nginx-certbot-certbot-1]=/usr/lib/nagios/plugins/check_docker --status running --containers nginx-certbot-certbot-1
command[check_docker_container_cpu_nginx-certbot-certbot-1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers nginx-certbot-certbot-1
command[check_docker_container_memory_nginx-certbot-certbot-1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers nginx-certbot-certbot-1
command[check_docker_container_status_pihole1]=/usr/lib/nagios/plugins/check_docker --status running --containers pihole1 command[check_docker_container_status_pihole1]=/usr/lib/nagios/plugins/check_docker --status running --containers pihole1
command[check_docker_container_cpu_pihole1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers pihole1 command[check_docker_container_cpu_pihole1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers pihole1
command[check_docker_container_memory_pihole1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers pihole1 command[check_docker_container_memory_pihole1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers pihole1
command[check_docker_container_status_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --status running --containers kameronkenny.com_web1 command[check_docker_container_status_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --status running --containers kameronkenny.com_web1
command[check_docker_container_cpu_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers kameronkenny.com_web1 command[check_docker_container_cpu_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers kameronkenny.com_web1
command[check_docker_container_memory_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers kameronkenny.com_web1 command[check_docker_container_memory_kameronkenny_com_web1]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers kameronkenny.com_web1
command[check_docker_container_status_jenkins]=/usr/lib/nagios/plugins/check_docker --status running --containers jenkins command[check_docker_container_status_jenkins]=/usr/lib/nagios/plugins/check_docker --status running --containers jenkins
command[check_docker_container_cpu_jenkins]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers jenkins command[check_docker_container_cpu_jenkins]=/usr/lib/nagios/plugins/check_docker --cpu 90:95 --containers jenkins
command[check_docker_container_memory_jenkins]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers jenkins command[check_docker_container_memory_jenkins]=/usr/lib/nagios/plugins/check_docker --memory 90:95:% --containers jenkins

View File

@ -26,14 +26,14 @@ log_file=/opt/nagios/var/nagios.log
# if you wish (as shown below), or keep them all in a single config file. # if you wish (as shown below), or keep them all in a single config file.
# You can specify individual object config files as shown below: # You can specify individual object config files as shown below:
cfg_file=/opt/nagios/etc/objects/commands.cfg #cfg_file=/opt/nagios/etc/objects/000-commands.cfg
cfg_file=/opt/nagios/etc/objects/contacts.cfg #cfg_file=/opt/nagios/etc/objects/contacts.cfg
cfg_file=/opt/nagios/etc/objects/timeperiods.cfg #cfg_file=/opt/nagios/etc/objects/timeperiods.cfg
cfg_file=/opt/nagios/etc/objects/templates.cfg #cfg_file=/opt/nagios/etc/objects/001-templates.cfg
# Definitions for monitoring the local (Linux) host # Definitions for monitoring the local (Linux) host
cfg_file=/opt/nagios/etc/objects/localhost.cfg #cfg_file=/opt/nagios/etc/objects/localhost.cfg
cfg_file=/opt/nagios/etc/objects/docker-hosts.cfg #cfg_file=/opt/nagios/etc/objects/101-docker-hosts.cfg
# Definitions for monitoring a Windows machine # Definitions for monitoring a Windows machine
#cfg_file=/opt/nagios/etc/objects/windows.cfg #cfg_file=/opt/nagios/etc/objects/windows.cfg
@ -49,7 +49,7 @@ cfg_file=/opt/nagios/etc/objects/docker-hosts.cfg
# extension) in a particular directory by using the cfg_dir # extension) in a particular directory by using the cfg_dir
# directive as shown below: # directive as shown below:
#cfg_dir=/opt/nagios/etc/objects cfg_dir=/opt/nagios/etc/objects
#cfg_dir=/opt/nagios/etc/servers #cfg_dir=/opt/nagios/etc/servers
#cfg_dir=/opt/nagios/etc/printers #cfg_dir=/opt/nagios/etc/printers

View File

@ -152,6 +152,11 @@ define command{
command_line $USER1$/check_http -S -I $HOSTADDRESS$ -H $HOSTNAME$ command_line $USER1$/check_http -S -I $HOSTADDRESS$ -H $HOSTNAME$
} }
define command{
command_name check_ssl_cert
command_line $USER1$/check_ssl_certificate -a "-servername $HOSTNAME$" -H $HOSTADDRESS$ -w 21 -c 7
}
# 'check_ssh' command definition # 'check_ssh' command definition
define command{ define command{
command_name check_ssh command_name check_ssh

View File

@ -12,3 +12,10 @@ define service{
service_description HTTPS service_description HTTPS
check_command check_https check_command check_https
} }
define service{
use generic-service,graphed-service
hostgroup_name web-hosts
service_description SSL Certificate
check_command check_ssl_cert
}

View File

@ -1,4 +1,6 @@
### Service Definitions per docker host ### Service Definitions per docker host
## PI501
define service{ define service{
use local-service,graphed-service use local-service,graphed-service
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
@ -42,6 +44,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: ns1 service_description Container Memory: ns1
check_command check_nrpe!check_docker_container_memory_ns1 check_command check_nrpe!check_docker_container_memory_ns1
register 0
} }
define service{ define service{
@ -63,6 +66,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: gitea service_description Container Memory: gitea
check_command check_nrpe!check_docker_container_memory_gitea check_command check_nrpe!check_docker_container_memory_gitea
register 0
} }
define service{ define service{
@ -84,6 +88,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: gitea-db-1 service_description Container Memory: gitea-db-1
check_command check_nrpe!check_docker_container_memory_gitea-db-1 check_command check_nrpe!check_docker_container_memory_gitea-db-1
register 0
} }
define service{ define service{
@ -105,6 +110,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: docker-registry1 service_description Container Memory: docker-registry1
check_command check_nrpe!check_docker_container_memory_docker-registry1 check_command check_nrpe!check_docker_container_memory_docker-registry1
register 0
} }
define service{ define service{
@ -126,6 +132,51 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: thelinux_pro service_description Container Memory: thelinux_pro
check_command check_nrpe!check_docker_container_memory_thelinux_pro check_command check_nrpe!check_docker_container_memory_thelinux_pro
register 0
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container Status: nginx-certbot-nginx-1
check_command check_nrpe!check_docker_container_status_nginx-certbot-nginx-1
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container CPU: nginx-certbot-nginx-1
check_command check_nrpe!check_docker_container_cpu_nginx-certbot-nginx-1
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container Memory: nginx-certbot-nginx-1
check_command check_nrpe!check_docker_container_memory_nginx-certbot-nginx-1
register 0
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container Status: nginx-certbot-certbot-1
check_command check_nrpe!check_docker_container_status_nginx-certbot-certbot-1
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container CPU: nginx-certbot-certbot-1
check_command check_nrpe!check_docker_container_cpu_nginx-certbot-certbot-1
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container Memory: nginx-certbot-certbot-1
check_command check_nrpe!check_docker_container_memory_nginx-certbot-certbot-1
register 0
} }
define service{ define service{
@ -147,6 +198,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: pihole1 service_description Container Memory: pihole1
check_command check_nrpe!check_docker_container_memory_pihole1 check_command check_nrpe!check_docker_container_memory_pihole1
register 0
} }
define service{ define service{
@ -168,6 +220,7 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: kameronkenny_com_web1 service_description Container Memory: kameronkenny_com_web1
check_command check_nrpe!check_docker_container_memory_kameronkenny_com_web1 check_command check_nrpe!check_docker_container_memory_kameronkenny_com_web1
register 0
} }
define service{ define service{
@ -189,8 +242,24 @@ define service{
host_name pi501.in.thelinuxpro.net host_name pi501.in.thelinuxpro.net
service_description Container Memory: jenkins service_description Container Memory: jenkins
check_command check_nrpe!check_docker_container_memory_jenkins check_command check_nrpe!check_docker_container_memory_jenkins
register 0
} }
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container Status: kameronkenny.com_web1
check_command check_nrpe!check_docker_container_status_kameronkenny.com_web1
}
define service{
use local-service,graphed-service
host_name pi501.in.thelinuxpro.net
service_description Container CPU: kameronkenny.com_web1
check_command check_nrpe!check_docker_container_cpu_kameronkenny.com_web1
}
## PI502
define service{ define service{
use local-service,graphed-service use local-service,graphed-service
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
@ -210,6 +279,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: ns2 service_description Container Memory: ns2
check_command check_nrpe!check_docker_container_memory_ns2 check_command check_nrpe!check_docker_container_memory_ns2
register 0
} }
define service{ define service{
@ -231,6 +301,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: blackbox-exporter service_description Container Memory: blackbox-exporter
check_command check_nrpe!check_docker_container_memory_blackbox-exporter check_command check_nrpe!check_docker_container_memory_blackbox-exporter
register 0
} }
define service{ define service{
@ -252,6 +323,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: grafana service_description Container Memory: grafana
check_command check_nrpe!check_docker_container_memory_grafana check_command check_nrpe!check_docker_container_memory_grafana
register 0
} }
define service{ define service{
@ -273,6 +345,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: pihole-exporter service_description Container Memory: pihole-exporter
check_command check_nrpe!check_docker_container_memory_pihole-exporter check_command check_nrpe!check_docker_container_memory_pihole-exporter
register 0
} }
define service{ define service{
@ -294,6 +367,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: unpoller service_description Container Memory: unpoller
check_command check_nrpe!check_docker_container_memory_unpoller check_command check_nrpe!check_docker_container_memory_unpoller
register 0
} }
define service{ define service{
@ -315,6 +389,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: pihole2 service_description Container Memory: pihole2
check_command check_nrpe!check_docker_container_memory_pihole2 check_command check_nrpe!check_docker_container_memory_pihole2
register 0
} }
define service{ define service{
@ -336,6 +411,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: prometheus service_description Container Memory: prometheus
check_command check_nrpe!check_docker_container_memory_prometheus check_command check_nrpe!check_docker_container_memory_prometheus
register 0
} }
define service{ define service{
@ -357,6 +433,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: syslog-ng service_description Container Memory: syslog-ng
check_command check_nrpe!check_docker_container_memory_syslog-ng check_command check_nrpe!check_docker_container_memory_syslog-ng
register 0
} }
define service{ define service{
@ -378,6 +455,7 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: telegraf service_description Container Memory: telegraf
check_command check_nrpe!check_docker_container_memory_telegraf check_command check_nrpe!check_docker_container_memory_telegraf
register 0
} }
define service{ define service{
@ -399,8 +477,10 @@ define service{
host_name pi502.in.thelinuxpro.net host_name pi502.in.thelinuxpro.net
service_description Container Memory: influxdb_telegraf-influxdb-1 service_description Container Memory: influxdb_telegraf-influxdb-1
check_command check_nrpe!check_docker_container_memory_influxdb_telegraf-influxdb-1 check_command check_nrpe!check_docker_container_memory_influxdb_telegraf-influxdb-1
register 0
} }
## PI503
define service{ define service{
use local-service,graphed-service use local-service,graphed-service
host_name pi503.in.thelinuxpro.net host_name pi503.in.thelinuxpro.net
@ -420,5 +500,6 @@ define service{
host_name pi503.in.thelinuxpro.net host_name pi503.in.thelinuxpro.net
service_description Container Memory: nagios service_description Container Memory: nagios
check_command check_nrpe!check_docker_container_memory_nagios check_command check_nrpe!check_docker_container_memory_nagios
register 0
} }

0
overlay/opt/nagios/libexec/check_ssl_certificate Normal file → Executable file
View File