This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

1 דוגמאות שימוש

סקירה

סעיף זה מציג דוגמאות לשימוש בשלבי עיבוד טרומי כדי לבצע כל מיני משימות שימושיות.

סינון רשומות יומן אירועים של VMware

שימוש בעיבוד מקדים של ביטוי רגולרי כדי לסנן אירועים מיותרים של יומן האירועים של VMware.

1. במארח VMware Hypervisor שעובד, בדוק את פריט יומן האירועים vmware.eventlog[<url>,<mode>] קיים ופועל כהלכה. הערה כי פריט יומן האירועים כבר יכול להיות קיים ב-hypervisor אם תבנית Template VM VMware קושרת במהלך המארח יצירה.

2. במארח VMware Hypervisor צור תלוי item מסוג 'לוג' ו הגדר את פריט יומן האירועים כמאסטר שלו.

בכרטיסייה "עיבוד מקדים" של הפריט התלוי בחר את "התאמות". אפשרות אימות ביטוי רגולרי ותבנית מילוי, לדוגמה:

 ".* מחובר .*" - מסנן את כל אירועי הרישום ביומן האירועים
        "\bUser\s+\K\S+" - סנן רק שורות עם שמות משתמש מיומן האירועים

::: שימו לב חשוב אם הביטוי הרגולרי אינו מותאם, ה- פריט תלוי הופך ללא תמיכה עם הודעת שגיאה מתאימה. כדי להימנע מכך, סמן את תיבת הסימון "מותאם אישית בכשל" ובחר למחוק ערך ללא תחרות, למשל. :::

גישה נוספת המאפשרת שימוש בקבוצות התאמה ובקרת פלט היא כדי לבחור באפשרות "ביטוי רגולרי" בכרטיסייה "עיבוד מוקדם" ו מילוי פרמטרים, למשל:

 דפוס: ".*התחבר.*", פלט: "\0" - מסנן את כל אירועי הרישום ביומן האירועים
        דפוס "User (.*?)(?=\ )", פלט: "\1" - סנן רק שמות משתמש מיומן האירועים

Checking retrieved value type

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:

# Multiplies the retrieved value by 1:
       number: 1

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.

Checking for not supported value

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:

  • Return a valid result.
  • Return a result that initially seems valid but may become unsupported later (e.g., due to a value type mismatch after preprocessing).
  • Return an error of collecting the value, causing the item to become unsupported. Common causes include:
    • Unknown item key (for Zabbix agent, Simple check, or Zabbix internal items)
    • Unknown OID (SNMP agent), unknown sensor (IPMI agent), or no JMX metric (JMX agent)
    • Cannot read trap file (SNMP trap)
    • Script not found (External check)
    • No such URL (HTTP agent)
    • Login failed (SSH agent, TELNET agent)
    • Invalid formula syntax (Calculated), JavaScript syntax error (Script), or invalid SQL (Database monitor)

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.