סעיף זה מציג דוגמאות לשימוש בשלבי עיבוד טרומי כדי לבצע כל מיני משימות שימושיות.
שימוש בעיבוד מקדים של ביטוי רגולרי כדי לסנן אירועים מיותרים של יומן האירועים של VMware.
1. במארח VMware Hypervisor שעובד, בדוק את פריט יומן האירועים vmware.eventlog[<url>,<mode>]
קיים ופועל כהלכה. הערה כי פריט יומן האירועים כבר יכול להיות קיים ב-hypervisor אם תבנית Template VM VMware קושרת במהלך המארח יצירה.
2. במארח VMware Hypervisor צור תלוי item מסוג 'לוג' ו הגדר את פריט יומן האירועים כמאסטר שלו.
בכרטיסייה "עיבוד מקדים" של הפריט התלוי בחר את "התאמות". אפשרות אימות ביטוי רגולרי ותבנית מילוי, לדוגמה:
".* מחובר .*" - מסנן את כל אירועי הרישום ביומן האירועים
"\bUser\s+\K\S+" - סנן רק שורות עם שמות משתמש מיומן האירועים
::: שימו לב חשוב אם הביטוי הרגולרי אינו מותאם, ה- פריט תלוי הופך ללא תמיכה עם הודעת שגיאה מתאימה. כדי להימנע מכך, סמן את תיבת הסימון "מותאם אישית בכשל" ובחר למחוק ערך ללא תחרות, למשל. :::
גישה נוספת המאפשרת שימוש בקבוצות התאמה ובקרת פלט היא כדי לבחור באפשרות "ביטוי רגולרי" בכרטיסייה "עיבוד מוקדם" ו מילוי פרמטרים, למשל:
דפוס: ".*התחבר.*", פלט: "\0" - מסנן את כל אירועי הרישום ביומן האירועים
דפוס "User (.*?)(?=\ )", פלט: "\1" - סנן רק שמות משתמש מיומן האירועים
This example uses the Custom multiplier preprocessing step to check if the retrieved item value type is numeric.
In the Preprocessing tab of an item, select the "Custom multiplier" preprocessing step and set the following parameter:
If preprocessing fails (e.g., input is not numeric), then the item becomes unsupported with a corresponding error message. To avoid this, mark the "Custom on fail" checkbox and select an option such as discarding the value or setting a custom one.
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.
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.