Automated installation of NRPE

Discuss new project and feature ideas here.
See labs.nagios.com 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?
wb720
 
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: 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.
dwhitfield
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
   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
ipcsysadmins
 
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
scottwilkerson
DevOps Engineer
 
Posts: 10514
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

Hey,
I found interesting things here:
viewtopic.php?f=16&t=43062
There couple basic things that help me.May help you as well. ;)
Note me if not,thanks.Cheer!
My Crypto Project start at 2019!
Bitman
 
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
lmiltchev
QA Manager
 
Posts: 10304
Joined: Mon May 23, 2011 12:15 pm


Return to Nagios Ideas

Who is online

Users browsing this forum: No registered users and 2 guests