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

    Sending logs over Telegram

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 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.
    • 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?

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        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

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        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
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.