尝试使用 sensu-install 时失败,因为它找不到 Gem/Ruby:
C:\opt\sensu\bin\sensu-install.bat -p sensu-plugins-windows:0.0.10
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] provided Sensu plugins: ["sensu-plugins-windows:0.0.10"]
[SENSU-INSTALL] compiled Sensu plugin gems: ["sensu-plugins-windows:0.0.10"]
[SENSU-INSTALL] determining if Sensu plugin gem 'sensu-plugins-windows:0.0.10' is already installed ...
[SENSU-INSTALL] gem list -i sensu-plugins-windows --version '0.0.10'
[SENSU-INSTALL] Sensu plugin gem 'sensu-plugins-windows' has not been installed
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-windows:0.0.10"]
[SENSU-INSTALL] installing Sensu plugin gem 'sensu-plugins-windows:0.0.10'
[SENSU-INSTALL] gem install sensu-plugins-windows --version '0.0.10' --no-ri --no-rdoc --verbose
[SENSU-INSTALL] failed to install Sensu plugin gem 'sensu-plugins-windows'
[SENSU-INSTALL] please take note of any failure messages above
[SENSU-INSTALL] make sure you have build tools installed (e.g. gcc)
[SENSU-INSTALL] trying to determine the Sensu plugin homepage for sensu-plugins-windows ...
'gem' is not recognized as an internal or external command,
operable program or batch file.
这是由安装程序的嵌入式 ruby 和 gem 二进制文件
C:\opt\sensu\embedded\bin\
未添加到系统路径引起的。这可以通过在提升的 powershell 中运行以下命令来解决,该命令将嵌入式 bin 目录添加到系统路径(持久):
您现在可以成功运行以下命令: