Automatic install of nrpe agent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Automatic install of nrpe agent

Post by WillemDH »

Hello,

Did someone ever manage to install the Linux NRPE agent fully automated? I tried to create a Bash script which use the fullinstall with the n option, but it still stops when asking for the allowed from ip addresses.

This is the script I'm using now:

Code: Select all

    WriteLog Verbose Info "- NRPE - cd /tmp"
    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 -n
It hangs on:

Code: Select all

################################################################################
###                                                                          ###
### NRPE is currently set to allow connections only from these IP addresses: ###
###                                                                          ###
### 127.0.0.1                                                                ###
###                                                                          ###
### If you would like to change this list, enter all IP addresses to allow,  ###
### separated by spaces only, and then press Enter.                          ###
### (Put the address(es) of your Nagios XI servers(s) here.)                 ###
###                                                                          ###
################################################################################

Allow from:
Any feedback to make this fully automated is welcome. :)

Imho there should be a switch which allows to starts the script with the allowed from ip addresses. For example

./fullinstall -n -allowed "1.1.1.1 3.3.3.3 5.5.5.5"

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Automatic install of nrpe agent

Post by lmiltchev »

Willem, I believe you can just change this line:

Code: Select all

read -p "Allow from:  " ALLOW_INPUT
to this:

Code: Select all

ALLOW_INPUT='1.1.1.1 3.3.3.3 5.5.5.5'
in the "/tmp/linux-nrpe-agent/subcomponents/install" script, and run:

Code: Select all

cd /tmp/linux-nrpe-agent
./fullinstall -n
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Automatic install of nrpe agent

Post by WillemDH »

Thanks a lot for the tip Ludmill. If someone else is interested, this is the sed command I'm using to replace the allow from:

Code: Select all

sed -i 's/read -p "Allow from:  " ALLOW_INPUT/ALLOW_INPUT="1.1.1.1 3.3.3.3 5.5.5.5"/g' /tmp/linux-nrpe-agent/subcomponents/install
Thread can be closed.
Nagios XI 5.8.1
https://outsideit.net
Locked