?
Solved

Help Modifying some scripts.

Posted on 1997-09-19
9
Medium Priority
?
172 Views
Last Modified: 2013-12-25
I downloaded some statistic script from http://acm.vt.edu/¨nisha/logscribe/
Now I nead som help modifying it.

I also like som statistic month by month that looks like the output from the stats By Day part. /Take a look at http://www2.crossnet.se/linkcenter/cgi-bin/logscribe/showlog.pl/?day

But I want it to make a stat by month like this:


January:  4 #### (30%)
February: 5 ##### (32%)
........
December  2 ###   (7%)


(But not with the character #. I wan't the same format as in the link abow.)
0
Comment
Question by:n94magho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 10

Expert Comment

by:kollegov
ID: 1830404
I made changes, but have no ability to check it well enough.
(no logs stats to check :(  )
Hope I do it accurate.
If you have file with logs, I'd like to have it
to check script carefully, or you can play with
mew one yourself to check it.

How can I send you file?
Changes are only in showlog.pl file, so I'd like to
e-mail it to you :)

------Virtual_Max-------
http://www.geocities.com/siliconvalley/lakes/8620


0
 

Author Comment

by:n94magho
ID: 1830405
Sorry for rejecting your answer. But I don't Know how to leave you my adress in some other way. My adress is mike@a201.ryd.student.liu.se. If it works good I'll be glad to give  you the points. I wounder about one thing. If I don't have to modify the makelog part. How can it work? The makelog opens a new file after 30 days. I thougt that I neded a new part in the makelog that only logged some info to another file during all months of the year...
0
 

Author Comment

by:n94magho
ID: 1830406
One more thing. I have modifyed something in the srcipt by my self, so could you please make some comment in the script about what's new??
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
LVL 10

Expert Comment

by:kollegov
ID: 1830407
I'll send you script in a few minutes :)
Mike, read carefully readme.txt file,
than open config.pl and change log length
from 30 days to 365

piece of script from config.pl

#------------------------------------#
# How many days do you want to log ? #
#------------------------------------#
$numofdays = 365;

Opps sorry I forgot to give you my email:

Virtual_Max@geocities.com
http://www.geocities.com/siliconvalley/lakes/8620

0
 
LVL 10

Expert Comment

by:kollegov
ID: 1830408
Just send you new one with modifications and
comments
search in text for "Kollegov" multiple changes places
and you will catch all changes.



0
 

Author Comment

by:n94magho
ID: 1830409
Everything workss perfectly, But I still like to use the $numofdays to be set to 30, thats why I thaught that the makelog neaded som changes. (Mabe it have to logg to two separate files. one th keep the track of visits / month. )
If you just help me with this I'll be more than hapy.

0
 
LVL 84

Expert Comment

by:ozo
ID: 1830410
It looks like makelog already saves the older than $numdays entrys in $oldlogfile,
So all you'd need to add in showlog is:
open(OLDLOG,"<$oldlogfile")||warn "can't open $oldlogfile $!";
while(<OLDLOG>){
          $months[(localtime(split[0]))[4]]++ if $_ ne "LOG-BEGIN\n";
}
close OLDLOG;

sub by_month{
  $highest=1;
  for(@months){
      $highest = $_ if $_ > $highest;
  }
 print "  <H2><U>Stats By Month</U></H2>\n";
 print "  <TABLE>\n";

  @monthnames=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
   foreach(@months){
      $barsize=int(($_ * 250) / $highest);
      $showpercent = sprintf("%.3f",($_ / $nooflines) * 100);
$key = shift(@montnames);
 print<<EOF;
   <TR>
    <TH ALIGN=RIGHT>$key:</TH>
    <TD NOWRAP ALIGN=LEFT>
     <IMG BORDER=1 SRC="$gifdirurl/dot1.gif" HEIGHT=10 WIDTH=$barsize>
     <B>$_</B> <I> $showpercent</I>
    </TD>
   </TR>
EOF
 }
 print "  </TABLE>\n";
 print "  <P><HR><P>\n";
}

  }
}
foreach

0
 
LVL 10

Accepted Solution

by:
kollegov earned 1200 total points
ID: 1830411
Mike, I found errors in edition you send me.

0
 

Author Comment

by:n94magho
ID: 1830412
Sorry! For taking so much of your time.
Now everything works fine....
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question