[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     Re: [nocol-users] webnocol.cgi

Hi Rick,

You're right. It's my fault. I've tested the the line from Alan and i had the
same result.
Nothing !!!

Then I stripped the | /usr/bin/tail and got the error message that /usr/bin/grep
not found :-) (It's an Linux RedHat 5.1)

I've corrected this to /bin/grep and then i got the message: Permission
denied.....

Correcting that and all looks fine......

So, if the output of grep is an error message | /usr/bin/tail sends no data to
the perl pipe....


Bye,

Dirk



Rick Beebe wrote:

> No, that's not true. Both of these variations work--yours, Dirk, takes the
> end of the file and filters it. Alan's searches the file and then displays
> just the last few results. Also, tail only produces continuous output if you
> use the '-f' switch.
>
> I tried them both and they both work for me. What's happening for you Alan?
> No output or an error message? One thing I found useful was to add
>
> print "Command: $cmd<p>\n";
>
> immediately following the line that reads
> $cmd =~ s/DEVICE/$siteaddr/ ;
>
> That reveals, for example, that when I run this on a hostmon variable (I had
> a machine showing low disk space) $siteaddr was translating to '-' so my
> command was
>
> grep - logfile
>
> which, indeed, didn't produce the results I was expecting.
>
>   _______________________________________________________________________
>
>     Rick Beebe                                           (203) 785-6416
>     Manager, Systems & Network Engineering          FAX: (203) 785-3606
>     ITS-Med Client & Technology Services         Richard.Beebe@yale.edu
>     Yale University School of Medicine
>     P.O. Box 208078, New Haven, CT 06520-8078
>   _______________________________________________________________________
>
> > tail is a program to visualize the last part of a file. If you want to
> > filter the output, you have to use it in this way:
> >
> > local ($tail) = "/usr/bin/tail /var/log/datalog| /usr/bin/grep
> > DEVICE";
> >
> > It has nothing to do with Perl... :-)
> >
> > By the way: tail produces continous output. If you only want to see
> > problems in the past, use cat instead.
> >
> > Bye,
> >
> > Dirk
> >
> > >>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
> >
> > Am 18.12.98, 08:08:54, schrieb Alan Halachmi <alan@halachmi.net> zum
> > Thema [nocol-users] webnocol.cgi:
> >
> > > Quick question...
> >
> > >       I'm no PERL wizard, so I'm in need of some help.  I
> > > added another command to the troubleshooting area of webnocol.
> > > When I had the webnocol.cgi line read:
> > > local ($tail) = "tail /var/log/datalog";
> > > everything worked fine.
> >
> > > However, when I changed it to:
> > > local ($tail) = "/usr/bin/grep DEVICE /var/log/datalog |
> > /usr/bin/tail";
> > > it no longer works.
> >
> > > I tried:
> > > local ($tail) = "/usr/bin/grep DEVICE /var/log/datalog"
> > > but that didn't work either.
> >
> > > I'd like to be able to take a site, grep it from the datalog file and
> > tail the output of the grep, but I'm not having any luck.
> >
> > > Ideas?
> >
> > > TIA,
> > > Alan
> >
> > > --
> > > Alan Halachmi
> > > Wide Area Networks Specialist
> > > Ingram Entertainment Network Services
> > > mailto:alan@halachmi.net
> > > http://www.ingramentertainment.com
>
> --