Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell script execution fails for Windows Failover Cluster monitoring #4

Open
brown257 opened this issue Aug 3, 2024 · 2 comments

Comments

@brown257
Copy link

brown257 commented Aug 3, 2024

Hello,

I am trying to install Windows Failover Cluster monitoring by carefully following each step indicated in this URL: https://github.com/zbx-sadman/WSFC. The problem is that when the powershell script is executed, the following error appears:

Import-Module : The specified module 'FailoverClusters' was not loaded because no valid module file was found in any
module directory.
At C:\Zabbix\scripts\wsfc.ps1:496 char:1

  • Import-Module -Name FailoverClusters -Verbose:$False -Cmdlet Get-*
  • CategoryInfo : ResourceUnavailable: (FailoverClusters:String) [Import-Module], FileNotFoundException
  • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Comman ds.ImportModuleCommand

Get-Cluster : The term 'Get-Cluster' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Zabbix\scripts\wsfc.ps1:500 char:16

  • $Clusters = Get-Cluster
  • CategoryInfo : ObjectNotFound: (Get-Cluster:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

WARNING: No cluster(s) availabile

I changed the user running the service, removing the LocalSystem and placing a computer administrator user and the result is the same. I have also changed in the wsfc.ps1 the path where the FailoverClusters module is located and the same message still appears. If I place the module in the directory where the script is the message changes that it cannot load the DLLs it needs for the module load.

Please I require your help to implement this monitoring.

Thank you.

@dreik
Copy link

dreik commented Aug 3, 2024

It really feels like that PowerShell on your server is a bit broken and/or you haven't installed required management modules. I.e. on Windows Server 2019 you'll have to install using following PowerShell command Install-WindowsFeature -name FailOver-Clustering -IncludeManagementTools
Another possible cause is that your env var $env:PSModulePath was overwritten by some reason, make sure it contains following paths:

  • C:\Program Files\WindowsPowerShell\Modules
  • C:\Windows\system32\WindowsPowerShell\v1.0\Modules

@brown257
Copy link
Author

brown257 commented Aug 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants