LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 05-10-2007, 09:01 AM   #1
lexdave
LQ Newbie
 
Registered: May 2007
Posts: 2

Rep: Reputation: 0
Network Administration in large wifi network


I've got a network with just under 300 WAP's that I manage in a single hotel. The problem is they keep going down on me for various reasons: they lock up, they break, the guest just unplugs them (they are "hidden" in the rooms). With so many devices, and with so many going down (3-8 daily) its hard to keep up with repairs, which leads to unhappy guest for the hotel.

Basically what I'm looking for is a simple program that can be loaded on a Ubuntu machine that will be plugged into the main switch and ping all of the device that I list (by IP) and then generate a simple text file of e-mail and mail it to me with the results. A GUI would be preferred as I'm still new to Linux (3 months use at home). Any suggestions would be welcomed: I have tried a few programs and found that I'm not that adept to installing programs in Linux yet so something from a repro would be ideal for me.

Thanks in advance.

(Ubuntu 7.04 while be used in the install, unless a better option is presented)
 
Old 05-11-2007, 05:20 AM   #2
mechdave
Member
 
Registered: Apr 2007
Location: Adelaide, Australia
Distribution: Ubuntu 8.10 and 7.10 server
Posts: 95

Rep: Reputation: 15
RE: Network Administration in large wifi network

Are you wanting the email to be delivered to the Ubuntu machine or another email address elsewhere?
This script will ping all your machines that you enter the ip addresses for and send an email to user at the local machine

Code:
#!/bin/bash
#Run this script as a crond job on a hourly basis
#by putting this script in /etc/cron.hourly/
subject="ping results for "$(date)
logfile="/var/log/ping_results.log"
5_sec_ping=$(ping -c 5)

#Substitute ip-addy for your ip addresses and copy the line for subsequent addresses
$5_sec_ping ip-addy-1 > $logfile
$5_sec_ping ip-addy-2 >> $logfile
$5_sec_ping ip-addy-3 >> $logfile
#etc... etc...

#Sendmail must be running for this to work (execute /etc/rc.d/sendmail I think?).
#Change user to your username
mail -s "$subject" user@localhost < /var/log/ping_result.log

#To read the mail set up in your mail client an account to check your local mail account.
#Use the option of standard unix mbox. 
#The mail will usually be in /var/spool/mail/user

Last edited by mechdave; 05-11-2007 at 05:43 AM.
 
Old 05-11-2007, 11:20 AM   #3
lexdave
LQ Newbie
 
Registered: May 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Holy crap, THANK YOU VERY MUCH! This will do exactly what I want, thanks so much, I'm now in love with Linux all over again.

The e-mail will be sent to a remote machine in the office, so I guess just enter the proper email address and it will pop it off, but thats ok if we have to log into the machine manually to run the script and get the results. This will help us out so much either way. Thanks again.

Last edited by lexdave; 05-11-2007 at 11:22 AM.
 
Old 05-12-2007, 01:06 AM   #4
mechdave
Member
 
Registered: Apr 2007
Location: Adelaide, Australia
Distribution: Ubuntu 8.10 and 7.10 server
Posts: 95

Rep: Reputation: 15
Post

If you change the email address to user@machine_ip, send mail should find the machine for you. You may need to run sendmail on the remote machine too. Also when you add ip addresses to your list always make sure you add the >> to append to the log file. If you use just one > it will overwrite all the previous logs written in that file. If you do this &>> it will write all errors to log file as well (handy if link is down). I hope it all works well for you...

Mechdave
 
Old 05-12-2007, 07:43 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It is common to keep track of IP address in a worksheet.

I just tried it out. In the first column was a numer that could be a room number.
The second column was the IP address. I used a user defined format code of "192.168.1."@
and then entered the last octet into each field. If they are consecutive you could fill it with a series.

Then I saved it as a csv file. I didn't use a text delimiter.
Code:
roomiptable.csv
cat iproomtable.csv
123,192.168.1.100
214,192.168.1.101
111,192.168.1.102
112,192.168.1.102
113,192.168.1.104
114,192.168.1.105
115,192.168.1.106
116,192.168.1.107
118,192.168.1.108
119,192.168.1.109
120,192.168.1.110
121,192.168.1.111
Now you can read this table into an array variable in bash.
Code:
# Read in the table
> iptable=($(cat iproomtable.csv ))
# Display the first entry
> echo ${iptable[0]}
123,192.168.1.100
# Display the IP address of the first entry
> echo ${iptable[0]#*,}
192.168.1.100
# Display the Room number of the second entry
> echo ${iptable[1]%,*}
214
Since you have 300 IPs, it would be easier to use a loop.
Code:
# clear out the old logfile
:> logfile

# MAX = number of entries
MAX=${#iptable[@]}

# Ping each IP address in table and log failures
for (( index=0; index<MAX; index++ )); do
   $5_sec_ping ${iptable[$index]#*,} || echo "Room ${iptable[$index]%,*} ${iptable[$index]#*,} is down" >> logfile
This will ping each of the ip address in the csv file and only log failures to the logfile with a line containing the room number and the IP address.

You could instead read the csv file one line at a time in a while loop instead of using an array variable.

Last edited by jschiwal; 05-12-2007 at 07:50 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bridging a wired network to a wifi network bobmcobob Linux - Wireless Networking 2 07-18-2008 06:36 PM
Best WiFi PCI (or else) card in general for Linux and WiFi network experimentation? ICEMANII Linux - Wireless Networking 2 09-21-2006 04:50 PM
Network Administration danushky Linux - Networking 1 04-02-2006 04:41 PM
Network File System Administration Guide Verylinux Linux - Software 0 02-07-2005 08:00 AM
HELP - Remote Network Administration nyb141 Linux - Networking 4 05-03-2004 08:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration