?
Solved

Help Modifying some scripts.

Posted on 1997-09-19
9
Medium Priority
?
174 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
  • 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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
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 85

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 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