
Īnd we can execute Ansible again: # ansible-playbook nrpe-deploy.yaml Now we can add new tasks to nrpe-deploy.yaml that will deploy the NRPE configuration files on the remote machines. Let’s call it nrpe.cfg: # bind to all interfacesĬommand=/usr/lib64/nagios/plugins/check_disk $ARG1$Ĭommand=/usr/lib64/nagios/plugins/check_load $ARG1$Ĭommand=/usr/lib64/nagios/plugins/check_procs $ARG1$Ĭommand=/usr/lib64/nagios/plugins/check_users $ARG1$ Next we create an NRPE configuration file to copy onto each remote machine. Now run the playbook with Ansible: # ansible-playbook nrpe-deploy.yaml
How to install nagvis on centos 7 install#
This playbook uses yum to install or update NRPE and the Nagios plugins. Let’s create a new playbook, which we will call nrpe-deploy.yaml, containing the following tasks for steps (1) and (2):. In our case, the steps we want to perform are (1) to install NRPE, (2) install Nagios plugins, and (3) configure NRPE. The simplest way to do this is to install our public ssh key on each remote machine: # ssh-copy-id ssh-copy-id ssh-copy-id Create the PlaybookĪnsible playbooks are YAML configuration files that describe a list of tasks to execute. Put the IPs of the remote machines on which you want to deploy NRPE in /etc/ansible/hosts, for example: Īnsible will connect to the remote machine using OpenSSH, but to do so it needs a way to authenticate itself on each machine.

It’s good practice to keep the EPEL repository disabled so that you don’t install unwanted packages from it accidentally.

On CentOS 6, Ansible is available only in the EPEL repository.
How to install nagvis on centos 7 how to#
I will show you how to do it on NetEye, just to keep everything in one place. The first thing we need to do is install Ansible on a control machine. Another important reason is that Ansible is agentless, using OpenSSH to execute tasks on remote machines. Bash scripts tend to be long, unreadable and unwieldy, while Ansible provides a powerful set of modules that can be used to perform the most common tasks in just few lines of self-explanatory code. This can be achieved with a bash script, so why bother to use Ansible? The main reason is simplicity. Instead, you want to run just a single command, or click a few buttons, to configure all those machines at once, and then keep them updated over time.

When you need to monitor multiple machines, it’s a lot of work to install each machine manually. 2018 Davide Bizzarri Business Service Monitoring, NetEye How to Deploy NRPE on CentOS 7 with Ansible Introduction
