1. 程式人生 > >Zabbix Windos mysql 監控腳本

Zabbix Windos mysql 監控腳本

mys 監控 shell oot 進程 dal eat pin all

說明:判斷mysql主進程是否關閉,如果關閉則返回0

創建文件:MySQL-ping.vbs

Set objFS = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
str1 = getCommandOutput("C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin -uroot -pqaz123wsx ping")

If Instr(str1,"alive") > 0 Then
WScript.Echo 1
Else
WScript.Echo 0
End If

Function getCommandOutput(theCommand)

Dim objShell, objCmdExec
Set objShell 
= CreateObject("WScript.Shell") Set objCmdExec = objshell.exec(thecommand) getCommandOutput = objCmdExec.StdOut.ReadAll end Function

添加自定義key:http://www.cnblogs.com/xiangsikai/p/8289535.html

Zabbix Windos mysql 監控腳本