window系统故障重启后,发现zabbix报警一直没有报恢复。

准备重启一下,

运行:c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s

却发现出现报错cannot open service

在网上搜索报错解决情况,却没有搜到什么有用的信息。那就还是自己琢磨吧。

停止进程:c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf  -x

却发还是现出现报错cannot open service

卸载:c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf  -d

却发还是现出现报错cannot open service

安装:c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf  -i

这次却发现成功安装,然后再启动一下:

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s

OK,暂时还没有查到为什么会出现重启后zabbix-agent自动卸载的原因

先贴一个我从网上看到的一篇windows的ba交互式t文件,省去敲命令的时间。

zabbix.bat文件内容:

@echo off

CHCP 65001

echo **********************************************

echo **********Zabbix Agented Operation************

echo **********************************************

echo **** a. start Zabbix Agentd**********

echo **** b. stop Zabbix Agentd**********

echo **** c. restart Zabbix Agentd**********

echo **** d. install Zabbix Agentd**********

echo **** e. uninstall Zabbix Agentd**********

echo **** f. exit Zabbix Agentd**********

echo **********************************************

:loop

choice /c abcdef /M "plese choose"

if errorlevel 6 goto :exit

if errorlevel 5 goto :uninstall

if errorlevel 4 goto :install

if errorlevel 3 goto :restart

if errorlevel 2 goto :stop

if errorlevel 1 goto :start

:start

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s

:stop

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -x

:restart

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -x

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s

:install

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -i

:uninstall

c:\zabbix\bin\win64\zabbix_agent.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -d

:exit

exit

后续查找到原因,再继续进行处理,今天先到这里

相关文章:

  • 2021-08-27
  • 2022-02-15
  • 2022-12-23
  • 2021-07-04
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-06
  • 2022-12-23
  • 2021-07-13
  • 2021-09-06
  • 2021-12-04
  • 2021-08-05
  • 2022-01-15
相关资源
相似解决方案