This is a translation of the original English documentation page. Help us make it better.

5 בדיקות פשוטות

סקירה כללית

בדיקות פשוטות משמשות בדרך כלל לבדיקות ללא סוכן מרחוק של שירותים.

שימו לב שאין צורך בסוכן Zabbix לבדיקות פשוטות. זאביקס שרת/פרוקסי אחראי לעיבוד בדיקות פשוטות (ביצוע חיבורים חיצוניים וכו').

דוגמאות לשימוש בהמחאות פשוטות:

 net.tcp.service[ftp,,155]
        net.tcp.service[http]
        net.tcp.service.perf[http,,8080]
        net.udp.service.perf[ntp]

שדות שם משתמש ו-סיסמה בפריט סימון פשוט תצורה משמשת לפריטי ניטור VMware; התעלמו אחרת.

סקירה כללית

בדיקות פשוטות משמשות בדרך כלל לבדיקות ללא סוכן מרחוק של שירותים.

שימו לב שאין צורך בסוכן Zabbix לבדיקות פשוטות. זאביקס שרת/פרוקסי אחראי לעיבוד בדיקות פשוטות (ביצוע חיבורים חיצוניים וכו').

דוגמאות לשימוש בהמחאות פשוטות:

 net.tcp.service[ftp,,155]
        net.tcp.service[http]
        net.tcp.service.perf[http,,8080]
        net.udp.service.perf[ntp]

שדות שם משתמש ו-סיסמה בפריט סימון פשוט תצורה משמשת לפריטי ניטור VMware; התעלמו אחרת.

Item key details

icmpping[<target>,<packets>,<interval>,<size>,<timeout>,<options>]


The host accessibility by ICMP ping.
Return value: 0 - ICMP ping fails; 1 - ICMP ping successful.

Parameters:

  • target - the host IP or DNS name;
  • packets - the number of packets;
  • interval - the time between successive packets in milliseconds;
  • size - the packet size in bytes;
  • timeout - the timeout in milliseconds;
  • options - used for allowing redirect: if empty (default value), redirected responses are treated as target host down; if set to allow_redirect, redirected responses are treated as target host up.

See also the table of default values.

Example:

icmpping[,4] #If at least one packet of the four is returned, the item will return 1.
icmppingloss[<target>,<packets>,<interval>,<size>,<timeout>,<options>]


The percentage of lost packets.
Return value: Float.

Parameters:

  • target - the host IP or DNS name;
  • packets - the number of packets;
  • interval - the time between successive packets in milliseconds;
  • size - the packet size in bytes;
  • timeout - the timeout in milliseconds;
  • options - used for allowing redirect: if empty (default value), redirected responses are treated as target host down; if set to allow_redirect, redirected responses are treated as target host up.

See also the table of default values.

icmppingsec[<target>,<packets>,<interval>,<size>,<timeout>,<mode>,<options>]


The ICMP ping response time (in seconds).
Return value: Float.

Parameters:

  • target - the host IP or DNS name;
  • packets - the number of packets;
  • interval - the time between successive packets in milliseconds;
  • size - the packet size in bytes;
  • timeout - the timeout in milliseconds;
  • mode - possible values: min, max, or avg (default);
  • options - used for allowing redirect: if empty (default value), redirected responses are treated as target host down; if set to allow_redirect, redirected responses are treated as target host up.

Comments:

  • Packets which are lost or timed out are not used in the calculation;
  • If the host is not available (timeout reached), the item will return 0;
  • If the return value is less than 0.0001 seconds, the value will be set to 0.0001 seconds;
  • See also the table of default values.
net.tcp.service[service,<ip>,<port>]


Checks if a service is running and accepting TCP connections.
Return value: 0 - the service is down; 1 - the service is running.

Parameters:

  • service - possible values: ssh, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet (see details);
  • ip - the IP address or DNS name (by default the host IP/DNS is used);
  • port - the port number (by default the standard service port number is used).

Comments:

  • Note that with tcp service indicating the port is mandatory;
  • These checks may result in additional messages in system daemon logfiles (SMTP and SSH sessions being logged usually);
  • Checking of encrypted protocols (like IMAP on port 993 or POP on port 995) is currently not supported. As a workaround, please use net.tcp.service[tcp,<ip>,port] for checks like these.

Example:

net.tcp.service[ftp,,45] #This item can be used to test the availability of FTP server on TCP port 45.
net.tcp.service.perf[service,<ip>,<port>]


Checks the performance of a TCP service.
Return value: Float: 0.000000 - the service is down; seconds - the number of seconds spent while connecting to the service.

Parameters:

  • service - possible values: ssh, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet (see details);
  • ip - the IP address or DNS name (by default the host IP/DNS is used);
  • port - the port number (by default the standard service port number is used).

Comments:

  • Note that with tcp service indicating the port is mandatory;
  • Checking of encrypted protocols (like IMAP on port 993 or POP on port 995) is currently not supported. As a workaround, please use net.tcp.service[tcp,<ip>,port] for checks like these.

Example:

net.tcp.service.perf[ssh] #This item can be used to test the speed of initial response from SSH server.
net.udp.service[service,<ip>,<port>]


Checks if a service is running and responding to UDP requests.
Return value: 0 - the service is down; 1 - the service is running.

Parameters:

  • service - possible values: ntp (see details);
  • ip - the IP address or DNS name (by default the host IP/DNS is used);
  • port - the port number (by default the standard service port number is used).

Example:

net.udp.service[ntp,,45] #This item can be used to test the availability of NTP service on UDP port 45.
net.udp.service.perf[service,<ip>,<port>]


Checks the performance of a UDP service.
Return value: Float: 0.000000 - the service is down; seconds - the number of seconds spent waiting for response from the service.

Parameters:

  • service - possible values: ntp (see details);
  • ip - the IP address or DNS name (by default the host IP/DNS is used);
  • port - the port number (by default the standard service port number is used).

Example:

net.udp.service.perf[ntp] #This item can be used to test the response time from NTP service.

For SourceIP support in LDAP simple checks (e.g. net.tcp.service[ldap]), OpenLDAP version 2.6.1 or above is required.

עיבוד הזמן הקצוב

Zabbix לא תעבד בדיקה פשוטה יותר מאשר שניות הזמן הקצוב מוגדר בקובץ התצורה של שרת/פרוקסי של Zabbix.

פינגים של ICMP

Zabbix משתמש בכלי עזר חיצוני fping לעיבוד פינגים של ICMP.

השירות אינו חלק מהפצת Zabbix וחייב להיות מותקן בנוסף. אם כלי השירות חסר, יש לו הרשאות שגויות או מיקומו אינו תואם את המיקום שנקבע ב-Zabix קובץ תצורת שרת/פרוקסי (פרמטר 'FpingLocation'), pings ICMP (icmpping, icmppingloss, icmppingsec) לא יעובדו.

ראה גם: ידוע בעיות

fping חייב להיות בר הפעלה על ידי המשתמש Zabbix daemons המופעלים כמו ו שורש setuid. הפעל את הפקודות האלה בתור שורש של המשתמש כדי להגדיר הרשאות נכונות:

 shell> chown root:zabbix /usr/sbin/fping
        shell> chmod 4710 /usr/sbin/fping

לאחר ביצוע שתי הפקודות לעיל, בדוק את הבעלות על ה-fping בר הפעלה. במקרים מסוימים ניתן לאפס את הבעלות על ידי ביצוע ה- פקודת chmod.

בדוק גם אם המשתמש zabbix שייך לקבוצת zabbix על ידי הפעלת:

 shell> קבוצות zabbix

ואם זה לא הוסף על ידי הנפקה:

 shell> usermod -a -G zabbix zabbix

ברירות מחדל, מגבלות ותיאור ערכים עבור פרמטרי בדיקת ICMP:

פרמטר יחידה תיאור הדגל של Fping ברירות מחדל מוגדרות על ידי הגבלות המותרות
על ידי Zabbix
fping Zabbix דקה מקסימום
מנות מספר מספר מנות בקשה ליעד -C 3 1 10000
מרווח מילישניות זמן המתנה בין מנות עוקבות -p 1000 20 בלתי מוגבל
size bytes גודל מנות בבתים
56 בתים ב-x86, 68 בתים ב-x86_64
-b 56 או 68 24 65507
timeout מילישניות fping v3.x - פסק זמן להמתנה לאחר שליחת החבילה האחרונה, מושפע מדגל -C
fping v4.x - פסק זמן בודד עבור כל מנה
-t fping v3.x - 500
fping v4.x - בירושה מדגל -p, אך לא יותר מ-2000
50 ללא הגבלה

בנוסף Zabbix משתמש באפשרויות fping -i interval ms (לא לערבב עם פרמטר הפריט מרווח שהוזכר בטבלה למעלה, אשר מתאים לאפשרות fping -p) ו--S כתובת IP מקור (או -I in גרסאות fping ישנות יותר). אפשרויות אלה מזוהות אוטומטית על ידי הפעלת בדיקות עם שילובי אפשרויות שונים. Zabbix מנסה לזהות את המינימלי ערך באלפיות שניות ש-fping מאפשר להשתמש עם -i על ידי ניסיון 3 ערכים: 0, 1 ו-10. לאחר מכן משתמשים בערך שמצליח לראשונה בדיקות ICMP עוקבות. תהליך זה נעשה על ידי כל ICMP pinger. בנפרד.

אפשרויות fping שזוהו אוטומטית מתבטלות כל שעה ומתגלות שוב בניסיון הבא לבצע בדיקת ICMP. הגדר DebugLevel>=4 אינץ' כדי להציג פרטים על תהליך זה בקובץ יומן השרת או ה-proxy.

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

Zabbix כותב כתובות IP שיבדקו על ידי כל אחד משלושת icmpping* מפתחות לקובץ זמני, אשר מועבר לאחר מכן ל-fping. אם פריטים יש פרמטרי מפתח שונים, רק כאלה עם פרמטרי מפתח זהים נכתבים לקובץ בודד.
כל כתובות ה-IP שנכתבו לקובץ היחיד ייבדקו על ידי fping-in במקביל, כך שתהליך הפינגר של Zabbix icmp יבלה פרק זמן קבוע תוך התעלמות ממספר כתובות ה-IP בקובץ.

Installation

fping is not included with Zabbix and needs to be installed separately:

  • Various Unix-based platforms have the fping package in their default repositories, but it is not pre-installed. In this case you can use the package manager to install fping.

  • Zabbix provides fping packages for RHEL. Please note that these packages are provided without official support.

  • fping can also be compiled from source.

Configuration

Specify fping location in the FpingLocation parameter of Zabbix server/proxy configuration file (or Fping6Location parameter for using IPv6 addresses).

fping should be executable by the user Zabbix server/proxy run as and this user should have sufficient rights.

See also: Known issues for processing simple checks with fping versions below 3.10.

Default values

Defaults, limits and description of values for ICMP check parameters:

Parameter Unit Description Fping's flag Defaults set by Allowed limits
by Zabbix
fping Zabbix min max
packets number number of request packets sent to a target -C 3 1 10000
interval milliseconds time to wait between successive packets to an individual target -p 1000 20 unlimited
size bytes packet size in bytes
56 bytes on x86, 68 bytes on x86_64
-b 56 or 68 24 65507
timeout milliseconds fping v3.x - timeout to wait after last packet sent, affected by -C flag
fping v4.x - individual timeout for each packet
-t fping v3.x - 500
fping v4.x and newer - inherited from -p flag, but not more than 2000
50 unlimited

The defaults may differ slightly depending on the platform and version.

In addition, Zabbix uses fping options -i interval ms (do not mix up with the item parameter interval mentioned in the table above, which corresponds to fping option -p) and -S source IP address (or -I in older fping versions). These options are auto-detected by running checks with different option combinations. Zabbix tries to detect the minimal value in milliseconds that fping allows to use with -i by trying 3 values: 0, 1 and 10. The value that first succeeds is then used for subsequent ICMP checks. This process is done by each ICMP pinger process individually.

Auto-detected fping options are invalidated every hour and detected again on the next attempt to perform ICMP check. Set DebugLevel>=4 in order to view details of this process in the server or proxy log file.

Zabbix writes IP addresses to be checked by any of the three icmpping* keys to a temporary file, which is then passed to fping. If items have different key parameters, only the ones with identical key parameters are written to a single file. All IP addresses written to the single file will be checked by fping in parallel, so Zabbix ICMP pinger process will spend fixed amount of time disregarding the number of IP addresses in the file.