Page 1 of 1

nrpe-agent non-interactive parameters

Posted: Thu Jul 14, 2016 1:05 pm
by lhanna
Hi has anyone installed the nrpe-agent via command line with parameters to configure the IP addresses for monitoring servers?
Instead of extracting the tar file manipulating a file, I would like to one line install.
IE: ./fullinstall -non-interactive $PAR=10.2.2.2
etc.

Looking for an easier way to install these agents on a large amount of servers.

Re: nrpe-agent non-interactive parameters

Posted: Thu Jul 14, 2016 1:27 pm
by bwallace
Seems this should work for you:
https://github.com/shawnsustaita/deploy_nagios_nrpe
..and you can use this variable to set the IPs of your Nagios servers:
'NAGIOS_IP - This variable is appended to the only_from directive in /etc/xinetd.d/nrpe. This variable is required.'

Beyond that, the options for mass deploying NRPE are puppet
https://forge.puppet.com/tags/nrpe

or

chef
https://supermarket.chef.io/cookbooks/n ... ions/1.0.0

Re: nrpe-agent non-interactive parameters

Posted: Thu Jul 14, 2016 1:37 pm
by rkennedy
In addition to what @bwallace mentioned, you should be able to follow a post written a few years back -
https://support.nagios.com/forum/viewto ... 947#p51081
This works:

1. unzip linux-nrpe-agent.tar.gz
2. Modify the following script:
/tmp/linux-nrpe-agent/subcomponents/install

Comment out the read & hard code the IP for your Nagios server:
#read -p "Allow from: " ALLOW_INPUT
ALLOW_INPUT="X.X.X.X"

3. ./fullinstall -n
I just tested it on a CentOS machine, and it worked fine still. All we're doing is hardcoding the allow_from IP, rather then making it a user input.