BASH vs Expect



I've recently been promoted to an admin position at work. They've put
me in charge of the unix boxes. There are way too many to list here,
but there are 4 development labs, 2 support labs, 3 colos (about 6
racks each), and the internal server room.

So, having said that - I must admit I'm script stupid. I've only ever
had to work on one or two boxes at a time so I've never really needed
to script anything. I think that's going to change - starting about 10
minutes ago.

I've been tasked with writing a script (or doing it by hand) ssh'ing to
each server to test the internal IP and the external IP to make sure
it's responding on a certain port.

Now, I got through about 10 today and decided that there has got to be
a way to script this.

I asked one of the code guys at work who said bash would be a "dumb way
to do it" and suggested "expect". So I went to my bookstore today
(three in fact) and they had nothing on expect. I found a book online
and a few online resources - but nothing that I've been able to wrap my
head around.

So my question is two fold:

Should I use bash or expect (or something else - this is a FreeBSD
environment)

and

I just need something that will go out - hit the port - come back and
let me know if it got a response in x ms or timed out or what not. I
don't want to necessarily login to each box and terminate a session.

This way when I get in in the morning I can run it (or run it on cron)
and see what gets my attention first.

I've got a monitoring server (Nagios) that's internal that will hit the
internal IP's - but this script is going to be setup outside the
network to hit our IP's from a customer / field guy standpoint.

Sorry for the rambling - but having been fighting setting up bacula to
all these servers all day and getting Nagios sorted out - it's been a
rather stressful day ;)

-Keith

.



Relevant Pages

  • Re: Stoping a page from being a "Favorites"
    ... if the page is something that you want to hit from only one page then it ... might be easier to just test to see if the referrer is indeed that page and ... IMHO if it's really important you would want to use some server side script ...
    (microsoft.public.frontpage.client)
  • Re: HTML Form to ask for password: Insecure?
    ... > The problem is that when the data is sent to the server, ... The actual page with the password entry form on it does ... just the script that gets called when you hit ...
    (comp.security.misc)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)