Full Transcript

LLD - GRAPH PROTOTYPES Graph prototypes: Y P A name must be unique - use {#LLD.MACRO} Graphs can include: Same LLD rule item prototypes Any host/template regular item E D U T i S T N O C https://www.zabbix.com/documentation/6.0/manual/discovery/low_level_discovery 6.0 Certified Professional...

LLD - GRAPH PROTOTYPES Graph prototypes: Y P A name must be unique - use {#LLD.MACRO} Graphs can include: Same LLD rule item prototypes Any host/template regular item E D U T i S T N O C https://www.zabbix.com/documentation/6.0/manual/discovery/low_level_discovery 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 64 Y P T N O C E D Low-level Discovery U Filters T S 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved 15 minutes 65 LOW-LEVEL DISCOVERY(LLD) - FILTERS By default, discovery rules return every discovered object: Y P zabbix_agent2 -t vfs.fs.discovery [s|[{"{#FSNAME}":"/sys","{#FSTYPE}":"sysfs"},{"{#FSNAME}":"/dev","{#FSTYPE}":"devtmpfs"},{"{#FSNAME}" :"/dev/pts","{#FSTYPE}":"devpts"},{"{#FSNAME}":"/var","{#FSFSTYPE}":"xfs"},{"{#FSNAME}":"/dev/mqueue" ,"{#FSTYPE}":"mqueue"},{"{#FSNAME}":"/sys/fs/binfmt_misc","{#FSTYPE}":"autofs"},{"{#FSNAME}":"/sys/ke rnel/debug","{#FSTYPE}":"debugfs"},{"{#FSNAME}":"/log","{#FSTYPE}":"ext4"}]] T N O C Many of these objects may not be needed and can be filtered out Discovery rule E D Discovered objects U T vfs.fs.discovery S 6.0 Certified Professional ● Day 2 /var Discovery filter {#FSNAME}=/var,/log Items created vfs.fs.size[/var,free] /dev /log vfs.fs.size[/log,free] /sys © 2023 by Zabbix. All rights reserved Theory 66 LOW-LEVEL DISCOVERY (LLD) - FILTERS Filters tab contains filter definitions: Y P Regular expression (PCRE regex) User macro (Host, Template, Global) Global regular expression E D U T S ! T N O C Recommended to keep regex for filters in user macros on Template 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 67 FILTER CALCULATION The following options for calculating filters are available: Y P And - all filters must be passed; Or - enough if one filter is passed; O C And/Or - uses "And" with different macro names and "Or" with the same macro name Custom expression - defines a custom calculation of filters T N Objects that are filtered out will be treated as not discovered at all: E D Filtering is applied every time discovery rule is executed Errors in filters may remove thousands of items by accident (if "keep lost resources" = 0) U T S The following filter condition operators are available: matches, does not match - expects PCRE regular expression exists, does not exist - based on the presence or absence of the specified LLD macro 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 68 PRACTICAL SETUP Y P 1) Create a new filter on the "Training Low-level discovery" template Discover only eth* and loopback interfaces Apply user macro to define the LLD filter 2) Make sure that the filter works T N 3) Clean up lost items E D U T S 6.0 Certified Professional ● Day 2 O C © 2023 by Zabbix. All rights reserved 10 minutes Practical task No: 12 69 Y P T N O C E D Low-level Discovery U T Overrides S 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved 15 minutes 70 LOW-LEVEL DISCOVERY (LLD) - OVERRIDES Overrides: Y P Allow to set rules to modify attributes for discovered objects that meet given criteria Are displayed on a reorderable drag-and-drop list O C Override rules are based on filters matching LLD macros E D U T i S T N https://www.zabbix.com/documentation/.../discovery/low_level_discovery#override 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 71 OVERRIDE OPERATIONS Name field defines the override name Y P Filter field is used to check LLD macro: Against regular expression Checks if the macro is defined at all O C One or more operations will be executed, if the filter condition is matched E D U T S 6.0 Certified Professional ● Day 2 T N © 2023 by Zabbix. All rights reserved Theory 72 LOW-LEVEL DISCOVERY (LLD) - OVERRIDES Override operations: Y P Affect the entities created by the LLD rule: Items Triggers Graphs Hosts created from the host prototypes Condition - checks the entity name pattern E D Equals / Does not equal Contains / Does not contain Matches / Does not match U T S T N O C Change Attributes for discovered objects that meet given criteria: Create enabled (Yes /No) Discover (Yes / No) Other attributes specific to the entity (history storage period, trigger severity, etc.) 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 73 LOW-LEVEL DISCOVERY (LLD) - OVERRIDES Overrides are executed in that order, in which they are defined: Y P If filter matches, an override is applied Depending on the "Continue overrides" setting (Yes/No), subsequent overrides will be processed E D Filter U T No match S Match Match 6.0 Certified Professional ● Day 2 T N O C Continue Overrides Stop Processing Override 1 Override 1 Override 2 Override 2 Override 3 Override 3 © 2023 by Zabbix. All rights reserved Theory 74 PRACTICAL SETUP Y P 1) Add a new dummy network interface “trunk” 2) Create a trigger prototype for the Network interface discovery rule Name: Severity: Expression: O C Heavy traffic on interface {#IFNAME} Warning Incoming or Outgoing traffic for 10 minutes > 1G T N 3) Manually execute the Network interfaces discovery rule E D 4) Create overrides: Triggers for trunk ports - severity changed to High Triggers for the loopback interface - do not create triggers U T 5) Manually execute Network interfaces discovery rule Check triggers on your student-XX host S 6.0 Certified Professional Day ● Day 2 2 © 2023 by Zabbix. All rights reserved 20m Practical task No: 13 75 Y P T N O C E D Discovery Using Dependent Items U T S 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved 30 minutes 76 DISCOVERY USING DEPENDENT ITEMS An item can have a dependent discovery rule: Y P Discovery rule type: Dependent item The rule is updated every time the master item collects data E D U T S 6.0 Certified Professional ● Day 2 T N O C © 2023 by Zabbix. All rights reserved Theory 77 DISCOVERY USING DEPENDENT ITEMS A discovery rule can create dependent items, which may depend on: Y P A regular item in the same host/template An item created from a prototype by the same discovery rule E D U T S 6.0 Certified Professional ● Day 2 T N O C © 2023 by Zabbix. All rights reserved Theory 78 DISCOVERY USING DEPENDENT ITEMS Master item data can be used: Y P To discover entities (items, triggers, graphs) To fill discovered items with values Master item Data entry Data entry U T S Data entry T N E D Data entry Data entry Discovery data Data values O C Dependent LLD Rule Dependent item prototype Dependent item management Dependent items Item 1 Data entry Item 2 Data entry Item ... 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 79 PREPROCESSING - DEPENDENT ITEMS If a history is set to [Do not keep history], the master item will populate only dependent items Y P T N O C In the item list dependent items are displayed with their master item name as a prefix U T E D Without preprocessing, the dependent item value will be exactly the same as the master item S It is possible to create a dependent item from another dependent item (up to 3 levels are supported) 6.0 Certified Professional ● Day 2 © 2023 by Zabbix. All rights reserved Theory 80 PRACTICAL SETUP Y P 1) Create a new item on the "Training Low-level discovery" template Collect the the raw data of the file system using "vfs.fs.get" item key 2) Create a dependent discovery rule Discover filesystems using data collected by the item T N 3) Create item prototypes to monitor Total space on all the filesystems Free space on all the filesystems O C E D 4) Exclude the /run/* and /tmp/* filesystems from monitoring Apply user macro to define the LLD filter Delete data that is filtered out U T S 6.0 Certified Professional Day ● Day 2 2 © 2023 by Zabbix. All rights reserved 20 minutes Practical task No: 14 81 Y P E D LLD Preprocessing U T S 6.0 Certified Professional ● Day 2 T N O C © 2023 by Zabbix. All rights reserved 10 minutes 82 DISCOVERY USING DEPENDENT ITEMS Add Discard unchanged with a heartbeat preprocessing step to the LLD rule Choose reasonable heartbeat interval such as 1 hour or even 1 day Master item Data entry Discovery data Discard unchanged with heartbeat E D Data entry Data entry U T S Data entry O C Dependent item prototype T N Data entry Data values Dependent item management Dependent items Item 1 Data entry Item 2 Data entry Item ... 6.0 Certified Professional ● Day 2 Y P Dependent LLD Rule © 2023 by Zabbix. All rights reserved Theory 83

Use Quizgecko on...
Browser
Browser