-
New Feature Request
-
Resolution: Duplicate
-
Trivial
-
None
-
6.0.0
-
None
-
Zabbix 6.0.0
Hi Alexei,
User macros within item names is used within Zabbix supplied templates (such as IIS) for cases where configurable items (i.e. ports, users, file paths etc...) may be included in the item name for information purposes for example:
- Template (IIS by Zabbix agent)
- Item Name = IIS: {$IIS.PORT} port ping
- Template ('IIS by Zabbix agent active')
- Item Name = IIS: {$IIS.PORT} port ping
- Template (Oracle by ODBC)
- Item Name = Oracle: Sessions locked over {$ORACLE.SESSION.LOCK.MAX.TIME}s
- Item Name = Oracle: User '{$ORACLE.USER}' expire password
- Template (Oracle by Zabbix agent 2)
- Item Name = Oracle: Sessions locked over {$ORACLE.SESSION.LOCK.MAX.TIME}s
We use it also in this way mainly for:
- Port monitoring - using the port number in the name.
- Macro Name = {$APP.POSTGRES.POSTGRESQL.CONF.PORT:"postmaster"}
- Macro Value = 5432
- Item Name = Process - Listening {$APP.POSTGRES.POSTGRESQL.CONF.PORT:"postmaster"}/TCP (postmaster)
- Item Name Displayed = Process - Listening 5432/TCP (postmaster)
- Logfile monitoring - using the port number in the name.
- Macro Name = {$OS.SYSTEM_LOGFILE.CONF.PATH:"messages"}
- Macro Value = /var/log/messages
- Item Name = System Logfile ({$OS.SYSTEM_LOGFILE.CONF.PATH:"messages"})
- Item Name Displayed = System Logfile (/var/log/messages)
The concept is that user macros should be used for things that may be configurable like the above where they may be different on each monitored host such as:
- System log file locations may change per OS
- Applications / Databases may be configured to listen on different ports.
- Applications may be configured to run as different users.
You could just 'hard-code' the item name like 'Process Listening (postmaster)' but this would mean that the support engineer when looking at latest data make assumptions about what port is being checked or look at the actual item key to see what the port number is. This is probably not ideal.
Regards
James