Go to All Forums

Monitor Network Location Windows Server

Would it be possible to get a feature added to monitor the Network Location Category on Windows servers. 

We recently had an issue where the network interface came up but the Network Category became Public rather than DomainAuthenticated, this meant that although the server was showing up in S24 it was effectively down as the incorrect Firewall settings had been applied. 

It is logged in Event Viewer, Microsoft-Windows-NetworkProfile/Operational, and you can see the category applied to the interface. It can also be viewed using Powershell commands ie Get-NetConnectionProfile.

Ideally we would like an option to monitor NetworkCategory and provide a warning alert if NetworkCategory = Public or Private, and clear when NetworkCategory = DomainAuthenticated

Like (4) Reply
Replies (4)

Re: Monitor Network Location Windows Server

Hi Paul,

You can write a custom plugin to monitor the Network Category and set thresholds to be notified when there is a breach. Please refer our documentation to set up a plugin monitor.

Hope this helps. Let us know for questions, if any.

 

Regards

Mathangi

Like (0) Reply

Re: Re: Monitor Network Location Windows Server

Is it possible to get some help with this, the documentation doesn't seem to help me

Like (0) Reply

Re: Re: Re: Monitor Network Location Windows Server

Hi, Try something like in attachement.

Then in Site24x7 set the alerting if greater than 0 put state in Down or Warning as you want.

Script supposed you had one network connection on the server, if you have several, just filter on the Name.

 

Edit can't attach file so here is the code ot put in .ps1 file

 ====

 

 

Function Add-DataFunction Add-Data([string]$json,[string]$key,[string]$value,[bool]$isobj){    if($key -ne $null -and $value -ne $null)    {       if($json.Length -gt 0)        {          $json = $json -replace "(.*)}(.*)", '$1,$2'        }        else        {           $json = $json + "{"         }        if($isobj -eq $true)        {           $json = $json + [char]34 + $key + [char]34 + " : " + $value +"}"        }        else        {           $json = $json + [char]34 + $key + [char]34 + " : " + [char]34 + $value + [char]34 +"}"        }   }   return $json}
# Script Version$version = "1"
# Change here the plugin name, it will appears as is in Site24x7$displayname = "Network Profile State on "+$env:COMPUTERNAME
# We active the hearbeat$heartbeat = "True"
# We define units (%, numbers ...) for the datas we want to get$units = ""$units = Add-Data $units "GlobalState" "numbers"
# We get the rows$rows = Get-NetConnectionProfile
# We define information message$msg = ""$msg = "Network Profile State : "+ $rows.NetworkCategory
if ($rows.NetworkCategory -eq "DomainAuthenticated") {    # if network profile is DomainAuthenticated we set the state at 0 $data = "" $data = Add-Data $data "GlobalState" "0" } else { $data = "" $data = Add-Data $data "GlobalState" "1" }
# We feed the json with all needed values and return it$mainJson = ""$mainJson = Add-Data $mainJson "version" $version$mainJson = Add-Data $mainJson "data" $data $true$mainJson = Add-Data $mainJson "units" $units $true$mainJson = Add-Data $mainJson "heartbeat" $heartbeat$mainJson = Add-Data $mainJson "displayname" $displaynameif($msg.Length -gt 0){   $mainJson = Add-Data $mainJson "msg" $msg}
return $mainJson

 

Like (3) Reply

Re: Re: Re: Re: Monitor Network Location Windows Server

Greetings,

Thank you Julien for sharing the plugin script. We have further updated the script to suit Paul Freedman's requirement. Please find attached the plugin script networkcategory.zip. 

This script will send the GlobalState as an attribute. If GlobalState value is 0, there will be at least one network connection having the network category other than DomainAuthenticated; and the name of the connection profile will be in the message.

You can set GlobalState threshold equal to 0 and you can receive alerts when there is a network connection with network category other than DomainAuthenticated.

Hope this helps. Let us know for questions, if any, in the below thread.

 

Regards,

Hisham

Attachments
NetworkCategory.zip
Size: 0.98 KB
Like (1) Reply

Was this post helpful?