LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-21-2007, 11:01 AM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Ruby Network Script


Can someone give show me a sample script using Ruby that can query a subnet,tell me if a device is available(router,switches, NAM's and etc.) whether or not a port is open for service(telnet tcp 23), and to be sorted in a nice format and have it execute at a certain time of the day and e-mailed to certain addresses. I am new to shell scripting.
 
Old 11-22-2007, 05:57 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
is that all?

hmm, it's almost too easy.
 
Old 11-22-2007, 08:04 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
It is for my work. I have been ask to right a script for reporting!
 
Old 11-22-2007, 11:17 PM   #4
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
There aren't such samples because samples are just examples (usually) and not complete projects like this. You need to piece code together from samples to get a working solution.

Last edited by Alien_Hominid; 11-22-2007 at 11:20 PM.
 
Old 11-23-2007, 03:19 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
start by using netcat

this is a notoriously difficult thing to do with any certainty.
 
Old 11-23-2007, 05:29 AM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
for a beginner programmer like myself, what it be easier to learned Interpreted languages or compiled languages to start with? I am a bit confused.
 
Old 11-23-2007, 05:45 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'll ignore the last question because I can't understand it.

You said that you would be using ruby. Check what modules are available in ruby dealing with ICMP and with e-mail. You mentioned devices like switches & routers. A switch won't have an IP address of it's own but may respond to ICMP and provide the info you require.

However, you might want to look into something like Nagios, or for a very large network, openNMS. Why reinvent the wheel?
 
Old 11-23-2007, 07:47 AM   #8
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I am just think that I will stick with the basics. thanks
 
  


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
Subversion ruby script fails fenrisW0lf *BSD 1 12-21-2007 06:57 PM
PHP v Ruby/Ruby on Rails Neko_D Linux - General 4 02-08-2007 11:56 PM
[Ruby] Tar'ing or Zip'ing with ruby script lmcilwain Programming 2 01-19-2007 06:56 PM
need help with a ruby script listing directory contents Joseph Schiller Programming 4 12-31-2006 11:46 PM
cleaning the readability of this ruby script hedpe Programming 1 12-26-2006 02:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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