Ad Widget

Collapse

PowerShell script execution fails for Windows Failover Cluster monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brown257
    Junior Member
    • Aug 2024
    • 2

    #1

    PowerShell script execution fails for Windows Failover Cluster monitoring

    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.

  • Brambo
    Senior Member
    • Jul 2023
    • 245

    #2
    I don't know anything specific about that cluster script. What I do know is dat scripts execute by zabbix agent are run as "user" 'zabbix agent' I think it acually more a process but just for understanding.
    I run into this that I use a script to secury store credentials (export-clixml command) script worked fine running it from RDP session but failed when zabbix agent did this. Solution was to encrypt the credentials by using the zabbix agent.

    But now I looked at your git link, with lines like "Do not try import Zabbix v2.4 template to Zabbix pre v2.4. " And code update of 7 years ago I doubt this will work without any changes.
    But you didn't specify which zabbix version you are on...

    Comment

    • brown257
      Junior Member
      • Aug 2024
      • 2

      #3
      Thank you for the prompt response.
      Zabbix version is 6.4

      Comment

      Working...