LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-31-2009, 11:28 PM   #1
hasan_sust
LQ Newbie
 
Registered: May 2007
Posts: 23

Rep: Reputation: 0
Help Needed Urgently


Dear All

I am new to linux. Yesterday I craete a shell script to monitor the entry of arp cache. The script is as follows:



[root@localhost opt]# cat arpmonitor.sh

#!/bin/bash
echo '#############################'>>/opt/monitor
date >>/opt/monitor
echo '#############################'>>/opt/monitor
arp -n | awk '{print $1}' >> /opt/monitor



When I execute this script using the command ./arpmonitor it gives the following output


#############################
Wed Apr 1 10:05:02 BDT 2009
#############################
Address
172.10.4.1
172.10.4.172
172.10.4.76
172.10.4.163


I want to run this script within 5 minutes interval. So I add following
lines into the crontab

*/5 * * * * /opt/arpmonitor.sh


Then I check the output and found the following entry at output file.

#############################
Wed Apr 1 10:15:01 BDT 2009
#############################
#############################
Wed Apr 1 10:20:01 BDT 2009
#############################

That means arp -n | awk '{print $1}' >> /opt/monitor this command isn't executed.



Waiting for a prompt reply. Thanks in advance.
 
Old 04-01-2009, 02:37 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Give the whole path to the commands
eq
/usr/sbin/arp
/bin/date
....
 
Old 04-01-2009, 09:33 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hasan_sust View Post
Dear All

I am new to linux. Yesterday I craete a shell script to monitor the entry of arp cache. The script is as follows:


That means arp -n | awk '{print $1}' >> /opt/monitor this command isn't executed.

Waiting for a prompt reply. Thanks in advance.
Don't post things as URGENT. This isn't urgent for anyone but you, so don't tell us to give you a prompt reply. We all volunteer our time here, and answer questions as we can, at our leisure.

If you want a quick, prompt reply, hire a consultant.
 
Old 04-01-2009, 09:53 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
there is also arpwatch and arpalert if you want a tool that is already written..
 
Old 04-08-2009, 04:37 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by TB0ne View Post
Don't post things as URGENT. This isn't urgent for anyone but you, so don't tell us to give you a prompt reply. We all volunteer our time here, and answer questions as we can, at our leisure.

If you want a quick, prompt reply, hire a consultant.
Remember that LQ is a worldwide group & therefore half of us are asleep or at work at any given time.

Also, please use descriptive thread titles -- something that summarizes your problem.

BTW, I believe you can edit your thread title. If you'll do that here & make it descriptive of your problem, I'll read it & try to help.
 
  


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
urgently needed rajveervashisth AIX 2 08-05-2008 12:30 AM
Script needed urgently subhanjan Linux - Server 1 05-03-2007 09:17 AM
!!!help Needed Urgently!!! gupta.akshat Slackware - Installation 1 12-13-2005 09:22 AM
Help urgently needed steve007 Linux - Newbie 2 08-26-2005 09:14 AM
help needed urgently for a project djadhav Linux - Networking 1 10-18-2004 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:26 AM.

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