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

Mail report command line output not working right

Scheduled Pinned Locked Moved pfSense Packages
6 Posts 3 Posters 1.3k 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.
  • D
    digitalgeek
    last edited by Oct 20, 2017, 3:23 PM

    Hi,

    I'm having a problem with command outputs using mail report. I've got the Traffic Totals package installed and when I enter "vnstat -i em0" into the command line under pfSense>Diagnostics, it provides the expected output. I setup a scheduled email using the mail reports package. When I test my mailreport config using the "Send" button I get an email with the same info that the command line gave me and it seems to work correctly. I have it scheduled to email me every day but the scheduled emails just say "Command output: WHAT_I_NAMED_IT (vnstat -i em0)" with nothing after that. Just a blank email. Am I missing something? Currently running 2.4 on a custom build using intel cards. Upgraded from 2.3.4. I can't find a log anywhere but maybe I'm not looking in the right place and I probably need to check the logs as soon as the scheduled email happens. Any suggestions would be helpful.

    Thanks for taking the time.

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Oct 20, 2017, 5:07 PM

      Use the whole path to the command:

      /usr/local/bin/vnstat -i em0
      

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • D
        digitalgeek
        last edited by Oct 20, 2017, 11:14 PM

        That was it! Thanks a bunch. I even saw the notice in the UI about using the full path and I guess it just didn't click.

        1 Reply Last reply Reply Quote 0
        • M
          miquim
          last edited by Oct 23, 2017, 8:00 PM

          i have the same problem, the test mail in advanced settings works but on mailreport not work with this comand

          /usr/bin/grep /bin/date -v-1d "+%Y-%m-%d" /var/squidGuard/log/block.log | /usr/bin/grep -v in-addr

          I am using pfsense 2.4 and its works on comand line and with pfsense 2.3 before I updated to 2.4

          if any one can help me.

          Tks

          1 Reply Last reply Reply Quote 0
          • J
            jimp Rebel Alliance Developer Netgate
            last edited by Oct 23, 2017, 8:07 PM

            @miquim:

            i have the same problem, the test mail in advanced settings works but on mailreport not work with this comand

            /usr/bin/grep /bin/date -v-1d "+%Y-%m-%d" /var/squidGuard/log/block.log | /usr/bin/grep -v in-addr

            I am using pfsense 2.4 and its works on comand line and with pfsense 2.3 before I updated to 2.4

            That box isn't meant for complex shell commands, odds are something is getting lost along the way or changed/escaped in an unexpected manner.

            Make a shell script (e.g. /root/mystuff.sh), make it executable (chmod u+x /root/mystuff.sh) and then run that script for the report instead

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • M
              miquim
              last edited by Oct 25, 2017, 7:21 PM

              @jimp:

              @miquim:

              i have the same problem, the test mail in advanced settings works but on mailreport not work with this comand

              /usr/bin/grep /bin/date -v-1d "+%Y-%m-%d" /var/squidGuard/log/block.log | /usr/bin/grep -v in-addr

              I am using pfsense 2.4 and its works on comand line and with pfsense 2.3 before I updated to 2.4

              That box isn't meant for complex shell commands, odds are something is getting lost along the way or changed/escaped in an unexpected manner.

              Make a shell script (e.g. /root/mystuff.sh), make it executable (chmod u+x /root/mystuff.sh) and then run that script for the report instead

              I did this but when i test with Send Now buttom nothing hapen. I tryed exclude the comand and select a log and again don't work.
              I tryed to put simple```
              /bin/echo teste

              
              what i can try now?
              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received