Ad Widget

Collapse

Monitoring firewall state on Windows?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benign
    Junior Member
    • Jun 2015
    • 9

    #1

    Monitoring firewall state on Windows?

    I know how to monitor the service itself, but how would you monitor the state of the firewall as it applies to individual profiles? (domain/private/public).
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I'm going to test this:

    UserParamater=win.advfirewall,netsh advfirewall show AllProfiles state | find /c "OFF"

    Any value > 0 is bad.

    Comment

    • benign
      Junior Member
      • Jun 2015
      • 9

      #3
      Originally posted by LenR
      I'm going to test this:

      UserParamater=win.advfirewall,netsh advfirewall show AllProfiles state | find /c "OFF"

      Any value > 0 is bad.
      I ended up making a simple powershell script for each firewall profile:

      $data = netsh advfirewall show domainprofile
      $data = $data[3]
      $data -Match "ON"

      created an item:
      system.run[powershell.exe -command c:\Zabbix_Agent\scripts\DomainFirewallStatus.ps1]

      and a trigger:
      {Test-Firewall-State:system.run[powershell.exe -command c:\Zabbix_Agent\scripts\DomainFirewallStatus.ps1].str(True)}=0

      The scripts have to be on the local machines. They run and return either True or False. If the trigger is not true, then the alert is triggered.

      Comment

      • alientm
        Member
        • Aug 2014
        • 51

        #4
        Can You step by step (maybe with screenshots) show how You to start monitoring windows firewall? How exactly does your script and where to write it, how to start script?

        Comment

        • LenR
          Senior Member
          • Sep 2009
          • 1005

          #5
          I've also learned that Windows will sometimes report false status using these methods. It appears on systems where firewall policy has been set locally and via GPO inconsistently and in systems with multiple nics with different firewall status.

          I'm not a Windows admin, I just have to listen to their complaints about Zabbix tests...

          Comment

          • alientm
            Member
            • Aug 2014
            • 51

            #6
            See here, maybe it will help. For me it is not



            https://www.reddit.com/r/nagios/comm...rewall_status/

            Comment

            • Denis_86
              Junior Member
              • Mar 2015
              • 22

              #7
              Windows Firewall State

              Windows Firewall State
              Windows Firewall State.zip

              Comment

              • pinguin123
                Member
                • Apr 2015
                • 52

                #8
                Originally posted by benign
                Itrigger:
                {Test-Firewall-State:system.run[powershell.exe -command c:\Zabbix_Agent\scripts\DomainFirewallStatus.ps1].str(True)}=0
                Apparently it doesn't work anymore for version 3.x. How should it look like in version 3.x?

                Comment

                • pinguin123
                  Member
                  • Apr 2015
                  • 52

                  #9
                  Solved. A wrong data type in "items" was selected.

                  Comment

                  • dtnetwork
                    Junior Member
                    • Dec 2016
                    • 1

                    #10
                    Originally posted by pinguin123
                    Solved. A wrong data type in "items" was selected.
                    Hi, whats item type choose?

                    Thanks

                    Comment

                    • frater
                      Senior Member
                      • Oct 2010
                      • 340

                      #11
                      https://share.zabbix.com/cat-app/fir...ndows-firewall
                      Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

                      Comment

                      Working...