D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] apache perl cgi question



       On Thu, 18 Nov 2004 08:33:48 -0000, "Darke, Clive"
<Clive.darke@xxxxxx> wrote:

Dave,

I meant to give you an awk example  (will print the first 10 lines):

#!/bin/awk -f
BEGIN {
  for (i = 0; i < 10; i++)
  {
     if ( ("ntpdc -n -c mon | sort -nrk4" | getline) <= 0 )
           break
     print
  } 
  close ("ntpdc -n -c mon | sort -nrk4")
}


Clive



To those getting 404's from attempting to access the cgi script - it
no longer exists ... I managed to break the script so badly that all
attempts to run it gave internal server errors in apache, even though
when I dumped the output to a static html file, this displayed ok.

I replaced it with http://www.morgad.no-ip.info/ntp/status.html which
is generated once per hour by a very hastily written shell script in
my /etc/cron.hourly/ directory. I can now go back and slowly tweak the
output to give the stats I am actually interested in - The ratio of
'count' to 'first', rather than 'count' by itself. Also the number of
lines with 'last' <1200, to give an estimate of the number of 'users',
and add the code to put machines submitting more than 100 packets an
hour to my firewalls 'drop' list.

best regards
Dave

-- 
http://www.morgad.no-ip.info/index.html    gpg:0x64B5E037 
Distributed Proofreaders: http://www.pgdp.net
The NTP server pool http://www.ntp.pool.org

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.



Lynx friendly