Page 1 of 1

Automated installation of NRPE

Posted: Wed Mar 15, 2017 5:06 pm
by wb720
In order to truly automate the installation of NRPE agents, one should not be expected to manual run a compile from a tarball on every endpoint.

Furthermore the expectation that if paying users of Nagios XI must depend on the communities behind Ubuntu or CentOS to get current binary packages is an insult to every customer.

What plans does Nagios XI have to support dev/ops deployment such as Puppet or Ansible?

Re: Automated installation of NRPE

Posted: Wed Mar 15, 2017 7:18 pm
by dwhitfield
Puppet can already be used with Nagios: https://support.nagios.com/kb/article.php?id=454

You do not need to compile anything for NRPE. Installation instructions are as follows:

Code: Select all

cd /tmp
wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall
You asked about repos in the other thread, which is why you were given a Debian repo.

Re: Automated installation of NRPE

Posted: Wed Mar 07, 2018 5:15 pm
by ipcsysadmins
I've created my own playbook while migrating to XI...its pretty basic, but it does the job. It assumes all files and configs are sitting in your files directory and you've created two handlers (in my case disabling the Core client and enabling the XI client). Remove the mount point additions and move the notify to another task:

Code: Select all

---
 - name: Copy the agent
   copy: src=files/linux-nrpe-agent.tar.gz dest=/tmp
   tags:
     - install

 - name: Extract the installer
   unarchive: src=/tmp/linux-nrpe-agent.tar.gz dest=/tmp
   tags:
     - install

 - name: Install NRPE Agent
   shell: "cd /tmp/linux-nrpe-agent;./fullinstall -n"
   tags:
     - install
   ignore_errors: yes

 - name: Copy the NRPE config
   copy: src=files/nrpe dest=/etc/xinetd.d/nrpe
   tags:
     - config

 - name: Copy the mount point check scripts
   copy: src=files/{{ item }} dest=/usr/local/nagios/libexec/ mode=0755 owner=ro                                                                                                          ot group=root
   with_items:
     - check_mountpoints
     - check_ro_mounts
   tags:
     - mount

 - name: Add mount point check to common.cfg
   lineinfile: path=/usr/local/nagios/etc/nrpe/common.cfg line="command[check_mo                                                                                                             untpoints]=sudo /usr/local/nagios/libexec/check_mountpoints -A" state=present
   tags:
     - mount

 - name: Copy the read only mount point check script
   lineinfile: path=/usr/local/nagios/etc/nrpe/common.cfg line="command[check_ro                                                                                                             _mounts]=/usr/local/nagios/plugins/check_ro_mounts -x /mnt/cdrom" state=present
   tags:
     - mount
   notify:
     -  Stop NRPE
     -  Start Xinetd

 - name: Allow NagiosXI to check services via NRPE
   lineinfile: path=/etc/sudoers line="nagios ALL=NOPASSWD{{':'}} /usr/local/nag                                                                                                             ios/libexec/check_init_service, /usr/local/nagios/libexec/check_mountpoints" sta                                                                                                             te=present
   tags:
     - sudo

 - name: Cleanup of leftovers
   file: dest=/tmp/linux-nrpe-agent state=absent
   tags:
     - cleanup

Re: Automated installation of NRPE

Posted: Thu Mar 08, 2018 12:06 pm
by scottwilkerson
Thanks for sharing @ipcsysadmins

Re: Automated installation of NRPE

Posted: Sun Mar 18, 2018 11:24 am
by Bitman
Hey,
I found interesting things here:
https://support.nagios.com/forum/viewto ... 16&t=43062
There couple basic things that help me.May help you as well. ;)
Note me if not,thanks.Cheer!

Re: Automated installation of NRPE

Posted: Mon Mar 19, 2018 9:14 am
by lmiltchev
@wb720, do you have any more questions or it is safe to lock this post?