Zabbix Client Software Installation configuration (Windows operating system)

Source: Internet
Author: User
Tags goto perl script

1. Manually Install Zabbix client

(1) Download Windows Zabbix Client

From the official Download Zabbix agent, the package contains 2 directories, one for Win32, the other is Win64, each directory should have 3 files, respectively: Zabbix_agentd.exe zabbix_get.exe zabbix_ Sender.exe

Depending on the operating system, place the file in the C:\zabbix directory

(2) Add client zabbix_agentd,conf file

Create a new zabbix_agentd.conf file in the C:\zabbix folder, and write the following basic content:

Logfile=c:\zabbix\zabbix_agentd.log

Pidfile=c:\zabbix\zabbix_agentd.pid

server=< Service-side IP address >

hostname=< Client Host name >


C. Execute the following command to register ZABBIX_AGENTD as a Windows service.

C:Program fileszabbix>zabbix_agentd--config "C:Program fileszabbixzabbix_agentd.conf--install

D. Starting ZABBIX_AGENTD services

C:Program Fileszabbix>zabbix_agentd Start

E. Check the status of the zabbixagent in the Windows System Services list, and normally you will see that zabbixagent already exists in the system service and is automatically started.

(3) Install Zabbix client and start

Go to the target host's C:\zabbix directory and perform the following command to complete the client installation:

Zabbix_agentd.exe–c C:\zabbix\zabbix_agentd.conf-i

Execute the following command to start the client:

Zabbix_agentd.exe–c C:\zabbix\zabbix_agentd.conf–s

Parameter meaning:

-C Establish the location of the configuration file

-I is the installation client

-S to start the client

-X Stop Client

-D Uninstall Client

2, automated installation Zabbix client

If you are deploying a Zabbix client for a large number of Windows servers, you can complete the installation and startup of the client by writing a batch file. However, given the network card traffic monitoring, you need to use Perl or Python scripts to implement.

My Perl Automation installation script is shown in the attachment

Download and install activestate.perl.dev.kit.pro.v9.0, the Perl program to generate EXE executable file, placed in the C:\zabbix directory.

In addition, I wrote a Windows batch script Agentd.bat placed in the C:\zabbix directory to install, start, stop, uninstall ZABBIX_AGENTD on the client server. The script reads as follows:

@echo off

Echo ****************************************

echo *****zabbix Agentd 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 ****************************************

choice/c:abcd/m [A]start,[b]stop,[c]install,[d]uninstall

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\zabbix_agentd.exe-c c:\zabbix\zabbix_agentd.conf-s

Goto END

: Stop

C:\zabbix\zabbix_agentd.exe-c C:\zabbix\zabbix_agentd.conf-x

Goto END

: Restart

C:\zabbix\zabbix_agentd.exe-c C:\zabbix\zabbix_agentd.conf-x

C:\zabbix\zabbix_agentd.exe-c c:\zabbix\zabbix_agentd.conf-s

: Install

C:\zabbix\zabbix_agentd.exe-c C:\zabbix\zabbix_agentd.conf-i

Goto END

: Uninstall

C:\zabbix\zabbix_agentd.exe-c c:\zabbix\zabbix_agentd.conf-d

Goto END

: End

Automated installation package production process is as follows:

(1) Select the Zabbix installation package file that you want to package (default is on C disk) and right-click to select "Add to Compressed file"

(2) I use a good pressure software, in the pop-up dialog box, compressed file format selection for 7Z, compression mode according to the requirements of choice, I chose the default criteria. In the compression option, tick before "Create solid compressed Files" and "Create self-extracting compressed files."

(3) into the self-extracting option, select the Decompression tab, according to the following figure to fill in:

(4) After click OK, start to compress. Generate self-extracting file after compression Zabbix.exe

(5) Installation package decompression installation, double-click the installation package, click Install to complete the installation of software deployment


###############################



4.15 Adding monitoring for Windows Servers 4.15.1 add custom monitoring entries for Windows templates

Zabbix can monitor Windows servers, but Zabbix default Windows monitoring templates do not provide more and better monitoring items. Many monitoring projects need to be manually added by themselves or customized in zabbix.agentd,conf files.

1, Zabbix Custom monitoring Windows Server principle

Zabbix provides the PerfCounter (performance counter) feature for Windows Server monitoring. The Zabbix client obtains the dependency Energy information on the Windows Server through PerfCounter and sends it to the server side.

2, how to get the Windows Server PerfCounter expression

Method One:

These performance monitoring can be seen in the Windows Server's Control Panel-&gt; management Tools-&gt; Performance System Monitor.

Click to add a counter, in the Pop-up Add Counter dialog box, you can select the corresponding monitoring items in the performance object Drop-down menu, then select the counter to use in the list below and select the example in the table on the right. Click Add.

The added counter can be seen in the following list

Right-click on the added counters to select the properties, in the pop-up window of the Data tab can see the specific perfcounter expression

Method Two:

Enter the start-&gt; run, enter cmd into the command window. Input typeperf–qx| More gets the related perfcounter expression. You can also match the output of the pipeline to find, looking for the relevant expression of the desired. To get the NIC PerfCounter as an example, enter at the command line: TYPEPERF–QX |find "Network Interface" |find/v "loopback"

The command means to find the PerfCounter associated with "network Interface". /V is a perfcounter that ignores and "loopback" loopback interfaces

3, use PerfCounter in Zabbix to add monitoring items for Windows templates

In Zabbix, there are two ways to use PerfCounter:

Method One:

Use Perf_counter as a key expression when the template adds a monitor:

To add CPU idle time monitoring as an example:

System Configuration-&gt; template, select Windows Monitor template. Enter the monitor entry, click on the Create item in the upper right corner, creating the monitor item, adding PerfCounter related parameters in key, and then setting the other options to save.

Method Two:

Add PerfCounter parameters similar to parameter custom monitoring in the client configuration file zabbix_agentd.conf file. The specific use of the format is as follows

perfcounter=< Monitor Key expression >,< performance counter name >

To add network card monitoring as an example:

Modify the Zabbix Client Profile zabbix_agentd.conf on the Windows Server to add information related to the network card obtained through the TYPEPERF-QX command

#Network

Perfcounter=netallint0, "\network Interface (intel[r) pro_1000 MT network Connection) \bytes total/sec", 30

Perfcounter=netinint0, "\network Interface (intel[r) pro_1000 MT network Connection) \bytes received/sec", 30

Perfcounter=netoutint0, "\network Interface (intel[r) pro_1000 MT network Connection) \bytes sent/sec", 30

Perfcounter=netbandint0, "\network Interface (intel[r) pro_1000 MT network Connection) \current bandwidth", 30

4.15.2 Windows Server network card traffic monitoring

Method One:

Keywords for Windows key can be replaced with the IP address of the network card. For example: Net.if.out[192.168.101.1,bytes]

Method Two:

If you change the IP address, the above method does not work. The use of macro can be a better solution to monitor the needs of local network card net.if.out[{ipaddress},bytes]

Method Three:

Macro {ipaddress} just get the host's extranet IP address, for the host of multiple network cards can not monitor the intranet. Using PerfCounter in the client configuration file can solve this problem. However, the NIC model of each machine is not necessarily the same, so the output of the typeperf is not the same. I wrote a perl script to solve the problem.

Use strict;

Use warnings;

#添加对网卡的监控

My @network = ' typeperf-qx |find "network Interface" |find/v "loopback" |find "Bytes" ";

my $i = 0;

foreach my $int (@network)

{

if ($int =~/^ (\\Network interface.*\\). *$/)

{

My $intname = ($);

Open Out_file, "&gt;&gt;c:\\zabbix\\zabbix_agentd.conf" or Die ("could not write the FILE");

Print Out_file &lt;&lt; EOF;

#Network

Perfcounter=netallint${i}, "${intname}bytes total/sec", 30

Perfcounter=netinint${i}, "${intname}bytes received/sec", 30

Perfcounter=netoutint${i}, "${intname}bytes sent/sec", 30

Perfcounter=netbandint${i}, "${intname}current bandwidth", 30

Eof

Close (Out_file);

$i + +;

}

}

Different Windows servers run this script to write monitoring to the zabbix_agentd.conf configuration file based on the server's network card model and the number of NICs.

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.