Het volgende voorbeeld beschrijft hoe u Zabbix kunt instellen voor het bewaken van VMware virtuele machines. Dit omvat:
This example does not cover the configuration of VMware. It is assumed that VMware is already configured.
Before proceeding, set the StartVMwareCollectors
parameter in Zabbix server configuration file to 2
or more (the default value is 0
).
Ga naar Gegevensverzameling → Hosts.
Klik op Ontdekking voor de aangemaakte host om naar de lijst met low-level discovery-regels voor die host te gaan.
1. In the list of low-level discovery rules, click Host prototypes for the previously created low-level discovery rule.
2. Create a host prototype. Since host prototypes are blueprints for creating hosts through low-level discovery rules, most fields will contain low-level discovery macros. This ensures that the hosts are created with properties based on the content retrieved by the previously created low-level discovery rule.
3. Click the Add button to create the host prototype. This host prototype will be used to create hosts for virtual machines discovered by the previously created low-level discovery rule.
Nadat het host-prototype is aangemaakt, zal de low-level discovery-regel hosts aanmaken voor ontdekte VMware virtuele machines, en Zabbix zal beginnen met het bewaken ervan. Merk op dat de ontdekking en aanmaak van hosts ook handmatig kunnen worden uitgevoerd, indien nodig.
Om de aangemaakte hosts te bekijken, navigeert u naar de menusectie Gegevensverzameling → Hosts.
Om verzamelde gegevens te bekijken, navigeert u naar de menusectie Bewaking → Hosts en klikt u op Laatste gegevens voor een van de hosts.
The vmware.vm.discovery[{$VMWARE.URL}]
item key, configured in the Create a low-level discovery rule section, returns network interfaces data in the "net_if" field:
"net_if": [
{
"ifname": "5000",
"ifdesc": "Network adapter 1",
"ifmac": "00:11:22:33:44:55",
"ifconnected": true,
"iftype": "VirtualVmxnet3",
"ifbackingdevice": "VLAN(myLab)",
"ifdvswitch_uuid": "",
"ifdvswitch_portgroup": "",
"ifdvswitch_port": "",
"ifip": [
"127.0.0.1",
"::1"
]
},
{
"ifname": "5001",
"ifdesc": "Network adapter 2",
"ifmac": "00:11:22:33:44:55",
"ifconnected": false,
"iftype": "VirtualVmxnet3",
"ifbackingdevice": "VLAN(myLab2)",
"ifdvswitch_uuid": "",
"ifdvswitch_portgroup": "",
"ifdvswitch_port": "",
"ifip": []
}
]
This data can be used to configure a custom host interface.
1. When creating a low-level discovery rule, additionally configure a low-level discovery macro. In the LLD macros tab, create a custom LLD macro with a JSONPath value. For example:
$.net_if[?(@.ifbackingdevice=="VLAN(myLab)")].ifip[0].first()
2. When creating a host prototype, add a custom host interface and enter the LLD macro in the DNS name or IP address field.