Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: zolf on January 22, 2011, 08:04:35 am

Title: SARG report issue
Post by: zolf on January 22, 2011, 08:04:35 am

Hi there,

i have setup SARG report on my zentyal firewall.but i get these IPs in the report. i dont understand why the report shows me public ip instead on my local machine ip which is in the range 192.168.0.100 to 200.please help.

cheers
Zolf
Title: Re: SARG report issue
Post by: zolf on January 23, 2011, 07:14:20 am

please help
Title: Re: SARG report issue
Post by: zolf on January 30, 2011, 11:01:25 am

anybody there to help me
Title: Re: SARG report issue
Post by: adr14n on January 30, 2011, 08:06:44 pm
Verify your /etc/sarg/sarg.conf file. If you're using dansgardian replace access log file from squid.log to dansgardian.log

I hope that is helpful
Title: Re: SARG report issue
Post by: zolf on January 31, 2011, 06:57:45 am

thanks a lot
Title: Re: SARG report issue
Post by: arun on February 01, 2011, 12:37:56 pm
I am long user of SARG, which is a very good for Squid reporting.

Recently I have installed "light squid", which is equally good and working well with Zentyal, you may also try ..

http://lightsquid.sourceforge.net/

Arun
Title: Re: SARG report issue
Post by: ebox-steve on February 11, 2011, 01:46:35 pm
Hi Arun and all,

Can you please teach me of how to step-by-step install the light squid add-ons? And maybe with sqstat if you familiar with :-)

Maybe one day zentyal will have its own function similar to those squid add-ons, I hope.
Title: Re: SARG report issue
Post by: Sam Graf on February 11, 2011, 02:26:27 pm
I think extended reporting services in Zentyal will stay focused in the subscription cloud services. That's just my guess. It makes sense for an SaaS product like Zentyal to work that way, I think, to not only have a source of revenue for the company but also to offer consolidated, centralized management services via the cloud.
Title: Re: SARG report issue
Post by: arun on February 14, 2011, 08:18:32 am
I do agree that the SaaS products should be there as a source of revenue for the company, but it should be in the side like backups and remote expert support etc...

Setting up lightsquid is very easy as follows (largely taken from its docs)

Step 1 : Required software - Perl, http server (Apache, lighthttpd, etc), Squid, Cron (most of which are already installed, so no need to do anything)

Step 2 : download lightsquid from http://lightsquid.sourceforge.net

Step 3 :Extract lightsquid.tgz into any folder  (handle the version number added to the file name)
            #cd /var/www/htdocs/
            #mkdir lightsquid
            #cd lightsquid
            #tar -xzf lightsquid.tgz

Step 4 : set 'executable' flag for scrip
            #chmod +x *.cgi
            #chmod +x *.pl

Step 5 : change owner (this step may not be required)
           #chown -R root:root *
           #(where apache = httpd user)

Step 6 : Configure your Apache server
           Edit Apache configuration file, at the end of the configuration file add the following code .cgi files must execute as CGI scrip
           /etc/apache2/apache2.conf
           <Directory "/var/www/lightsquid">
              Options +ExecCGI
            AddHandler cgi-script .cgi
           AllowOverride All
          </Directory>

Step 7 :  Edit lightsquid.cfg  (file is self explanatory )

Step 8 :#run check-setup.pl
              if all done try next step
              else check config file.

Step 9 :Try run lightparser.pl
             if everything is ok no messages will be produced

             parse old statistic (to generate report from old log)
             ./lightparser.pl access.log.1.{gz|bz2}
             ./lightparser.pl access.log.2.{gz|bz2}
             ./lightparser.pl access.log.3.{gz|bz2}

Step 10 : All done, now check the report

              Using your favorite browser enter http://<ip address where we live>/lightsquid/
Optional :

Step 11 : Edit following file for better reports

If you want GROUP reports - edit group.cfg
format:
     esl     01      SysAdmin
     karlos  01      SysAdmin
     Ivanov  02      Developer
     Ivanov2 02      Developer
     Petrov  03      Commerial

If you want use REALNAME - edit realname.cfg
format:
     arun   Arun Shrimali
     esl     Sergey Erokhin
     karlos  Super User1

Step 12 : Automate the process

Setup crontab to run lightparser once per hour, add the following line
#crontab -e
This example will execute parser every 20 minutes
*/20 * * * * /var/www/htdocs/lightsquid/lightparser.pl today

if you have small log and fast machine, you may run lightparser with smaller delay
warning not set interval less 10 min

That's all,
Best wishes
Arun
Title: Re: SARG report issue
Post by: ebox-steve on February 18, 2011, 02:52:34 pm
Hi Arun,

Thank your for providing the steps. As you have mentioned it earlier, that the steps you provided is largely taken from Lightsquid documentation, I have tried following the steps but I'm stuck until step 5.

Below is the list of the steps I have done and their notes:
Step 1: As for perl, squid, and cron, I think they're all there. While "http server", ie. Apache, I have to think and pause a bit here. Zentyal, mine is version 2.0-3, comes with a web-based administration interface, so there must be a web server already installed and setup. I tried to access http://localhost and it replied "It works".
Step 2: Download is fine, no problem.
Step 3: However, upon looking the folder "/var/www/htdocs/", it's just not there. So I tried to install the module "Web Server", as it was not initially installed, because I did not plan to use this machine as a web server, only gateway and infrastucture. After that I turned on the module, setup the configuration as follow:
Listening port = 80
Listening SSL port = disabled
Enable per user public_html = unchecked (unticked)
Virtual Host = Not setting up any
Then saved the changes.
I thought by now I should have the folder "/var/www/htdocs/", but it's still not there yet.
I browse trough the forum, and found a dicussion mentioning that the document root is "/var/www" without the "htdocs". So I thought maybe this is the one, and extracted the "lightsquid-1.8.tgz" there.
Step 4: Done. All are fine.
Step 5: Change owner to where apache = httpd user. I don't understand this. How do I identify any httpd user? What is the meaning of this?

Summary:
1. Now I have the "Web Server" module installed and configured. Hopefully I'm configuring it the right way. Sorry, actually I'm not configuring anything as I only using the default parameter value as mentioned on my note on step 3 above.
2. Folder "/var/www/htdocs/" is not available. Do I need to create this myself anyway?
3. The file "lightsquid-1.8.tgz" is currently extraced into the folder "/var/www", with executable flag for *.cgi and *.pl is set.

Please advise on how should I continue the step.
Title: Re: SARG report issue
Post by: ebox-steve on February 21, 2011, 08:38:20 am
Dear Arun,

It's working already. Thank you for your help.
Title: Re: SARG report issue
Post by: B_Khuwera on October 15, 2011, 01:50:10 pm
Hi Arun

I try to follow your procedure, but got stuck on Step 8 :#run check-setup.pl, it gave this warning
"sh check-setup.pl
Warning: unknown mime-type for "LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL\n\n" -- using "application/octet-stream"
Error: no such file "LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL\n\n"
check-setup.pl: 5: Syntax error: "(" unexpected

Please what should i do

Thanks
Title: Re: SARG report issue
Post by: arun on October 20, 2011, 06:43:26 am
Dear Khuwere,

pl confirm that you have followed the step no. 3 perfectly ....
Its very simple to setup lightsquid

Arun
Title: Re: SARG report issue
Post by: B_Khuwera on October 23, 2011, 06:40:44 pm
Dear Arun ..

Thx for your reply, I try to set it up again tonight after reinstall the server, ..
somehow i change the log setting on squid and dansguardian .. and hit the update button for core 2.2.3 ... and both my sarg and calamaris are acting weird . crazy load on prosesor and huge log .. hahaha.. that's why i need some other reporting app like lightsquid... as my curiousity needs to know ..
i do not think its the core update .. just my stupidity .. haha

anyway, i set it up not using htdocs ..
i read ebox-steve post.. extract directly under /var/www/ ... cause document root is /var/www..
i tought i can use a symlink like i use with sarg and calamaris .. something like /var/www/calamaris and pointing to /home/it/calamaris
and i do not activate webserver module .. but i still can access sarg report and calamaris as cron job updates the result.

i report to you for the result .. after reinstalling the server tonight

Thanks n Regards

Khuwera
Title: Re: SARG report issue
Post by: B_Khuwera on October 24, 2011, 12:38:42 am
dear arun

i do step 3 exactly like you write it .. create /var/www/htdocs  .. because as ebox-steve said .. is not there...
i extract lightsquid-1.8.tgz under /var/www/htdocs/lightsquid .. change owner from 501:staff to root:root, change *.cgi and *.pl to +x
i type sudo sh check-setup.pl .. same thing ..
Warning: unknown mime-type for "LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL\n\n" -- using "application/octet-stream"
Error: no such file "LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL\n\n"
check-setup.pl: 5: Syntax error: "(" unexpected

Regards
Title: Re: SARG report issue
Post by: B_Khuwera on October 24, 2011, 12:57:14 am
dear Arun

OK .. its working now .. i am dumb to run it with sh command .. it should be "perl check-setup.pl" ..

Thanks n Regards

Khuwera

Title: Re: SARG report issue
Post by: B_Khuwera on October 24, 2011, 10:31:56 pm
HI Arun ..

lightsquid is working but again manualy.. i setup the cron job but nothing happen .. but if i run it from cli .. its working fine ...
even i activate the cron log .. and there's records saying the cron was running .. but when i check on report folder under lightsquid .. its still not change ..
just the result from the lightparser.pl command i do in cli.

please help

Regards