LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2006, 12:15 AM   #1
rnramprasad
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
network status


how to create the file which has network status of set of servers [*.*.*.1] to [*.*.*.15] using shell script
 
Old 09-17-2006, 08:20 AM   #2
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
Quote:
the file which has network status of set of servers
This is unclear, what is "network status" for you? Do you have some kind of deamon that monitor the "state" of your servers? Or some kind of centralized logfile? Or do you mean configuration file, maybe?
Please provide more information:
-Tell us what you are trying to do exactly (installing an application? which one? what have you done so far?)
-Give us details about what you call "network status" (are you really talking about the state of the server? If so, what application are you using to monitor it? Can you give an example? Otherwise, is there another name to this?)

Whatever...
If you want to create a new (empty) file in a shell script, use "touch", like in :
Code:
touch mynewfile.txt
This will create an empty mynewfile.txt file.
To make a loop from 1 to 15, you could use something like (where SOMETHING is a command) :
Code:
for x in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do SOMETHING; done
You can also use "echo" to echo text in a file, like in :
Code:
echo "happy happy joy" > mynewfile.txt
 
Old 09-18-2006, 03:39 AM   #3
rnramprasad
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
sir iam sorry

using shell script a html file to be created .where the mentioned server/s are on or offi want to dispaly thsi in web .Or can i do this with PHP script to display the server connection [on/off] status through web

Last edited by rnramprasad; 09-18-2006 at 03:43 AM.
 
Old 09-19-2006, 09:31 AM   #4
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
Create a html file from a shell script would be easy, however, "how" do you want to display this on the web?
I mean, it would be easy to create an html file and to put it on your LOCAL apache webserver, but if the LOCAL server goes down, how do you expect to be able to see this file?

Or do you have some kind of centralized REMOTE webserver that could "display" these files? In that case, you would need to share (with NFS or Samba?) your apache webserver root directory and to mount it on all of the computer you want to "display status", to copy their file there.

About the script itself... calling "/sbin/ifconfig" from a shell script and greping the network card you want to monitor could do what you want. Or you could just call "ping -c 1 something.com" from a script and check the result?
 
  


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
Network Interface Status ejtbrown Programming 5 08-04-2006 01:12 AM
Network status from within C/C++ tbruer1138 Linux - Software 1 02-27-2005 12:11 AM
Network status from C/C++ program tbruer1138 Programming 1 02-26-2005 05:00 PM
network connection status ................ dileepkk Linux - Networking 1 07-09-2004 12:38 PM
Cannot get network card status up Synth3tic Linux - Newbie 14 05-22-2003 10:13 PM

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

All times are GMT -5. The time now is 05:39 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