Ова секција представља примере коришћења корака предобраде за постизање неких практичних задатака.
Using regular expressions to filter unnecessary events from the VMware event log.
1. On a working VMware Hypervisor host, check that the event log item vmware.eventlog[<url>,<mode>,<severity>]
is present and working properly. Note that the event log item could already be present on the hypervisor if the Template VM VMware template has been linked during the host creation.
2. On the VMware Hypervisor host, create a dependent item of 'Log' type and set the event log item as its master.
In the "Preprocessing" tab of the dependent item, select the "Matches regular expression" validation option and fill pattern, for example:
".* logged in .*" - filters all logging events in the event log
"\bUser\s+\K\S+" - filter only lines with usernames from the event log
If the regular expression is not matched, then the dependent item becomes unsupported with a corresponding error message. To avoid this, mark the "Custom on fail" checkbox and select to discard unmatched value, for example.
Another approach that allows using matching groups and output control is to select "Regular expression" option in the "Preprocessing" tab and fill parameters, for example:
pattern: ".*logged in.*", output: "\0" - filters all logging events in the event log
pattern "User (.*?)(?=\ )", output: "\1" - filter only usernames from the event log
Овај пример користи корак претходне обраде Прилагођени множилац да би се проверило да ли је тип вредности преузете ставке нумерички.
На картици Претходна обрада ставке, изаберите корак претходне обраде Прилагођени множилац и наведите следећи параметар (множи преузету вредност са 1):
Ако претходна обрада не успе (нпр., унос није нумерички), ставка постаје неподржана са одговарајућом поруком о грешци. Да бисте то избегли, означите поље за потврду Прилагођено при неуспеху и изаберите опцију као што је одбацивање вредности или подешавање прилагођене. Имајте на уму да се вредности discarded не чувају у бази података; као резултат тога, окидачи се не процењују и подаци о тренду се не генеришу.
This example uses the Check for not supported value preprocessing step to check if the item value could not be retrieved.
When a Zabbix server/proxy poller process attempts to collect an item value, it may:
To detect and handle errors of collecting item values, you can use the Check for not supported value preprocessing step. Note that this step is always executed first and only detects errors that occur before preprocessing begins.
In the Preprocessing tab of an item, select the Check for not supported value preprocessing step and specify one of the following parameters:
Then, use the Custom on fail option to discard the value (in this case, the error), set a custom value, or return a custom error message. Please note that discarded values are not stored in the database; as a result, triggers are not evaluated and trend data is not generated.