Icinga / icinga-powershell-cluster

A collection of Cluster plugins for the Icinga Powershell Framework
GNU General Public License v2.0
5 stars 1 forks source link

Cluster Network - disabled NICs are not detected. They disappear and the check is still OK #24

Closed K0nne closed 3 years ago

K0nne commented 3 years ago

Hello,

today we tested a portion of the checks. While doing this we disabled a few NICs to see a state change in the plugin output. We tried to produce a "down" state. Our test object was the host 100001. Here its vNIC4 Interface was disabled. Instead of a state change the interface disappeared an the check was still OK:

Plugin-Ausgabe
[OK] Check package "Cluster Network Package" (Match All)
\_ [OK] Check package "Network Package" (Match All)
   \_ [OK] Check package "Interfaces Package (Network: SMBnet1)" (Match All)
      \_ [OK] 1100002 - vNIC4 State: Up
      \_ [OK] 1120004 - vNIC4 State: Up
      \_ [OK] 1120005 - vNIC4 State: Up
      \_ [OK] 4100001 - vNIC4 State: Up
      \_ [OK] 4100002 - vNIC4 State: Up
   \_ [OK] SMBnet1 Role: Cluster
   \_ [OK] SMBnet1 State: Up
\_ [OK] Check package "Network Package" (Match All)
   \_ [OK] Check package "Interfaces Package (Network: Management)" (Match All)
      \_ [OK] 1100001 - Team0 State: Up
      \_ [OK] 1100002 - Team0 State: Up
      \_ [OK] 1120004 - Team0 State: Up
      \_ [OK] 1120005 - Team0 State: Up
      \_ [OK] 4100001 - Team0 State: Up
      \_ [OK] 4100002 - Team0 State: Up
   \_ [OK] Management Role: Both
   \_ [OK] Management State: Up
\_ [OK] Check package "Network Package" (Match All)
   \_ [OK] Check package "Interfaces Package (Network: SMBnet2)" (Match All)
      \_ [OK] 1100001 - vNIC5 State: Up
      \_ [OK] 1100002 - vNIC5 State: Up
      \_ [OK] 1120004 - vNIC5 State: Up
      \_ [OK] 1120005 - vNIC5 State: Up
      \_ [OK] 4100001 - vNIC5 State: Up
      \_ [OK] 4100002 - vNIC5 State: Up
   \_ [OK] SMBnet2 Role: Cluster
   \_ [OK] SMBnet2 State: Up
LordHepipud commented 3 years ago

Hello and thank you for the feedback.

Could you please run these commands and check if the Network Interface which is deactivated is listed there?

icinga { Get-IcingaWindowsInformation -ClassName MSCluster_Network -Namespace 'Root\MSCluster'; };
icinga { Get-IcingaWindowsInformation -ClassName MSCluster_NetworkInterface -Namespace 'Root\MSCluster'; }

If they are not present during the WMI call, the plugin is unable to process them.

K0nne commented 3 years ago

In this call the NIC completely disappears if its deactivated:

icinga { Get-IcingaWindowsInformation -ClassName MSCluster_NetworkInterface -Namespace 'Root\MSCluster'; }

LordHepipud commented 3 years ago

Allright, we found the issue then. As this WMI space is not providing the data if the NIC is deactivated, we won't be able to add it's data into the plugin.

Is it still listed by simply using

Get-NetAdapter
K0nne commented 3 years ago

Yes, it is listed there with state "disabled".

LordHepipud commented 3 years ago

This only happens if the interface is manually disabled on the Windows machine. In case the cable is removed, it is displayed properly. We discussed this is the way to go, as it would be a lot of effort to fetch the state properly, as no cluster relation for disabled interfaces is present anymore, which would require us to manually map them in some way.