BASH vs Expect
- From: keith.phipps@xxxxxxxxx
- Date: 18 Sep 2006 14:14:11 -0700
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
.
- Follow-Ups:
- Re: BASH vs Expect
- From: mr.bmonroe@xxxxxxxxx
- Re: BASH vs Expect
- From: mark_horn
- Re: BASH vs Expect
- From: Bruce Barnett
- Re: BASH vs Expect
- Prev by Date: Re: can a script tell if output is going to a file or to the screen?
- Next by Date: blinking an AWK output
- Previous by thread: can a script tell if output is going to a file or to the screen?
- Next by thread: Re: BASH vs Expect
- Index(es):
Relevant Pages
|