LinuxQuestions.org
Review your favorite Linux distribution.
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,528

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: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
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: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
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: 233Reputation: 233Reputation: 233
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 09:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration