Configuring Windows monitoring zabbix
surroundings
zabbix server
ens192:10.127.0.133
ens256:172.168.0.2
windows server2012
Ens192: 172.168.0.3
Gateway: 172.168.0.2
Internet sharing and port forwarding configuration
Here's windows server2012 environment using esxi virtual machine, because the ip on the public network is not enough, here I do nat, but esxi nat network does not support, so I use port forwarding and iptables achieved on zabbix server to share Internet access
Open zabbix server routing forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
or
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
sysctl -p
Iptables configuration
iptables -t nat -A POSTROUTING -s 172.168.0.0/24 -o ens192 -j SNAT --to-source 10.127.0.133
iptables -t nat -A PREROUTING -d 10.127.0.133 -p tcp --dport 3389 -i ens192 -j DNAT --to-destination 172.168.0.3:3389
iptables-save
Testing Network Connectivity
Remote connectivity test
Because Windows server2012 not open remote connection service, you need to add in the Server Manager role and function is relatively simple steps, not repeat them here, directly connected to the 3389 port zabbix server within the network can connect a remote Windows server desktop
Download zabbix agent client
download link:
start installation
After the installation is complete, zabbix agent is added to the service up and running
We can also see the port 10050 is in a listening state
Adding Windows host on zabbix
Windows host name write the name on it
Encounter a problem after creating a host connection agent has reported 104 errors, see the next agent log and found that the network is taking the network card, it may be a bit more before iptables rules, and iptables rules are down from the match, the rules do not lead to the right to match
get value from agent failed: ZBX_TCP_READ() failed;[104] connection reset by peer
The top of the right iptables rules on the chain can be resolved
iptables -t nat -I POSTROUTING -d 172.168.0.0/24 -p tcp -m tcp --dport 10050 -j SNAT --to-source 10.127.0.133
iptables-save
View logs can see the status of agent becomes available
zabbix provides a template to monitor a Windows provides a lot of monitoring on the system, and can automatically discover and monitor the service status
Create a Windows monitoring items example
Get IIS process status
agent provides a proc.num [] keys used to monitor the number of processes
When the number of processes can be configured to trigger an alarm 0
If you want to conduct a detailed monitoring of the IIS process, you can use Windows Performance Monitor to monitor
Providing zabbix agent perf_counter [counter, \ <interval>] key on the performance test is collected between the monitored values, where available memory windows for example, to add a first counter
Once created only need to add the counter on the path it zabbix
Of course, the path of these counters can also be represented by numbers, the digital path map value exists in the registry, you need to run regedit, and then locate the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Perflib \ 009 this registry.
Monitoring items such as the above may be expressed using the following method:
If we want more information web process monitor, you can add a counter in the process path, inetinfo name for the software to run the web
Gets the number of concurrent connections for IIS
Performance Monitor also added a number of IIS connection counter to be monitored, path exists in the Web Service, if the additional information to the IIS (such as CGI requests processed) for obtaining, also in the Web Service path under Add counters
We welcome you to focus on the public number "Master Chen's no story."