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

    Sarg - change output_dir

    Scheduled Pinned Locked Moved pfSense Packages
    9 Posts 2 Posters 3.4k 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.
    • F
      farmerjohn
      last edited by

      I'm running nanobsd on a 2GB CF with 4GB ram.  my squid logs are stored in ram (var/squid/logs) and I would like to store the sarg reports in ram as well.  I did this:

      mkdir /var/sarg-reports

      I then loaded the sarg.conf file via the web (diagnostics -> edit file) and changed the output_dir line to:

      output_dir = /var/sarg-reports

      I saved and ran sarg -x and new reports were generated to the new location (var/sarg-reports),  but at the top of the next hour, the new hourly report was saved to the old location.  I checked the config file and the "output_dir" had changed back to the old location.  how can I make it so sarg permanently saves reports to /var/sarg-reports?

      thanks.

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

        @farmerjohn:

        how can I make it so sarg permanently saves reports to /var/sarg-reports?

        edit /usr/local/pkg/sarg.template file and save config again.

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

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • F
          farmerjohn
          last edited by

          ok - that worked for saving to /var/sarg-reports.  but when I go to "view reports" sarg is still reading from the old location.  I deleted the old files:

          rm -rf /usr/local/sarg-reports/*

          and ran a force update, but am getting this from "view report"

          Error: Could not find report index file.
          Check and save sarg settings and try to force sarg schedule.

          the new reports and index.html are in the new location, but sarg is not looking there.  How can I point sarg to look to the new location?

          thanks.

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

            @farmerjohn:

            The new reports and index.html are in the new location, but sarg is not looking there.  How can I point sarg to look to the new location?

            you can change sarg_frame.php and sarg.inc or create a symlink on /usr/local/

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

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • F
              farmerjohn
              last edited by

              @marcelloc:

              you can change sarg_frame.php and sarg.inc or create a symlink on /usr/local/

              I made the change to sarg_frame.php before reading this post and everything is working ok.

              Since everything is working well, do I still need to make changes in sarg.inc?  if so, what line(s)?

              thanks.

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

                @farmerjohn:

                Since everything is working well, do I still need to make changes in sarg.inc?  if so, what line(s)?

                It's up to you, the inc file has references to the /usr/local/sarg-reports

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

                Help a community developer! ;D

                1 Reply Last reply Reply Quote 0
                • F
                  farmerjohn
                  last edited by

                  everything working well, but when I reboot, /var/sarg-reports is not being created.  I added /var/sarg-repports in sarg.inc:

                  #check dirs
                  $dirs=array("/var/sarg-reports","/usr/local/sarg-reports","/usr/local/www/sarg-images","/usr/local/www/sarg-images/temp");
                  foreach ($dirs as $dir)
                  if (!is_dir($dir))
                  mkdir ($dir,0755,true);

                  what should I do to create "/var/sarg-reports" on a reboot?

                  thanks.

                  1 Reply Last reply Reply Quote 0
                  • F
                    farmerjohn
                    last edited by

                    i added this line in /etc/rc.embedded:

                    /bin/mkdir -p /var/sarg-reports

                    /var/sarg-reports is now created on reboot.

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

                      Thanks for the feedback, I'll include this forder check before boot check to avoid this errors on embedded systems.

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

                      Help a community developer! ;D

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