Announcement

Collapse
No announcement yet.

Omit UFW Logging From Dmesg?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Omit UFW Logging From Dmesg?

    Any time I type dmesg it brings up a ton of logging info from UFW. Is there some way to disable UFW from logging info in to dmesg?
    OS: Kubuntu 12.10/Windows 8
    CPU: Intel Core i7 2600K
    Motherboard: Gigabyte GA-Z77X-UD5H
    Memory: 2x4GB Corsair Dominator
    Graphics Card: MSI R7770
    Monitor: Dell 2208WFP
    Mouse: Mionix NAOS 5000
    PSU: Corsair 520HX
    Case: Thermaltake Mozart TX
    Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
    Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

    #2
    This should work
    Code:
    sudo ufw logging off
    Run
    man ufw
    for all options.
    Klaatu Barada Nikto

    Comment


      #3
      Originally posted by 67GTA View Post
      This should work
      Code:
      sudo ufw logging off
      This should work fine, if you don't wish to log firewall messages.

      If you wish to keep firewall logging enabled, but only exclude them from dmesg output, you can (for example) create an alias like:
      alias dmsg='dmesg | grep -v "\[UFW"'
      in ~/.bashrc, after which you can use the command 'dmsg' to run dmesg without ufw log messages
      For already started shells, you need to source ~/.bashrc for the alias to take effect.

      Comment


        #4
        @67GTA, man whatever is not the end all be all answer. In fact more often then not I feel this is a horrible answer unless you are dealing with a linux guru, which I am not. Simply put the manual output is often times using terms or offering options I don't understand. Now I don't mind doing a little googleing/searching but I/anyone for that matter, can only be expected to do so much googleing.Furthermore, at a glance I see nothing in the ufw manual that gives an answer like what kubicle provided.


        Originally posted by kubicle View Post
        This should work fine, if you don't wish to log firewall messages.

        If you wish to keep firewall logging enabled, but only exclude them from dmesg output, you can (for example) create an alias like:
        alias dmsg='dmesg | grep -v "\[UFW"'
        in ~/.bashrc, after which you can use the command 'dmsg' to run dmesg without ufw log messages
        For already started shells, you need to source ~/.bashrc for the alias to take effect.
        Thanks this is more along the lines of what I was looking for, but is it possible to do the opposite? I would prefer to use dmesg with out the ufw logging and have ufw logging in dmsg.
        OS: Kubuntu 12.10/Windows 8
        CPU: Intel Core i7 2600K
        Motherboard: Gigabyte GA-Z77X-UD5H
        Memory: 2x4GB Corsair Dominator
        Graphics Card: MSI R7770
        Monitor: Dell 2208WFP
        Mouse: Mionix NAOS 5000
        PSU: Corsair 520HX
        Case: Thermaltake Mozart TX
        Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
        Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

        Comment


          #5
          I thought it was pretty simple. Copy/paste and hit "enter". I only gave you the man info in case you "wanted" to learn more. Kubicle's way of doing it is the guru way. I could have made it more difficult by explaining why dmesg reports the ufw logs, and about kernel buffer ring/rsyslog. An alternative way without totally disabling ufw logs, is to edit /etc/rsyslog.d/20-ufw.conf and uncomment the last line. Then you can still have ufw logs without the dmesg output. If you don't understand something, ask, and we can teach you.
          Klaatu Barada Nikto

          Comment


            #6
            Originally posted by 67GTA View Post
            An alternative way without totally disabling ufw logs, is to edit /etc/rsyslog.d/20-ufw.conf and uncomment the last line.
            This will stop rsyslog from logging the messages to other log files except ufw.log (so probably a good idea if you have a busy firewall), but shouldn't actually change 'dmesg' output (dmesg should still output all messages in the ring buffer).

            Originally posted by Xplorer4x4 View Post
            I would prefer to use dmesg with out the ufw logging and have ufw logging in dmsg.
            Probably doable, but a good rule of thumb is to leave system commands as they are, unless there is a really, really, really good reason not to do so...and use your own aliases if you wish to tinker with their functionality (and dmsg is shorter to type than dmesg )...you can also set up an alias to output *only* ufw messages with:
            alias umsg='dmesg | grep "\[UFW"'

            Comment


              #7
              Originally posted by 67GTA View Post
              I thought it was pretty simple. Copy/paste and hit "enter".
              Yeah, I don't see where I said this was the complicated part.

              I only gave you the man info in case you "wanted" to learn more.
              My point still stands, people are all to quick to say "man insertsomethinghere" to newbies when I generally find the man page is going to go right over there head, or be way to much reading in some cases.

              Kubicle's way of doing it is the guru way.
              Perhaps but it is explained simple enough and it focuses on one single aspect which is aliases.

              If you don't understand something, ask, and we can teach you.
              Noted and appreciated! I feel I came off a bit harsh on my last post, maybe because I been under the weather. I still stand firm in regards to my point, and I wasn't trying to single you out per say, but just passing along my feelings on the manual aspect. It can be a useful tool at times, but far to often, I feel things are poorly explained or to technical for the new user and even the average(?) linux user in my case.
              OS: Kubuntu 12.10/Windows 8
              CPU: Intel Core i7 2600K
              Motherboard: Gigabyte GA-Z77X-UD5H
              Memory: 2x4GB Corsair Dominator
              Graphics Card: MSI R7770
              Monitor: Dell 2208WFP
              Mouse: Mionix NAOS 5000
              PSU: Corsair 520HX
              Case: Thermaltake Mozart TX
              Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
              Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

              Comment

              Working...
              X