Navigation

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

    Sending logs over Telegram

    General pfSense Questions
    2
    3
    348
    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.
    • R
      Ranko Kohime last edited by

      I wrote a very stupid little Python bot to send me a message over Telegram any time it detects that a host on my network is down, then I thought, why not include the logs from my appliances, too? And then it occurred to me to not try to re-invent the wheel, so I wanted to see if anyone else has worked on this, or knows of a project that already does this.

      Gitlab for aforementioned bot

      Assuming there is not already some project, here are some questions I have if I'm going to be doing this on my own:

      From Googling, it seems the way to get the system log is calling clog over SSH to pull in /var/log/system.log, which requires that the machine running the bot has root SSH access to the machine, as the log is owned and only accessible by root. Is this the best way, and are there other log files I may want to monitor?

      Gertjan 1 Reply Last reply Reply Quote 0
      • Gertjan
        Gertjan @Ranko Kohime last edited by Gertjan

        @Ranko-Kohime said in Sending logs over Telegram:

        Is this the best way,

        When you SSH into pfSense you are root (admin).
        But, you could use sudo if needed.
        Still, your script has to run as root to access root files that are not 'world' readable.

        @Ranko-Kohime said in Sending logs over Telegram:

        are there other log files I may want to monitor?

        Well, you should monitor what you find interesting.

        Keep in mind : https://forum.netgate.com/topic/146169/heads-up-logging-changes-clog-deprecated-plain-text-logs-newsyslog-rotation-in-next-snapshots

        R 1 Reply Last reply Reply Quote 2
        • R
          Ranko Kohime @Gertjan last edited by

          @Gertjan said in Sending logs over Telegram:

          When you SSH into pfSense you are root (admin).

          Funnily enough, I actually have a regular user account I use for creating my own hodge-podge VPN, which is restricted to port forwarding only. (I use sshuttle, which requires Python, and since pfSense doesn't have Python, I port forward to my NAS and then use sshuttle against the NAS)

          As for the removal of clog, thanks for the heads up.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Products

          • Platform Overview
          • TNSR
          • pfSense
          • Appliances

          Services

          • Training
          • Professional Services

          Support

          • Subscription Plans
          • Contact Support
          • Product Lifecycle
          • Documentation

          News

          • Media Coverage
          • Press
          • Events

          Resources

          • Blog
          • FAQ
          • Find a Partner
          • Resource Library
          • Security Information

          Company

          • About Us
          • Careers
          • Partners
          • Contact Us
          • Legal
          Our Mission

          We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

          Subscribe to our Newsletter

          Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

          © 2021 Rubicon Communications, LLC | Privacy Policy