ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
ilikejam, you are the biggest help but please forgive me for my extremly limited programming knowledge(I promise will study up on this stuff) but I tried to incorporate this into my little program and I cant seem to get the appropiate output, check it out!
SNIFFERS IP_Address Status Telnet
=========== ================= === ======
Test1.aa.bb.ccc.edu Test1.aa.bb up closed
Test2.bb.cc.ddd.edu Test2.bb.cc up closed
Test3.dd.ff.ggg.edu Test3.dd.ff up closed
Test5.ee.zzz.edu Test5.ee.zz up closed
I know that problem is here:
I need my output to look like this:
SNIFFERS IP_Address Status Telnet
=========== ============ ====== ======
Test1.aa.bb 188.8.131.52 up closed
Test2.bb.cc 184.108.40.206 up closed
Test3.dd.ff 220.127.116.11 up closed
Test5.ee.zz 18.104.22.168 up closed
Last edited by metallica1973; 12-06-2007 at 06:36 AM.
I freakin love you man! next pay check it is done. Here is my finish product with the help of so many great individuals just to name a few(ilikejam,jiliagre,chrism01,acidkeypie,pixellany) keep up the great work.
To be honest, I'd use nmap (packages are available at sunfreeware) - it was designed to do this sort of thing.
This is the script (well, the important bit anyway) I run from cron at 6 every morning - the output is sent to my personal email to give me an early warning in case a machine has fallen over during the night.
for go in `cat $LIST`
/usr/local/bin/nmap -P0 -sT -p22 $go 2>&1 | egrep 'closed|filtered|Failed to resolve' > /dev/null
if [ $? == 0 ]
echo "$go - no ssh"
echo "$go - OK"
$LIST is just a file with a list of hostnames. Most of our hosts have telnet switched off, so I use an open SSH port to tell if the machine's in something resembling a usable state. Just change '-p22' to '-p23' to test telnet instead.
If nmap's not an option, you could do something funky with a sleep->kill after the read in your script to see if the read process is waiting, and take that as a 'yes, telnet's running', but that's a disgusting hack and I feel dirty for even having thought of it.