Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

zenxero/centos7-ansible-nagios-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archival Purposes

WARNING - This playbook is outdated and no longer works on modern RHEL-Like distros.

This an archive of an Ansible playbook that used to work circa 2017 or so. It only targets CentOS 7 and installs the Nagios monitoring server, as well as installing the NRPE client on CentOS 7 and Ubuntu clients.

Deploy Nagios Server

This repo contains an Ansible playbook that will automatically install and configure a CentOS 7 system as a Nagios monitoring server.

It will also install and configure the NRPE monitoring client on the nodes that you specify in the monitored-servers hostgroup. They will be configured to talk to the Nagios master server that you specify in the nagios-server hostgroup.

Table of Contents

Requirements

  • Ansible Control System Requirements
  • A system with the ansible and git packages installed.
  • The ability to SSH to the target system as root with an SSH key.
  • The target system that will be the Nagios server needs to be running the CentOS 7 Linux distribution.
  • The target CentOS 7 system should have a valid FQDN (Fully Qualified Domain Name) on your local network.

Usage

This is a standalone playbook, meaning that it includes its own ansible.cfg file and does not need a system-level config file.

To use this playbook:

  1. On your "control" system with ansible and git installed, clone this git repo.

  2. In the hosts file, you will want to define the host that you want to make your nagios master server as well as the hosts that you want to monitor with said master server.

  • Define your nagios master server in the nagios-server hostgroup
  • Define your clients that you want to monitor in the monitored-servers hostgroup
  1. In the deploy-nagios-environment.yml file, configure the following variables:
  • The admin_name_01 variable. This is the name of the user that will be the default contact template for alerts.
  • The nagios_username variable. This is the username you will log into the web interface with.
  • The admin_email_01 variable. This is the email address that you want to send alerts to.
  • The nagios_password variable. This is the password for the nagios web interface login.
  1. Now, run the ansible deploy command with this playbook:
ansible-playbook deploy-nagios-environment.yml

In a few minutes, you should have a working Nagios monitoring server that is set up to monitor your defined clients.

After the playbook is finished, you can access the web interface of your Nagios server by navigating to:

https://your-hostname.example.com/

To login, use the credentials that you defined in the variables in the deploy-nagios-environment.yml file.

This installation uses a self-signed SSL cert by default, so your browser will warn you that it can't validate the cert and that it may not be secure. Just continue through to the login page.

About

An old Ansible playbook targeting CentOS 7 that installs a Nagios monitoring server as well as monitored client hosts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published