mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-17 22:14:25 +02:00
Shorted monitor-bot- to mon-bot-
This commit is contained in:
parent
dd1aab70fb
commit
ae5f021b8d
@ -12,7 +12,7 @@ CyMaIS covers everything from essential system setups to advanced configurations
|
|||||||
Every business is unique, and so is CyMaIS! With a modular architecture, it adapts to specific requirements, whether for startups, growing businesses, NGOs, or large enterprises.
|
Every business is unique, and so is CyMaIS! With a modular architecture, it adapts to specific requirements, whether for startups, growing businesses, NGOs, or large enterprises.
|
||||||
|
|
||||||
## Proactive Monitoring & Maintenance 🔍
|
## Proactive Monitoring & Maintenance 🔍
|
||||||
With automated updates, system health checks, and security audits, CyMaIS ensures your infrastructure is always up-to-date and running smoothly. Roles such as `monitor-bot-docker-container`, `monitor-bot-btrfs`, and `monitor-bot-webserver` help monitor system integrity.
|
With automated updates, system health checks, and security audits, CyMaIS ensures your infrastructure is always up-to-date and running smoothly. Roles such as `mon-bot-docker-container`, `mon-bot-btrfs`, and `mon-bot-webserver` help monitor system integrity.
|
||||||
|
|
||||||
## Uncompromised Security 🔒
|
## Uncompromised Security 🔒
|
||||||
Security is a top priority! CyMaIS includes robust security features like full-disk encryption recommendations, 2FA enforcement, encrypted server deployments (`web-app-keycloak`, `service-openldap`), and secure backup solutions (`backup-remote-to-local`, `backup-data-to-usb`).
|
Security is a top priority! CyMaIS includes robust security features like full-disk encryption recommendations, 2FA enforcement, encrypted server deployments (`web-app-keycloak`, `service-openldap`), and secure backup solutions (`backup-remote-to-local`, `backup-data-to-usb`).
|
||||||
|
@ -16,7 +16,7 @@ Follow these guides to install and configure CyMaIS:
|
|||||||
|
|
||||||
## Managing & Updating CyMaIS 🔄
|
## Managing & Updating CyMaIS 🔄
|
||||||
- Regularly update services using `update-docker`, `update-pacman`, or `update-apt`.
|
- Regularly update services using `update-docker`, `update-pacman`, or `update-apt`.
|
||||||
- Monitor system health with `monitor-bot-btrfs`, `monitor-bot-webserver`, and `monitor-bot-docker-container`.
|
- Monitor system health with `mon-bot-btrfs`, `mon-bot-webserver`, and `mon-bot-docker-container`.
|
||||||
- Automate system maintenance with `maintenance-lock`, `cleanup-backups-service`, and `maintenance-docker-restart`.
|
- Automate system maintenance with `maintenance-lock`, `cleanup-backups-service`, and `maintenance-docker-restart`.
|
||||||
|
|
||||||
For more details, refer to the specific guides above.
|
For more details, refer to the specific guides above.
|
@ -59,7 +59,7 @@ For a complete list of role categories and detailed definitions, see:
|
|||||||
|
|
||||||
## Monitoring & Alerting
|
## Monitoring & Alerting
|
||||||
|
|
||||||
- **monitor-bot-***
|
- **mon-bot-***
|
||||||
“Bot”-style health checks with alerts via Telegram, email, etc.
|
“Bot”-style health checks with alerts via Telegram, email, etc.
|
||||||
|
|
||||||
- **monitor-core-***
|
- **monitor-core-***
|
||||||
|
@ -22,7 +22,7 @@ This Ansible role manages the configuration of `systemd-journald` on target host
|
|||||||
|
|
||||||
- Customizable retention and runtime limits
|
- Customizable retention and runtime limits
|
||||||
- Seamless restarts on config update
|
- Seamless restarts on config update
|
||||||
- Integration with `monitor-bot-journalctl` for downstream monitoring
|
- Integration with `mon-bot-journalctl` for downstream monitoring
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@ galaxy_info:
|
|||||||
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/core-journalctl"
|
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/core-journalctl"
|
||||||
run_after: []
|
run_after: []
|
||||||
dependencies:
|
dependencies:
|
||||||
- monitor-bot-journalctl
|
- mon-bot-journalctl
|
||||||
|
@ -29,7 +29,7 @@ galaxy_info:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- backup-docker-to-local
|
- backup-docker-to-local
|
||||||
- user-administrator
|
- user-administrator
|
||||||
- monitor-bot-docker-container
|
- mon-bot-docker-container
|
||||||
- monitor-bot-docker-volumes
|
- mon-bot-docker-volumes
|
||||||
- maintenance-docker-heal
|
- maintenance-docker-heal
|
||||||
- maintenance-docker-restart
|
- maintenance-docker-restart
|
||||||
|
@ -22,4 +22,4 @@ galaxy_info:
|
|||||||
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||||
documentation: "https://s.veen.world/cymais"
|
documentation: "https://s.veen.world/cymais"
|
||||||
dependencies:
|
dependencies:
|
||||||
- monitor-bot-msmtp
|
- mon-bot-msmtp
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# monitor-bot-btrfs
|
# mon-bot-btrfs
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
Checks the health of all mounted Btrfs filesystems by inspecting device error counters.
|
Checks the health of all mounted Btrfs filesystems by inspecting device error counters.
|
||||||
@ -11,6 +11,6 @@ Checks the health of all mounted Btrfs filesystems by inspecting device error co
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Just include this role in your playbook; it will:
|
Just include this role in your playbook; it will:
|
||||||
1. Deploy a small shell script under `{{ path_administrator_scripts }}/monitor-bot-btrfs/`.
|
1. Deploy a small shell script under `{{ path_administrator_scripts }}/mon-bot-btrfs/`.
|
||||||
2. Install a `.service` and `.timer` unit.
|
2. Install a `.service` and `.timer` unit.
|
||||||
3. Send alerts via `alert-compose` if any filesystem shows errors.
|
3. Send alerts via `alert-compose` if any filesystem shows errors.
|
5
roles/mon-bot-btrfs/handlers/main.yml
Normal file
5
roles/mon-bot-btrfs/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-btrfs.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-btrfs.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -4,16 +4,16 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: create monitor-bot-btrfs.sh
|
- name: create mon-bot-btrfs.sh
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-btrfs.sh
|
src: mon-bot-btrfs.sh
|
||||||
dest: "{{docker_health_btrfs_folder}}monitor-bot-btrfs.sh"
|
dest: "{{docker_health_btrfs_folder}}mon-bot-btrfs.sh"
|
||||||
|
|
||||||
- name: create monitor-bot-btrfs.cymais.service
|
- name: create mon-bot-btrfs.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-btrfs.service.j2
|
src: mon-bot-btrfs.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-btrfs.cymais.service
|
dest: /etc/systemd/system/mon-bot-btrfs.cymais.service
|
||||||
notify: reload monitor-bot-btrfs.cymais.service
|
notify: reload mon-bot-btrfs.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
@ -4,4 +4,4 @@ OnFailure=alert-compose.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash {{docker_health_btrfs_folder}}monitor-bot-btrfs.sh
|
ExecStart=/bin/bash {{docker_health_btrfs_folder}}mon-bot-btrfs.sh
|
1
roles/mon-bot-btrfs/vars/main.yml
Normal file
1
roles/mon-bot-btrfs/vars/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
docker_health_btrfs_folder: "{{path_administrator_scripts}}mon-bot-btrfs/"
|
5
roles/mon-bot-csp/handlers/main.yml
Normal file
5
roles/mon-bot-csp/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-csp.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-csp.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -16,18 +16,18 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_csp is not defined
|
when: run_once_health_csp is not defined
|
||||||
|
|
||||||
- name: copy monitor-bot-csp.py
|
- name: copy mon-bot-csp.py
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-csp.py
|
src: mon-bot-csp.py
|
||||||
dest: "{{ health_csp_crawler_script }}"
|
dest: "{{ health_csp_crawler_script }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_csp is not defined
|
when: run_once_health_csp is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-csp.cymais.service
|
- name: create mon-bot-csp.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-csp.service.j2
|
src: mon-bot-csp.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-csp.cymais.service
|
dest: /etc/systemd/system/mon-bot-csp.cymais.service
|
||||||
notify: reload monitor-bot-csp.cymais.service
|
notify: reload mon-bot-csp.cymais.service
|
||||||
when: run_once_health_csp is not defined
|
when: run_once_health_csp is not defined
|
||||||
|
|
||||||
- name: set service_name to role_name
|
- name: set service_name to role_name
|
2
roles/mon-bot-csp/vars/main.yml
Normal file
2
roles/mon-bot-csp/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
health_csp_crawler_folder: "{{ path_administrator_scripts }}mon-bot-csp/"
|
||||||
|
health_csp_crawler_script: "{{ health_csp_crawler_folder }}mon-bot-csp.py"
|
@ -1,4 +1,4 @@
|
|||||||
# monitor-bot-disc-space
|
# mon-bot-disc-space
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
Monitors disk-space usage and alerts if any filesystem usage exceeds your defined threshold.
|
Monitors disk-space usage and alerts if any filesystem usage exceeds your defined threshold.
|
5
roles/mon-bot-disc-space/handlers/main.yml
Normal file
5
roles/mon-bot-disc-space/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-disc-space.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-disc-space.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -4,16 +4,16 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: create monitor-bot-disc-space.sh
|
- name: create mon-bot-disc-space.sh
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-disc-space.sh
|
src: mon-bot-disc-space.sh
|
||||||
dest: "{{health_disc_space_folder}}monitor-bot-disc-space.sh"
|
dest: "{{health_disc_space_folder}}mon-bot-disc-space.sh"
|
||||||
|
|
||||||
- name: create monitor-bot-disc-space.cymais.service
|
- name: create mon-bot-disc-space.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-disc-space.service.j2
|
src: mon-bot-disc-space.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-disc-space.cymais.service
|
dest: /etc/systemd/system/mon-bot-disc-space.cymais.service
|
||||||
notify: reload monitor-bot-disc-space.cymais.service
|
notify: reload mon-bot-disc-space.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=checking disc space
|
||||||
|
OnFailure=alert-compose.cymais@%n.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash {{health_disc_space_folder}}mon-bot-disc-space.sh {{size_percent_disc_space_warning}}
|
1
roles/mon-bot-disc-space/vars/main.yml
Normal file
1
roles/mon-bot-disc-space/vars/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
health_disc_space_folder: "{{path_administrator_scripts}}mon-bot-disc-space/"
|
@ -8,10 +8,10 @@ This Ansible role is designed to ensure the health of Docker containers running
|
|||||||
|
|
||||||
- `vars/main.yml`: Variable definitions for the script's directory.
|
- `vars/main.yml`: Variable definitions for the script's directory.
|
||||||
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
||||||
- `files/monitor-bot-docker-container.sh`: The script that checks the container health.
|
- `files/mon-bot-docker-container.sh`: The script that checks the container health.
|
||||||
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
||||||
- `templates/monitor-bot-docker-container.cymais.service.j2`: Systemd service template.
|
- `templates/mon-bot-docker-container.cymais.service.j2`: Systemd service template.
|
||||||
- `templates/monitor-bot-docker-container.cymais.timer.j2`: Systemd timer template.
|
- `templates/mon-bot-docker-container.cymais.timer.j2`: Systemd timer template.
|
||||||
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
5
roles/mon-bot-docker-container/handlers/main.yml
Normal file
5
roles/mon-bot-docker-container/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-docker-container.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-docker-container.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -5,17 +5,17 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_docker_container is not defined
|
when: run_once_health_docker_container is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-docker-container.sh
|
- name: create mon-bot-docker-container.sh
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-docker-container.sh
|
src: mon-bot-docker-container.sh
|
||||||
dest: "{{health_docker_container_folder}}monitor-bot-docker-container.sh"
|
dest: "{{health_docker_container_folder}}mon-bot-docker-container.sh"
|
||||||
when: run_once_health_docker_container is not defined
|
when: run_once_health_docker_container is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-docker-container.cymais.service
|
- name: create mon-bot-docker-container.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-docker-container.service.j2
|
src: mon-bot-docker-container.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-docker-container.cymais.service
|
dest: /etc/systemd/system/mon-bot-docker-container.cymais.service
|
||||||
notify: reload monitor-bot-docker-container.cymais.service
|
notify: reload mon-bot-docker-container.cymais.service
|
||||||
when: run_once_health_docker_container is not defined
|
when: run_once_health_docker_container is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
@ -4,4 +4,4 @@ OnFailure=alert-compose.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash {{health_docker_container_folder}}monitor-bot-docker-container.sh
|
ExecStart=/bin/bash {{health_docker_container_folder}}mon-bot-docker-container.sh
|
@ -1 +1 @@
|
|||||||
health_docker_container_folder: "{{path_administrator_scripts}}monitor-bot-docker-container/"
|
health_docker_container_folder: "{{path_administrator_scripts}}mon-bot-docker-container/"
|
@ -8,10 +8,10 @@ This role checks for anonymous Docker volumes that are not bound to a container
|
|||||||
|
|
||||||
- `vars/main.yml`: Variable definitions for the script's directory and whitelist.
|
- `vars/main.yml`: Variable definitions for the script's directory and whitelist.
|
||||||
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
||||||
- `files/monitor-bot-docker-volumes.sh`: The script that checks for anonymous Docker volumes and excludes whitelisted volumes.
|
- `files/mon-bot-docker-volumes.sh`: The script that checks for anonymous Docker volumes and excludes whitelisted volumes.
|
||||||
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
||||||
- `templates/monitor-bot-docker-volumes.cymais.service.j2`: Systemd service template, including the whitelisted volumes as a parameter.
|
- `templates/mon-bot-docker-volumes.cymais.service.j2`: Systemd service template, including the whitelisted volumes as a parameter.
|
||||||
- `templates/monitor-bot-docker-volumes.cymais.timer.j2`: Systemd timer template.
|
- `templates/mon-bot-docker-volumes.cymais.timer.j2`: Systemd timer template.
|
||||||
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
5
roles/mon-bot-docker-volumes/handlers/main.yml
Normal file
5
roles/mon-bot-docker-volumes/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-docker-volumes.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-docker-volumes.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -5,17 +5,17 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_docker_volumes is not defined
|
when: run_once_health_docker_volumes is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-docker-volumes.sh
|
- name: create mon-bot-docker-volumes.sh
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-docker-volumes.sh
|
src: mon-bot-docker-volumes.sh
|
||||||
dest: "{{health_docker_volumes_folder}}monitor-bot-docker-volumes.sh"
|
dest: "{{health_docker_volumes_folder}}mon-bot-docker-volumes.sh"
|
||||||
when: run_once_health_docker_volumes is not defined
|
when: run_once_health_docker_volumes is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-docker-volumes.cymais.service
|
- name: create mon-bot-docker-volumes.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-docker-volumes.service.j2
|
src: mon-bot-docker-volumes.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-docker-volumes.cymais.service
|
dest: /etc/systemd/system/mon-bot-docker-volumes.cymais.service
|
||||||
notify: reload monitor-bot-docker-volumes.cymais.service
|
notify: reload mon-bot-docker-volumes.cymais.service
|
||||||
when: run_once_health_docker_volumes is not defined
|
when: run_once_health_docker_volumes is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Checking docker health
|
||||||
|
OnFailure=alert-compose.cymais@%n.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash {{ health_docker_volumes_folder }}mon-bot-docker-volumes.sh "{{ whitelisted_anonymous_docker_volumes | join(' ') }}"
|
@ -1 +1 @@
|
|||||||
health_docker_volumes_folder: "{{path_administrator_scripts}}monitor-bot-docker-volumes/"
|
health_docker_volumes_folder: "{{path_administrator_scripts}}mon-bot-docker-volumes/"
|
@ -1,4 +1,4 @@
|
|||||||
# monitor-bot-journalctl
|
# mon-bot-journalctl
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
Scans `journalctl` over the last day for “error” entries and alerts if any are found.
|
Scans `journalctl` over the last day for “error” entries and alerts if any are found.
|
5
roles/mon-bot-journalctl/handlers/main.yml
Normal file
5
roles/mon-bot-journalctl/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-journalctl.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-journalctl.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -5,17 +5,17 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_journalctl is not defined
|
when: run_once_health_journalctl is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-journalctl.sh
|
- name: create mon-bot-journalctl.sh
|
||||||
copy:
|
copy:
|
||||||
src: monitor-bot-journalctl.sh
|
src: mon-bot-journalctl.sh
|
||||||
dest: "{{health_journalctl_folder}}monitor-bot-journalctl.sh"
|
dest: "{{health_journalctl_folder}}mon-bot-journalctl.sh"
|
||||||
when: run_once_health_journalctl is not defined
|
when: run_once_health_journalctl is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-journalctl.cymais.service
|
- name: create mon-bot-journalctl.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-journalctl.service.j2
|
src: mon-bot-journalctl.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-journalctl.cymais.service
|
dest: /etc/systemd/system/mon-bot-journalctl.cymais.service
|
||||||
notify: reload monitor-bot-journalctl.cymais.service
|
notify: reload mon-bot-journalctl.cymais.service
|
||||||
when: run_once_health_journalctl is not defined
|
when: run_once_health_journalctl is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
@ -4,4 +4,4 @@ OnFailure=alert-compose.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash {{health_journalctl_folder}}monitor-bot-journalctl.sh
|
ExecStart=/bin/bash {{health_journalctl_folder}}mon-bot-journalctl.sh
|
1
roles/mon-bot-journalctl/vars/main.yml
Normal file
1
roles/mon-bot-journalctl/vars/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
health_journalctl_folder: "{{path_administrator_scripts}}mon-bot-journalctl/"
|
@ -1,4 +1,4 @@
|
|||||||
# monitor-bot-msmtp
|
# mon-bot-msmtp
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@ -6,15 +6,15 @@ This Ansible role sends periodic health check emails using **msmtp** to verify t
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Optimized for Archlinux, this role creates the required directory structure, installs and configures the monitor-bot-check script, and integrates with the **alert-telegram** role. It uses the **generic-timer** role to schedule regular checks based on your customizable `OnCalendar` setting.
|
Optimized for Archlinux, this role creates the required directory structure, installs and configures the mon-bot-check script, and integrates with the **alert-telegram** role. It uses the **generic-timer** role to schedule regular checks based on your customizable `OnCalendar` setting.
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
The **monitor-bot-msmtp** role ensures that your mail transport system stays available by sending a test email at defined intervals. If the email fails, a Telegram alert is triggered, allowing you to detect and address issues before they impact users.
|
The **mon-bot-msmtp** role ensures that your mail transport system stays available by sending a test email at defined intervals. If the email fails, a Telegram alert is triggered, allowing you to detect and address issues before they impact users.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Directory & Script Deployment:** Sets up `monitor-bot-msmtp/` and deploys a templated Bash script to send test emails via msmtp.
|
- **Directory & Script Deployment:** Sets up `mon-bot-msmtp/` and deploys a templated Bash script to send test emails via msmtp.
|
||||||
- **Systemd Service & Timer:** Provides `.service` and `.timer` units to run the check and schedule it automatically.
|
- **Systemd Service & Timer:** Provides `.service` and `.timer` units to run the check and schedule it automatically.
|
||||||
- **Failure Notifications:** Leverages **alert-telegram** to push alerts when the script exits with an error.
|
- **Failure Notifications:** Leverages **alert-telegram** to push alerts when the script exits with an error.
|
||||||
- **Configurable Schedule:** Define your desired check frequency using the `on_calendar_health_msmtp` variable.
|
- **Configurable Schedule:** Define your desired check frequency using the `on_calendar_health_msmtp` variable.
|
5
roles/mon-bot-msmtp/handlers/main.yml
Normal file
5
roles/mon-bot-msmtp/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: reload mon-bot-msmtp.cymais.service
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-msmtp.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -4,17 +4,17 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: create monitor-bot-msmtp.sh
|
- name: create mon-bot-msmtp.sh
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-msmtp.sh.j2
|
src: mon-bot-msmtp.sh.j2
|
||||||
dest: "{{ health_msmtp_folder }}monitor-bot-msmtp.sh"
|
dest: "{{ health_msmtp_folder }}mon-bot-msmtp.sh"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: create monitor-bot-msmtp.cymais.service
|
- name: create mon-bot-msmtp.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-msmtp.service.j2
|
src: mon-bot-msmtp.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-msmtp.cymais.service
|
dest: /etc/systemd/system/mon-bot-msmtp.cymais.service
|
||||||
notify: reload monitor-bot-msmtp.cymais.service
|
notify: reload mon-bot-msmtp.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
@ -4,4 +4,4 @@ OnFailure=alert-telegram.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash {{ health_msmtp_folder }}monitor-bot-msmtp.sh
|
ExecStart=/bin/bash {{ health_msmtp_folder }}mon-bot-msmtp.sh
|
1
roles/mon-bot-msmtp/vars/main.yml
Normal file
1
roles/mon-bot-msmtp/vars/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
health_msmtp_folder: "{{ path_administrator_scripts }}mon-bot-msmtp/"
|
@ -1,4 +1,4 @@
|
|||||||
# monitor-bot-webserver
|
# mon-bot-webserver
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
Verifies that each of your Nginx‐served domains returns an expected HTTP status (200, 301, etc.) and alerts on deviations.
|
Verifies that each of your Nginx‐served domains returns an expected HTTP status (200, 301, etc.) and alerts on deviations.
|
5
roles/mon-bot-webserver/handlers/main.yml
Normal file
5
roles/mon-bot-webserver/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- name: "reload mon-bot-webserver.cymais.service"
|
||||||
|
systemd:
|
||||||
|
name: mon-bot-webserver.cymais.service
|
||||||
|
enabled: yes
|
||||||
|
daemon_reload: yes
|
@ -11,17 +11,17 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: run_once_health_nginx is not defined
|
when: run_once_health_nginx is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-webserver.py
|
- name: create mon-bot-webserver.py
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-webserver.py.j2
|
src: mon-bot-webserver.py.j2
|
||||||
dest: "{{ health_nginx_folder }}monitor-bot-webserver.py"
|
dest: "{{ health_nginx_folder }}mon-bot-webserver.py"
|
||||||
when: run_once_health_nginx is not defined
|
when: run_once_health_nginx is not defined
|
||||||
|
|
||||||
- name: create monitor-bot-webserver.cymais.service
|
- name: create mon-bot-webserver.cymais.service
|
||||||
template:
|
template:
|
||||||
src: monitor-bot-webserver.service.j2
|
src: mon-bot-webserver.service.j2
|
||||||
dest: /etc/systemd/system/monitor-bot-webserver.cymais.service
|
dest: /etc/systemd/system/mon-bot-webserver.cymais.service
|
||||||
notify: reload monitor-bot-webserver.cymais.service
|
notify: reload mon-bot-webserver.cymais.service
|
||||||
when: run_once_health_nginx is not defined
|
when: run_once_health_nginx is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
@ -4,4 +4,4 @@ OnFailure=alert-compose.cymais@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/python3 {{ health_nginx_folder }}monitor-bot-webserver.py
|
ExecStart=/usr/bin/python3 {{ health_nginx_folder }}mon-bot-webserver.py
|
1
roles/mon-bot-webserver/vars/main.yml
Normal file
1
roles/mon-bot-webserver/vars/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
health_nginx_folder: "{{ path_administrator_scripts }}mon-bot-webserver/"
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-btrfs.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-btrfs.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1 +0,0 @@
|
|||||||
docker_health_btrfs_folder: "{{path_administrator_scripts}}monitor-bot-btrfs/"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-csp.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-csp.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1,2 +0,0 @@
|
|||||||
health_csp_crawler_folder: "{{ path_administrator_scripts }}monitor-bot-csp/"
|
|
||||||
health_csp_crawler_script: "{{ health_csp_crawler_folder }}monitor-bot-csp.py"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-disc-space.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-disc-space.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1,7 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=checking disc space
|
|
||||||
OnFailure=alert-compose.cymais@%n.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/bin/bash {{health_disc_space_folder}}monitor-bot-disc-space.sh {{size_percent_disc_space_warning}}
|
|
@ -1 +0,0 @@
|
|||||||
health_disc_space_folder: "{{path_administrator_scripts}}monitor-bot-disc-space/"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-docker-container.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-docker-container.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-docker-volumes.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-docker-volumes.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1,7 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Checking docker health
|
|
||||||
OnFailure=alert-compose.cymais@%n.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/bin/bash {{ health_docker_volumes_folder }}monitor-bot-docker-volumes.sh "{{ whitelisted_anonymous_docker_volumes | join(' ') }}"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-journalctl.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-journalctl.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1 +0,0 @@
|
|||||||
health_journalctl_folder: "{{path_administrator_scripts}}monitor-bot-journalctl/"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: reload monitor-bot-msmtp.cymais.service
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-msmtp.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1 +0,0 @@
|
|||||||
health_msmtp_folder: "{{ path_administrator_scripts }}monitor-bot-msmtp/"
|
|
@ -1,5 +0,0 @@
|
|||||||
- name: "reload monitor-bot-webserver.cymais.service"
|
|
||||||
systemd:
|
|
||||||
name: monitor-bot-webserver.cymais.service
|
|
||||||
enabled: yes
|
|
||||||
daemon_reload: yes
|
|
@ -1 +0,0 @@
|
|||||||
health_nginx_folder: "{{ path_administrator_scripts }}monitor-bot-webserver/"
|
|
@ -20,5 +20,5 @@ galaxy_info:
|
|||||||
issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues"
|
issue_tracker_url: "https://github.com/kevinveenbirkenbach/cymais/issues"
|
||||||
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/webserver-core"
|
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/webserver-core"
|
||||||
dependencies:
|
dependencies:
|
||||||
- monitor-bot-webserver
|
- mon-bot-webserver
|
||||||
- monitor-bot-csp
|
- mon-bot-csp
|
@ -6,9 +6,9 @@
|
|||||||
loop:
|
loop:
|
||||||
- core-security
|
- core-security
|
||||||
- core-journalctl
|
- core-journalctl
|
||||||
- monitor-bot-disc-space
|
- mon-bot-disc-space
|
||||||
- cleanup-disc-space
|
- cleanup-disc-space
|
||||||
- monitor-bot-btrfs
|
- mon-bot-btrfs
|
||||||
- maintenance-btrfs-auto-balancer
|
- maintenance-btrfs-auto-balancer
|
||||||
|
|
||||||
- name: "Integrate Docker Role includes"
|
- name: "Integrate Docker Role includes"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user