Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Sarg package for pfsense

    Scheduled Pinned Locked Moved pfSense Packages
    467 Posts 99 Posters 563.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • marcellocM
      marcelloc
      last edited by

      @ck42:

      Not entirely following you by this suggestion.  But I think you are wanting the output of this from?
      sarg -x export LC_ALL=C &&

      export LC_ALL=C && sarg -x

      Treinamentos de Elite: http://sys-squad.com

      Help a community developer! ;D

      1 Reply Last reply Reply Quote 0
      • C
        ck42
        last edited by

        @marcelloc:

        @ck42:

        Not entirely following you by this suggestion.  But I think you are wanting the output of this from?
        sarg -x export LC_ALL=C &&

        export LC_ALL=C && sarg -x

        Here we go:

        $ export LC_ALL=C && sarg -x
        SARG: Init
        SARG: Loading configuration from /usr/local/etc/sarg/sarg.conf
        SARG: Chaining IP resolving module "dns"
        SARG: Loading exclude host file from: /usr/pbi/sarg-i386/etc/sarg/exclude_hosts.conf
        SARG: Loading exclude file from: /usr/pbi/sarg-i386/etc/sarg/exclude_users.conf
        SARG: Reading host alias file "/usr/pbi/sarg-i386/etc/sarg/hostalias"
        SARG: List of host names to alias:
        SARG: Deleting temporary directory "/tmp/sarg"
        SARG: Parameters:
        SARG:           Hostname or IP address (-a) = 
        SARG:                    Useragent log (-b) = 
        SARG:                     Exclude file (-c) = /usr/pbi/sarg-i386/etc/sarg/exclude_hosts.conf
        SARG:                  Date from-until (-d) = 
        SARG:    Email address to send reports (-e) = 
        SARG:                      Config file (-f) = /usr/local/etc/sarg/sarg.conf
        SARG:                      Date format (-g) = USA (mm/dd/yyyy)
        SARG:                        IP report (-i) = No
        SARG:             Keep temporary files (-k) = No
        SARG:                        Input log (-l) = /var/squid/logs/access.log
        SARG:               Resolve IP Address (-n) = Yes
        SARG:                       Output dir (-o) = /usr/local/sarg-reports/
        SARG: Use Ip Address instead of userid (-p) = Yes
        SARG:                    Accessed site (-s) = 
        SARG:                             Time (-t) = 
        SARG:                             User (-u) = 
        SARG:                    Temporary dir (-w) = /tmp/sarg
        SARG:                   Debug messages (-x) = Yes
        SARG:                 Process messages (-z) = No
        SARG:  Previous reports to keep (--lastlog) = 0
        SARG: 
        SARG: sarg version: 2.3.9 Sep-21-2014
        SARG: Loading User table: /usr/pbi/sarg-i386/etc/sarg/usertab.conf
        SARG: Reading access log file: /var/squid/logs/access.log
        SARG: Records in file: 1042, reading: 0.00%
        SARG:    Records read: 1042, written: 1042, excluded: 0
        SARG: Squid log format
        SARG: Period: 2015 Feb 04
        SARG: File /usr/local/sarg-reports/2015Feb04-2015Feb04 already exists, moved to /usr/local/sarg-reports/2015Feb04-2015Feb04.2
        SARG: Sorting log /tmp/sarg/0.user_unsort
        SARG: Making file: /tmp/sarg/0
        SARG: Sorting log /tmp/sarg/1.user_unsort
        SARG: Making file: /tmp/sarg/1
        SARG: Sorting log /tmp/sarg/2.user_unsort
        SARG: Making file: /tmp/sarg/2
        SARG: Sorting log /tmp/sarg/3.user_unsort
        SARG: Making file: /tmp/sarg/3
        SARG: Sorting log /tmp/sarg/4.user_unsort
        SARG: Making file: /tmp/sarg/4
        SARG: Sorting log /tmp/sarg/5.user_unsort
        SARG: Making file: /tmp/sarg/5
        SARG: Sorting log /tmp/sarg/6.user_unsort
        SARG: Making file: /tmp/sarg/6
        SARG: (repday) Cannot open log file /usr/local/sarg-reports/2015Feb04-2015Feb04/5/d5.html
        SARG: Records in file: 1042, reading: 100.00%
        
        1 Reply Last reply Reply Quote 0
        • KOMK
          KOM
          last edited by

          OK, making progress.  Sarg seems to be one of the more fragile packages.  If you happen to select the wrong report options or report to generate, it won't work.  Here is what I use and it seems to work OK:

          sarg.png
          sarg.png_thumb

          1 Reply Last reply Reply Quote 0
          • C
            ck42
            last edited by

            KOM: That's pretty odd that something like the chosen report selection is causing this…but that was issue!  :o
            Is this a bug or is this something that is out of Sarg's control?

            BTW: Thank you both, KOM and marcelloc!!

            1 Reply Last reply Reply Quote 0
            • KOMK
              KOM
              last edited by

              Is this a bug or is this something that is out of Sarg's control?

              Probably a bug in the pfSense Sarg package.  Sarg is currently at 2.3.9 while the pfSense package is 2.3.6 so it's 1.5 years older, and as far as I know it's always acted funky like that.  Pick the wrong report and the whole thing falls over.

              Glad to hear you got it working.

              1 Reply Last reply Reply Quote 0
              • C
                Cino
                last edited by

                looks like its using 2.3.9 on 2.2

                https://github.com/pfsense/pfsense-packages/blob/master/pkg_config.10.xml

                <depends_on_package_pbi>sarg-2.3.9-##ARCH##.pbi</depends_on_package_pbi>

                I haven't downloaded the package myself yet on 2.2

                1 Reply Last reply Reply Quote 0
                • KOMK
                  KOM
                  last edited by

                  I must have been looking at my 2.1.5 box.

                  1 Reply Last reply Reply Quote 0
                  • marcellocM
                    marcelloc
                    last edited by

                    The only manual fix I had to do on my 2.2 labs was the manual symlink to fix pbi mess.

                    Treinamentos de Elite: http://sys-squad.com

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User
                      last edited by

                      @KOM:

                      OK, making progress.  Sarg seems to be one of the more fragile packages.  If you happen to select the wrong report options or report to generate, it won't work.  Here is what I use and it seems to work OK:

                      Hi, I can't get Sarg to produce any report, not even with these settings. Any idea ?
                      Realtime works fine thought

                      I got one Report in the list, which is broken, from last year when I tried it once. How can I delete this report and strat over new ?

                      1 Reply Last reply Reply Quote 0
                      • marcellocM
                        marcelloc
                        last edited by

                        @Satras:

                        I got one Report in the list, which is broken, from last year when I tried it once. How can I delete this report and strat over new ?

                        Did you tried to remove old reports via console/ssh ?

                        Treinamentos de Elite: http://sys-squad.com

                        Help a community developer! ;D

                        1 Reply Last reply Reply Quote 0
                        • T
                          tux
                          last edited by

                          I've been digging sarg codes these past days. I tried hacking the template which overrides any changes on the sarg.conf file.  I hope we can point the directory of squid rather than have it fixed directory

                          1 Reply Last reply Reply Quote 0
                          • marcellocM
                            marcelloc
                            last edited by

                            @tux:

                            rather than have it fixed directory

                            Do you mean /usr/local/sarg-reports ?

                            Sarg package needs this to "jail" report access permissions on pfsense gui.

                            Treinamentos de Elite: http://sys-squad.com

                            Help a community developer! ;D

                            1 Reply Last reply Reply Quote 0
                            • T
                              tux
                              last edited by

                              No, I mean the sarg.template file. Since whenever there is a change in the config(on the webconfig) it is overridden by the template.  So I changed the access log path.  Then I also tried creating a folder on a separate drive and symlinked to the default sarg-reports folder but it was a fail. Hope we can configure the path of the access log and same for where to store sarg reports.

                              1 Reply Last reply Reply Quote 0
                              • S
                                spiritbreaker
                                last edited by

                                Hi marcelloc,

                                i figured out that my sarg dont rotate access.log file. I got a 21GB logfile and wonder why my reports takes so long  ;D.

                                Log: php: /pkg_edit.php: Sarg: force refresh now with -d date +%d/%m/%Y args, compress(on) and rotate action after sarg finish.

                                But i saw only cache.log seams to be rotated.

                                If i use the rotation settings on proxy server tab it works…..but then i have no sarg reports over long period ()eg. 30 days).

                                Versions:

                                PfSense 2.1.5 (i386)

                                squid3 3.1.20 pkg 2.1.2
                                squidguard 1.4_4 pkg v.1.9.6
                                havp 0.91_1 pkg v1.05
                                sarg 2.3.6_2 pkg v.0.6.3
                                Lightsquid  1.8.2 pkg v.2.33

                                thanks

                                PS: maybe lightsquid prevent sarg from rotating...so i temporary disabled automatic reports in lightsquid.

                                Pfsense running at 11 Locations
                                -mobile OPENVPN and IPSEC
                                -multiwan failover
                                -filtering proxy(squidguard) in bridgemode with ntop monitoring

                                1 Reply Last reply Reply Quote 0
                                • marcellocM
                                  marcelloc
                                  last edited by

                                  thanks for the feedback, I'll take a look on rotate call done by sarg.

                                  what pfsense version are you using?

                                  Treinamentos de Elite: http://sys-squad.com

                                  Help a community developer! ;D

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    spiritbreaker
                                    last edited by

                                    hi,

                                    what pfsense version are you using?

                                    PfSense 2.1.5 (i386)

                                    Pfsense running at 11 Locations
                                    -mobile OPENVPN and IPSEC
                                    -multiwan failover
                                    -filtering proxy(squidguard) in bridgemode with ntop monitoring

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      djpeach310
                                      last edited by

                                      Hi I am new to pfsense and i was able to figure out IP sec vpn but i can not get the reports to work nor can I get the realtime to show any dans names.
                                      Can any one help me?
                                      I am running the latest version of pfsense.

                                      1 Reply Last reply Reply Quote 0
                                      • marcellocM
                                        marcelloc
                                        last edited by

                                        @djpeach310:

                                        Hi I am new to pfsense and i was able to figure out IP sec vpn but i can not get the reports to work nor can I get the realtime to show any dans names.
                                        Can any one help me?
                                        I am running the latest version of pfsense.

                                        Maybe you forgot to enable logging on squid settings.

                                        Treinamentos de Elite: http://sys-squad.com

                                        Help a community developer! ;D

                                        1 Reply Last reply Reply Quote 0
                                        • W
                                          worldfirst
                                          last edited by

                                          Hi,

                                          My goal with Sarg is to create Squid's daily reports. I have logging and logging rotation both enabled on Squid. My question is why Sarg doesn't show any reports for the previous day (with -d date -v-1d +%d/%m/%Y extra args) even though I definitely have yesterday's reports in /var/squid/logs. Is it because of Squid's own logging rotation feature? Do I need to turn it off? Or is it because of 60 minutes restriction on "Find Limit" option? I'm asking this because Sarg easily creates daily reports with -d date +%d/%m/%Y extra args.

                                          I'm using pfSense 2.2-RELEASE (amd64) with Sarg package 2.3.9 pkg v.0.6.4. Enabled Sarg report options are: 1, 5-10, 13-16.

                                          Thank you!

                                          1 Reply Last reply Reply Quote 0
                                          • N
                                            Nachtfalke
                                            last edited by

                                            I had a look in the sarg.conf file when I was looking for somthing other and I found that the configuration there only points to the actual access.log file.

                                            
                                            access_log /var/log/squid/access.log
                                            
                                            

                                            So I assume when squid rotates your logs then sarg cannot analyze the logs form access.log.1.
                                            I did some research and found out that since some newer version of sarg (2.3?) - which is installed on pfsense - there is the possibility to set a "*" so sarg analyzes more logfiles.

                                            
                                            access_log /var/log/squid/access.log*
                                            
                                            

                                            Source:
                                            http://sourceforge.net/p/sarg/discussion/363374/thread/e2e10ffb/

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.