Windows Zabbix Monitoring remote process Implementation mechanism

Source: Internet
Author: User

Recently responsible for monitoring the deployment of Zabbix, need to complete the local server to monitor the running status of remote virtual machine (CPU, open process, etc.), share with you my implementation method.

(1) First, the batch processing of the process that records the Zabbix client needs to be realized: zabbix_task.bat;

Zabbix_task.bat content is as follows:

@echo off

Chcp 65001

tasklist/v |findstr "%username%" > C:/zabbix_temp.txt #进程路径根据个人习惯设置

Pause

(2) Second, the implementation of real-time monitoring the remote Process batch processing, using the VBS script call script 1 to implement a timed refresh process, the script named: Zabbix_monitor.vbs

Local computer remotely Create a remote computer's scheduled task program (when each login automatically run script zabbix_monitor.vbs), real-time monitoring of the computer process

Zabbix_monitor.vbs content is as follows:

Set ws = CreateObject ("Wscript.Shell")

Do
Ws.run Left (Wscritp.scritpfullname,instrrev (WScript. ScriptFullName, "\")-1) & "\zabbix_task.bat", vbhide

Wscript.Sleep 5000

Loop

(3) Finally, implement filtering filtering Zabbix the process script that the server needs to monitor: Zabbix_tasklist.bat

@echo off

Setlocal enabledelayedexpansion
Chcp 65001
echo {
echo "Data": [
for/f "tokens = 9*"%%i in (C:\zabbix_temp.txt)
Do
Set "Str=%%j"
Set "str=!str:\=\\!"
If "!str!" = = "!STR: N/a =!" "If"!str! " = = "!str:wnd=! "If"!str! " = = "!str:n/a=! "If"!str! " = = "!str:mci=! "If"!str! " = = "!str:dwn=! "If"!str! " = = "!str:taskeng=! "If"!str! " = = "!str:ksafetray=! "If"!str! " = = "!str:6ebf21d6ba1f=! "If"!str! " = = "!str:jusched=! "If"!str! " = = "!str:hwuvpupgrade=! "If"!str! " = = "!str:spes=! "If"!str! " = = "!str:windows update=! "If"!str! " = = "!str:cmd.exe=! "If"!str! " = = "!str:sysfader=! "
echo {"{#TASK_NAME}": "!str!"},
)
echo {"{#TASK_NAME}": "NULL"}
Echo
Echo
}

PS: Local Computer access remote PC to create a scheduled task program, you can use the batch Schtask command to complete access to the remote computer

  

  

Windows Zabbix Monitoring remote process Implementation mechanism

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.