Compare commits

..

No commits in common. "e0e0d626f9b41e7c055fb6a4bfbdc8a375e5c7e1" and "f4117b46f8e301fe701892dee3ff7b1d09edf2e2" have entirely different histories.

4 changed files with 3 additions and 50 deletions

View File

@ -202,6 +202,8 @@ nagios_commands:
- name: notify-service-by-matrix - name: notify-service-by-matrix
command: "/usr/bin/printf \"%b\" \"$NOTIFICATIONTYPE$\\nService $HOSTALIAS$ - $SERVICEDESC$ is $SERVICESTATE$\\nInfo: $SERVICEOUTPUT$\\nDate/Time: $LONGDATETIME$\" | /opt/Custom-Nagios-Plugins/notify-by-matrix" command: "/usr/bin/printf \"%b\" \"$NOTIFICATIONTYPE$\\nService $HOSTALIAS$ - $SERVICEDESC$ is $SERVICESTATE$\\nInfo: $SERVICEOUTPUT$\\nDate/Time: $LONGDATETIME$\" | /opt/Custom-Nagios-Plugins/notify-by-matrix"
nagios_services: nagios_services:
- name: SSH
command: check_ssh
# check_by_ssh checks # check_by_ssh checks
- name: Last Ansible Play - name: Last Ansible Play
command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_file_age /var/lib/ansible-last-run -w 432000 -c 604800 command: check_by_ssh!/usr/local/bin/monitoring-scripts/check_file_age /var/lib/ansible-last-run -w 432000 -c 604800

View File

@ -16,12 +16,6 @@
- "25565:25565/tcp" - "25565:25565/tcp"
- "25565:25565/udp" - "25565:25565/udp"
- "24454:24454/udp" - "24454:24454/udp"
# Prometheus exporter for Forge
# https://www.curseforge.com/minecraft/mc-mods/prometheus-exporter
#- "19565:19565/tcp"
# Prometheus exporter for Fabric
# https://modrinth.com/mod/fabricexporter
- "19565:25585/tcp"
volumes: volumes:
- /data/minecraft/createfarming:/data - /data/minecraft/createfarming:/data
tags: [ docker, minecraft, create, createfarming ] tags: [ docker, minecraft, create, createfarming ]

View File

@ -10,10 +10,3 @@ modules:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"] valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [] # Defaults to 2xx valid_status_codes: [] # Defaults to 2xx
method: GET method: GET
ssh_banner:
prober: tcp
timeout: 3s
tcp:
query_response:
- expect: "^SSH-2.0-"
- send: "SSH-2.0-blackbox-ssh-check"

View File

@ -11,30 +11,13 @@ scrape_configs:
- targets: ['localhost:9090'] - targets: ['localhost:9090']
# This is shipped by the Ansible role that deploys Prometheus # This is shipped by the Ansible role that deploys Prometheus
- job_name: "blackbox-ssh" - job_name: "blackbox"
metrics_path: /probe
params:
module: [ssh_banner]
static_configs:
- targets:
{% for host in groups['tags_nagios'] %}
- "{{ host }}:22"
{% endfor %}
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115
- job_name: "blackbox-http"
metrics_path: /probe metrics_path: /probe
params: params:
module: [http_2xx] module: [http_2xx]
static_configs: static_configs:
- targets: - targets:
{% for host in groups['tags_nagios'] %} {% for host in groups['tags_nagios'] %}
{% set vars = hostvars[host] %}
{% for service in vars.services %} {% for service in vars.services %}
{% for tag in service.tags %} {% for tag in service.tags %}
{# #} {# #}
@ -64,25 +47,6 @@ scrape_configs:
static_configs: static_configs:
- targets: ['blackbox:9115'] - targets: ['blackbox:9115']
# This job manages Minecraft servers, when we have them
- job_name: "minecraft"
static_configs:
- targets:
{% for host in groups['tags_nagios'] %}
{% set vars = hostvars[host] %}
{% for service in vars.services %}
{% for tag in service.tags %}
{# #}
{% if tag.slug == "nagios-checkminecraft" %}
{% for port in service.ports %}
- "{{ host }}:{{ port }}"
{% endfor %}
{% endif %}
{# #}
{% endfor %}
{% endfor %}
{% endfor %}
# These two jobs are included for every node in our inventory # These two jobs are included for every node in our inventory
- job_name: "node-exporter" - job_name: "node-exporter"
static_configs: static_configs: