Automated installation of NRPE

Discuss new project and feature ideas here.
See for new projects under development.

Automated installation of NRPE

Postby wb720 » Wed Mar 15, 2017 5:06 pm

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?
Posts: 2
Joined: Wed Mar 15, 2017 4:49 pm

Re: Automated installation of NRPE

Postby dwhitfield » Wed Mar 15, 2017 7:18 pm

Puppet can already be used with Nagios:

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

Code: Select all
cd /tmp
tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent

You asked about repos in the other thread, which is why you were given a Debian repo.
Former Nagios Staff
Posts: 4569
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN

Re: Automated installation of NRPE

Postby ipcsysadmins » Wed Mar 07, 2018 5:15 pm

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
     - install

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

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

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

- name: Copy the mount point check scripts
   copy: src=files/{{ item }} dest=/usr/local/nagios/libexec/ mode=0755 owner=ro                                                                                                          ot group=root
     - check_mountpoints
     - check_ro_mounts
     - 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
     - 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
     - mount
     -  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
     - sudo

- name: Cleanup of leftovers
   file: dest=/tmp/linux-nrpe-agent state=absent
     - cleanup
Posts: 5
Joined: Mon Mar 05, 2018 3:48 pm

Re: Automated installation of NRPE

Postby scottwilkerson » Thu Mar 08, 2018 12:06 pm

Thanks for sharing @ipcsysadmins
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
DevOps Engineer
Posts: 13480
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Automated installation of NRPE

Postby Bitman » Sun Mar 18, 2018 11:24 am

I found interesting things here:
There couple basic things that help me.May help you as well. ;)
Note me if not,thanks.Cheer!
My Crypto Project start at 2019!
Posts: 1
Joined: Sun Mar 18, 2018 8:02 am

Re: Automated installation of NRPE

Postby lmiltchev » Mon Mar 19, 2018 9:14 am

@wb720, do you have any more questions or it is safe to lock this post?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
QA Manager
Posts: 11589
Joined: Mon May 23, 2011 12:15 pm

Return to Nagios Ideas

Who is online

Users browsing this forum: No registered users and 1 guest