#1  
Old 7th March 2012, 20:42
ccerino ccerino is offline
Junior Member
 
Join Date: Mar 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Question bash/expect n00b question

I am trying to write a script that enables me to install agents for Nagios XI on systems.


Script is like so (pretty simple)

#!/bin/bash
###########################
# This script is used to install Nagios XI Agents
# on target systems rather than manually installing
############################
# Move to /tmp for install
cd /tmp
#Pickup agent package
wget http://assets.nagios.com/downloads/n...e-agent.tar.gz

#Untar package
tar xvfz linux-nrpe-agent.tar.gz

#Move into agent directory
cd linux-nrpe-agent

#Run full install script
./fullinstall
#### IN HERE I NEED THE PROPER EXPECT STATEMENT ######
##Install asks if you want to proceed (Do you want to continue? [Y/n])
##Then when install is complete "Allow from:" is asked. IP Address(es) of Nagios server(s) goes here
### So, two answers are needed

##I know THIS cannot be right##

expect Do you want to continue? [Y/n]
send Y

expect Allow from:
send XXX.XXX.XXX.XXX

#Restart xinetd service

/etc/init.d/xinetd restart


When the agent install is complete ( THIS POINT OF THE SCRIPT ) the IP Address of the Nagios system doing the monitoring needs to be entered. I am sure this is a simple statement that is escaping me. However - I am experiencing a true brain cramp.

How do I enter the IP address (expect statement?) into this script so it can proceed without manual entry?

Last edited by ccerino; 7th March 2012 at 21:17.
Reply With Quote
Sponsored Links
Reply

Bookmarks

Tags
bash expect help script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Networking: Routing / subnet question paulievox HOWTO-Related Questions 1 16th February 2010 00:45
Dumb Virtualhost Question DantePasquale Server Operation 1 16th December 2009 08:43
Hostname question, and DNS question andrewfashion General 1 20th April 2009 14:30
emails domains and co-domains question bug or a feature omadon Installation/Configuration 3 27th November 2006 11:17
sendmail config question westb Server Operation 1 1st September 2006 18:00


All times are GMT +2. The time now is 13:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.