Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Khaliev <vyacheslav.khaliev@zabbix.com>2022-04-13 23:54:34 +0300
committerVyacheslav Khaliev <vyacheslav.khaliev@zabbix.com>2022-04-13 23:57:02 +0300
commitf78c77f1e155f4f159e07fe5a6eae18a1b04d37f (patch)
tree59342355260c558cbb1252fe2aaa1343125ec3d0
parent2d7f88139541a3584b02c4e2841fa0c87c548f11 (diff)
parent770543cf107b9021b98b9bd645d37a70a3233b8a (diff)
.........T [ZBXNEXT-7582] updated to latest origin
-rw-r--r--ChangeLog34
-rw-r--r--ChangeLog.d/bugfix/ZBX-204581
-rw-r--r--ChangeLog.d/bugfix/ZBX-205451
-rw-r--r--ChangeLog.d/bugfix/ZBX-206581
-rw-r--r--ChangeLog.d/bugfix/ZBX-207821
-rw-r--r--ChangeLog.d/bugfix/ZBX-208211
-rw-r--r--ChangeLog.d/bugfix/ZBX-208441
-rw-r--r--ChangeLog.d/feature/ZBXNEXT-55801
-rw-r--r--ChangeLog.d/feature/ZBXNEXT-74771
-rw-r--r--ChangeLog.d/feature/ZBXNEXT-75641
-rw-r--r--build.xml22
-rw-r--r--configure.ac2
-rw-r--r--include/common.h1
-rw-r--r--include/version.h4
-rw-r--r--include/zbxalgo.h1
-rw-r--r--sass/stylesheets/sass/screen.scss3
-rw-r--r--src/go/pkg/uri/uri.go11
-rw-r--r--src/go/pkg/uri/uri_test.go187
-rw-r--r--src/go/pkg/version/version.go4
-rw-r--r--src/go/pkg/zbxcmd/zbxcmd_nix.go5
-rwxr-xr-xsrc/go/plugins/postgres/conn.go16
-rw-r--r--src/go/plugins/smart/smart.go270
-rw-r--r--src/go/plugins/smart/smart_nix.go2
-rw-r--r--src/go/plugins/smart/smart_test.go422
-rw-r--r--src/go/plugins/smart/smartfs.go125
-rw-r--r--src/libs/zbxalgo/linked_list.c31
-rw-r--r--src/libs/zbxcommon/str.c2
-rw-r--r--src/libs/zbxdbcache/dbconfig.c1
-rw-r--r--src/libs/zbxexec/execute.c15
-rw-r--r--src/libs/zbxicmpping/icmpping.c2
-rw-r--r--src/libs/zbxnix/daemon.c28
-rw-r--r--src/zabbix_agent/active.c3
-rw-r--r--src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java2
-rw-r--r--src/zabbix_js/zabbix_js.c3
-rw-r--r--src/zabbix_sender/zabbix_sender.c3
-rw-r--r--src/zabbix_server/escalator/escalator.c2
-rw-r--r--src/zabbix_server/ha/ha_manager.c102
-rw-r--r--src/zabbix_server/lld/lld_item.c10
-rw-r--r--src/zabbix_server/poller/checks_external.c10
-rw-r--r--src/zabbix_server/poller/poller.c3
-rw-r--r--src/zabbix_server/preprocessor/preproc_manager.c105
-rw-r--r--src/zabbix_server/scripts/scripts.c7
-rw-r--r--templates/app/openweathermap_http/README.md6
-rw-r--r--templates/app/openweathermap_http/template_app_openweathermap_http.yaml6
-rw-r--r--templates/app/pfsense_snmp/README.md70
-rw-r--r--templates/app/pfsense_snmp/template_app_pfsense_snmp.yaml140
-rw-r--r--templates/app/proxmox/README.md145
-rw-r--r--templates/app/proxmox/template_app_proxmox.yaml2401
-rw-r--r--templates/app/rabbitmq_agent/README.md4
-rw-r--r--templates/app/rabbitmq_http/README.md4
-rw-r--r--templates/app/truenas_snmp/README.md199
-rw-r--r--templates/app/truenas_snmp/template_app_truenas_snmp.yaml3789
-rw-r--r--templates/media/glpi/README.md67
-rw-r--r--templates/media/glpi/images/1.pngbin0 -> 11449 bytes
-rw-r--r--templates/media/glpi/images/1.thumb.pngbin0 -> 22093 bytes
-rw-r--r--templates/media/glpi/images/2.pngbin0 -> 5910 bytes
-rw-r--r--templates/media/glpi/images/2.thumb.pngbin0 -> 12109 bytes
-rw-r--r--templates/media/glpi/images/3.pngbin0 -> 37864 bytes
-rw-r--r--templates/media/glpi/images/3.thumb.pngbin0 -> 51848 bytes
-rw-r--r--templates/media/glpi/media_glpi.yaml375
-rw-r--r--templates/module/host_resources_snmp/README.md8
-rw-r--r--templates/module/host_resources_snmp/template_module_host_resources_snmp.yaml42
-rw-r--r--templates/module/linux/README.md10
-rw-r--r--templates/module/linux/template_module_linux.yaml30
-rw-r--r--templates/module/linux_active/README.md10
-rw-r--r--templates/module/linux_active/template_module_linux_active.yaml30
-rw-r--r--templates/module/linux_snmp_snmp/README.md14
-rw-r--r--templates/module/linux_snmp_snmp/template_module_linux_snmp_snmp.yaml34
-rw-r--r--templates/module/windows_agent/README.md10
-rw-r--r--templates/module/windows_agent/template_module_windows_agent.yaml28
-rw-r--r--templates/module/windows_agent_active/README.md10
-rw-r--r--templates/module/windows_agent_active/template_module_windows_agent_active.yaml28
-rw-r--r--templates/net/arista_snmp/README.md4
-rw-r--r--templates/net/arista_snmp/template_net_arista_snmp.yaml24
-rw-r--r--templates/net/mellanox_snmp/README.md4
-rw-r--r--templates/net/mellanox_snmp/template_net_mellanox_snmp.yaml24
-rw-r--r--templates/os/linux/README.md10
-rw-r--r--templates/os/linux/template_os_linux.yaml30
-rw-r--r--templates/os/linux_active/README.md10
-rw-r--r--templates/os/linux_active/template_os_linux_active.yaml30
-rw-r--r--templates/os/linux_prom/README.md10
-rw-r--r--templates/os/linux_prom/template_os_linux_prom.yaml30
-rw-r--r--templates/os/linux_snmp_snmp/README.md14
-rw-r--r--templates/os/linux_snmp_snmp/template_os_linux_snmp_snmp.yaml36
-rw-r--r--templates/os/windows_agent/README.md10
-rw-r--r--templates/os/windows_agent/template_os_windows_agent.yaml28
-rw-r--r--templates/os/windows_agent_active/README.md10
-rw-r--r--templates/os/windows_agent_active/template_os_windows_agent_active.yaml28
-rw-r--r--templates/os/windows_snmp/README.md10
-rw-r--r--templates/os/windows_snmp/template_os_windows_snmp.yaml24
-rw-r--r--ui/app/controllers/CControllerActionOperationValidate.php2
-rw-r--r--ui/app/controllers/CControllerDashboardWidgetEdit.php7
-rw-r--r--ui/app/controllers/CControllerImageCreate.php3
-rw-r--r--ui/app/controllers/CControllerImageUpdate.php3
-rw-r--r--ui/app/controllers/CControllerNotificationsGet.php9
-rw-r--r--ui/app/controllers/CControllerPopupAcknowledgeEdit.php2
-rw-r--r--ui/app/controllers/CControllerPopupConditionCommon.php7
-rw-r--r--ui/app/controllers/CControllerPopupDiscoveryCheck.php3
-rw-r--r--ui/app/controllers/CControllerPopupGeneric.php4
-rw-r--r--ui/app/controllers/CControllerPopupMassupdateHost.php8
-rw-r--r--ui/app/controllers/CControllerProfileUpdate.php4
-rw-r--r--ui/app/controllers/CControllerWidgetIteratorGraphPrototypeView.php7
-rw-r--r--ui/app/controllers/CControllerWidgetTopHostsView.php85
-rw-r--r--ui/app/partials/layout.htmlpage.header.php4
-rw-r--r--ui/app/views/configuration.host.list.php8
-rw-r--r--ui/app/views/js/popup.massupdate.js.php30
-rw-r--r--ui/app/views/js/popup.tophosts.column.edit.js.php33
-rw-r--r--ui/app/views/popup.generic.php19
-rw-r--r--ui/app/views/popup.lldoperation.php3
-rw-r--r--ui/app/views/popup.massupdate.host.php3
-rw-r--r--ui/app/views/popup.massupdate.item.php3
-rw-r--r--ui/app/views/popup.massupdate.service.php3
-rw-r--r--ui/app/views/popup.massupdate.template.php3
-rw-r--r--ui/app/views/popup.massupdate.trigger.php3
-rw-r--r--ui/app/views/popup.tophosts.column.edit.php30
-rw-r--r--ui/app/views/system.warning.php4
-rw-r--r--ui/assets/styles/blue-theme.css2
-rw-r--r--ui/assets/styles/dark-theme.css2
-rw-r--r--ui/assets/styles/hc-dark.css2
-rw-r--r--ui/assets/styles/hc-light.css2
-rw-r--r--ui/graphs.php3
-rw-r--r--ui/httpconf.php3
-rw-r--r--ui/include/classes/api/clients/CLocalApiClient.php3
-rw-r--r--ui/include/classes/api/services/CDiscoveryRule.php2
-rw-r--r--ui/include/classes/api/services/CItem.php2
-rw-r--r--ui/include/classes/api/services/CMediatype.php2
-rw-r--r--ui/include/classes/api/services/CUser.php4
-rw-r--r--ui/include/classes/core/APP.php4
-rw-r--r--ui/include/classes/data/CItemData.php85
-rw-r--r--ui/include/classes/db/MysqlDbBackend.php29
-rw-r--r--ui/include/classes/db/PostgresqlDbBackend.php2
-rw-r--r--ui/include/classes/graphdraw/CLineGraphDraw.php23
-rw-r--r--ui/include/classes/html/CCol.php4
-rw-r--r--ui/include/classes/html/CFilter.php4
-rw-r--r--ui/include/classes/html/CInput.php1
-rw-r--r--ui/include/classes/html/CNavigationTree.php1
-rw-r--r--ui/include/classes/html/CPatternSelect.php12
-rw-r--r--ui/include/classes/html/CRangeControl.php1
-rw-r--r--ui/include/classes/html/CRow.php20
-rw-r--r--ui/include/classes/html/CSup.php2
-rw-r--r--ui/include/classes/html/CTable.php2
-rw-r--r--ui/include/classes/html/CTextBox.php1
-rw-r--r--ui/include/classes/html/CVisibilityBox.php5
-rw-r--r--ui/include/classes/html/pageheader/CPageHeader.php13
-rw-r--r--ui/include/classes/html/svg/CSvg.php2
-rw-r--r--ui/include/classes/html/svg/CSvgCircle.php2
-rw-r--r--ui/include/classes/html/svg/CSvgGraphAnnotation.php1
-rw-r--r--ui/include/classes/html/svg/CSvgGraphGrid.php2
-rw-r--r--ui/include/classes/html/svg/CSvgGroup.php2
-rw-r--r--ui/include/classes/html/svg/CSvgLine.php2
-rw-r--r--ui/include/classes/html/svg/CSvgPolygon.php2
-rw-r--r--ui/include/classes/html/svg/CSvgRect.php2
-rw-r--r--ui/include/classes/html/svg/CSvgText.php2
-rw-r--r--ui/include/classes/ldap/CLdap.php6
-rw-r--r--ui/include/classes/mvc/CControllerResponse.php4
-rw-r--r--ui/include/classes/setup/CFrontendSetup.php6
-rw-r--r--ui/include/classes/validators/CHistFunctionValidator.php11
-rw-r--r--ui/include/classes/widgets/CWidgetHelper.php5
-rw-r--r--ui/include/classes/widgets/fields/CWidgetFieldHostPatternSelect.php1
-rw-r--r--ui/include/classes/widgets/views/js/widget.tophosts.form.view.js.php9
-rw-r--r--ui/include/classes/widgets/views/widget.tophosts.form.view.php5
-rw-r--r--ui/include/db.inc.php117
-rw-r--r--ui/include/defines.inc.php4
-rw-r--r--ui/include/forms.inc.php8
-rw-r--r--ui/include/js.inc.php43
-rw-r--r--ui/include/page_header.php4
-rw-r--r--ui/include/views/configuration.item.list.php2
-rw-r--r--ui/include/views/configuration.item.prototype.list.php4
-rw-r--r--ui/include/views/configuration.trigger.prototype.list.php4
-rw-r--r--ui/include/views/configuration.triggers.list.php4
-rw-r--r--ui/include/views/general.browserwarning.php4
-rw-r--r--ui/include/views/general.warning.php4
-rw-r--r--ui/include/views/js/configuration.host.discovery.edit.overr.js.php1
-rw-r--r--ui/js/class.calendar.js1
-rw-r--r--ui/js/class.cmap.js1
-rw-r--r--ui/js/common.js45
-rw-r--r--ui/js/functions.js30
-rw-r--r--ui/js/hostinterfacemanager.js9
-rw-r--r--ui/jsrpc.php22
-rw-r--r--ui/setup.php6
-rw-r--r--ui/tests/api_json/testAPIInfo.php2
-rw-r--r--ui/tests/include/CTest.php2
-rw-r--r--ui/tests/include/web/elements/COverlayDialogElement.php4
-rw-r--r--ui/tests/selenium/SeleniumTests.php2
-rw-r--r--ui/tests/selenium/dashboard/testDashboardCopyWidgets.php123
-rw-r--r--ui/tests/selenium/dashboard/testDashboardDynamicItemWidgets.php12
-rw-r--r--ui/tests/selenium/dashboard/testDashboardItemValueWidget.php921
-rw-r--r--ui/tests/selenium/data/data_test.sql190
-rw-r--r--ui/tests/selenium/testFormSetup.php6
-rw-r--r--ui/tests/selenium/testLanguage.php32
-rw-r--r--ui/tests/selenium/testPageDashboardList.php6
-rw-r--r--ui/tests/selenium/testPageHosts.php4
-rw-r--r--ui/tests/selenium/users/testFormUserProfile.php7
-rw-r--r--ui/tests/unit/include/classes/core/CRegistryFactoryTest.php7
194 files changed, 10421 insertions, 1043 deletions
diff --git a/ChangeLog b/ChangeLog
index fec9975ac20..a1a8af8dad9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+Changes for 6.0.4rc1
+
+New features:
+.........T [ZBXNEXT-7506] added Proxmox Virtual Environment template (abakaldin)
+..F....... [ZBXNEXT-7472] added support of text data for top hosts widget (agriscenko)
+.........T [ZBXNEXT-7505] added new GLPi media type (abiba)
+...G.....T [ZBXNEXT-7559] updated smart.disk.discovery and smart.disk.get metrics for Zabbix agent 2 and updated S.M.A.R.T passive and active templates (abiba, esneiders)
+.........T [ZBXNEXT-7507] added TrueNAS template (vkhaliev)
+
+Bug fixes:
+...G...... [ZBX-20754] fixed Zabbix sender and Zabbix js not releasing semaphores upon exit (vso)
+...G...... [ZBX-20538] changed postgres plugin to handle connection per user and not per database for Zabbix agent 2 (esneiders)
+.......PS. [ZBX-20567] improved preprocessor queue performance with items taking long time to preprocess (wiper)
+...G...PS. [ZBX-20398] added mitigation for pid file not being created in time (MVekslers, yurii)
+..F....... [ZBX-19638] fixed incorrect host name in graph prototype widget when graph have items from separate hosts (rlataria)
+........S. [ZBX-20595] fixed server discovering dependent item with prototype as master item if prototype discovery was disabled with lld overrides (wiper)
+.........T [ZBX-18522] updated readme for rabbitmq templates (vkhaliev)
+........S. [ZBX-20794] fixed unavailable node status update at server startup (wiper)
+
+--------------------------------------------------------------------------------
Changes for 6.0.3
6.0.3rc1 was released as 6.0.3 without any changes
@@ -1814,6 +1834,20 @@ A......... [ZBX-17955] fixed "medias" parameter named inconsistency in user.crea
.......PS. [ZBX-17548] don't store text items with history 0 in proxy history (wiper)
--------------------------------------------------------------------------------
+Changes for 5.0.23rc1
+
+New features:
+...G.....T [ZBXNEXT-7559] updated smart.disk.discovery and smart.disk.get metrics for Zabbix agent 2 and updated S.M.A.R.T passive and active templates (abiba, esneiders)
+
+Bug fixes:
+...G...... [ZBX-20538] changed postgres plugin to handle connection per user and not per database for Zabbix agent 2 (esneiders)
+.......PS. [ZBX-20567] improved preprocessor queue performance with items taking long time to preprocess (wiper)
+...G...PS. [ZBX-20398] added mitigation for pid file not being created in time (MVekslers, yurii)
+........S. [ZBX-20595] fixed server discovering dependent item with prototype as master item if prototype discovery was disabled with lld overrides (wiper)
+..F....... [ZBX-19638] fixed incorrect host name in graph prototype widget when graph have items from separate hosts (rlataria)
+.........T [ZBX-18522] updated readme for rabbitmq templates (vkhaliev)
+
+--------------------------------------------------------------------------------
Changes for 5.0.22
5.0.22rc1 was released as 5.0.22 without any changes
diff --git a/ChangeLog.d/bugfix/ZBX-20458 b/ChangeLog.d/bugfix/ZBX-20458
new file mode 100644
index 00000000000..51caa2d355e
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20458
@@ -0,0 +1 @@
+..F....... [ZBX-20458] fixed incorrect view of disabled range slider in firefox (rdetlavs)
diff --git a/ChangeLog.d/bugfix/ZBX-20545 b/ChangeLog.d/bugfix/ZBX-20545
new file mode 100644
index 00000000000..9af564dcbbe
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20545
@@ -0,0 +1 @@
+..F....... [ZBX-20545] fixed trend storage period field wrong appearance when item type of information is character/text/log (rdetlavs)
diff --git a/ChangeLog.d/bugfix/ZBX-20658 b/ChangeLog.d/bugfix/ZBX-20658
new file mode 100644
index 00000000000..cdda1a5ea9c
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20658
@@ -0,0 +1 @@
+..F....... [ZBX-20658] fixed missing CR (carriage return) characters in line endings, in popup forms (averza)
diff --git a/ChangeLog.d/bugfix/ZBX-20782 b/ChangeLog.d/bugfix/ZBX-20782
new file mode 100644
index 00000000000..ae290d820c3
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20782
@@ -0,0 +1 @@
+..F....... [ZBX-20782] fixed non unique ids browser console errors when executing Mass update action (rdetlavs)
diff --git a/ChangeLog.d/bugfix/ZBX-20821 b/ChangeLog.d/bugfix/ZBX-20821
new file mode 100644
index 00000000000..ff589e1231b
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20821
@@ -0,0 +1 @@
+..F....... [ZBX-20821] fixed required php version in setup (acikuns)
diff --git a/ChangeLog.d/bugfix/ZBX-20844 b/ChangeLog.d/bugfix/ZBX-20844
new file mode 100644
index 00000000000..6b6b0984695
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-20844
@@ -0,0 +1 @@
+.......PS. [ZBX-20844] fixed external check becoming unsupported when Zabbix server or Zabbix proxy is stopped (vso)
diff --git a/ChangeLog.d/feature/ZBXNEXT-5580 b/ChangeLog.d/feature/ZBXNEXT-5580
new file mode 100644
index 00000000000..322f17cdc85
--- /dev/null
+++ b/ChangeLog.d/feature/ZBXNEXT-5580
@@ -0,0 +1 @@
+.........T [ZBXNEXT-5580] added macros and fixed filesystem utilization triggers for windows, linux and some other templates (vkhaliev)
diff --git a/ChangeLog.d/feature/ZBXNEXT-7477 b/ChangeLog.d/feature/ZBXNEXT-7477
new file mode 100644
index 00000000000..8fc4f0ba7a7
--- /dev/null
+++ b/ChangeLog.d/feature/ZBXNEXT-7477
@@ -0,0 +1 @@
+..F....... [ZBXNEXT-7477] updated MySQL database error handling for PHP 8 (averza, jfreibergs)
diff --git a/ChangeLog.d/feature/ZBXNEXT-7564 b/ChangeLog.d/feature/ZBXNEXT-7564
new file mode 100644
index 00000000000..ec5e5a1af0a
--- /dev/null
+++ b/ChangeLog.d/feature/ZBXNEXT-7564
@@ -0,0 +1 @@
+..F....... [ZBXNEXT-7564] fixed media type importing in PHP 8 (rdetlavs)
diff --git a/build.xml b/build.xml
index 0ec62f796e8..ce9d638eb7f 100644
--- a/build.xml
+++ b/build.xml
@@ -288,27 +288,27 @@
<target name="create-db-mysql" depends="drop-db-mysql">
<!-- Create MySQL database -->
<exec executable="mysql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="--execute='create database ${dbname} character set utf8mb4 collate utf8mb4_bin'"/>
</exec>
<exec executable="mysql" input="database/mysql/schema.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
<exec executable="mysql" input="database/mysql/images.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
<exec executable="mysql" input="database/mysql/data.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
@@ -316,9 +316,9 @@
<target name="drop-db-mysql">
<!-- Drop MySQL database -->
<exec executable="mysql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="--execute='drop database if exists ${dbname}'"/>
</exec>
</target>
@@ -326,48 +326,48 @@
<target name="init-proxy-mysql" depends="">
<!-- Create MySQL database -->
<exec executable="mysql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="--execute='drop database if exists ${dbname}_proxy'"/>
</exec>
<exec executable="mysql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="--execute='create database ${dbname}_proxy character set utf8mb4 collate utf8mb4_bin'"/>
</exec>
<exec executable="mysql" input="database/mysql/schema.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}_proxy"/>
</exec>
</target>
<target name="init-frontend-mysql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,create-db-mysql,init-frontend-modules">
<exec executable="mysql" input="ui/tests/selenium/data/data_test.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-api-mysql" depends="create-configs,make-dbschema,create-db-mysql">
<exec executable="mysql" input="ui/tests/api_json/data/data_test.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-integration-mysql" depends="create-configs,init-integration,make-binaries-mysql,create-db-mysql,init-proxy-mysql">
<exec executable="mysql" input="ui/tests/integration/data/data_test.sql" failonerror="on">
+ <env key="MYSQL_PWD" value="${dbpassword}"/>
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
- <arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
diff --git a/configure.ac b/configure.ac
index 748e2989d5c..358de3eb4d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([Zabbix],[6.0.3])
+AC_INIT([Zabbix],[6.0.4rc1])
AC_CONFIG_SRCDIR(src/zabbix_server/server.c)
AM_INIT_AUTOMAKE([subdir-objects filename-length-max=99])
diff --git a/include/common.h b/include/common.h
index 156c5bbcf8f..513d00d84bc 100644
--- a/include/common.h
+++ b/include/common.h
@@ -98,6 +98,7 @@ extern char ZABBIX_EVENT_SOURCE[ZBX_SERVICE_NAME_LEN];
#define AGENT_ERROR -5
#define GATEWAY_ERROR -6
#define CONFIG_ERROR -7
+#define SIG_ERROR -8
#define SUCCEED_OR_FAIL(result) (FAIL != (result) ? SUCCEED : FAIL)
const char *zbx_sysinfo_ret_string(int ret);
diff --git a/include/version.h b/include/version.h
index 8c7da25629f..5b214d31df9 100644
--- a/include/version.h
+++ b/include/version.h
@@ -27,7 +27,7 @@
#define ZABBIX_REVDATE "4 April 2022"
#define ZABBIX_VERSION_MAJOR 6
#define ZABBIX_VERSION_MINOR 0
-#define ZABBIX_VERSION_PATCH 3
+#define ZABBIX_VERSION_PATCH 4
#ifndef ZABBIX_VERSION_REVISION
# define ZABBIX_VERSION_REVISION {ZABBIX_REVISION}
#endif
@@ -36,7 +36,7 @@
# define ZABBIX_VERSION_RC_NUM {ZABBIX_RC_NUM}
# endif
#endif
-#define ZABBIX_VERSION_RC ""
+#define ZABBIX_VERSION_RC "rc1"
#define ZABBIX_VERSION ZBX_STR(ZABBIX_VERSION_MAJOR) "." ZBX_STR(ZABBIX_VERSION_MINOR) "." \
ZBX_STR(ZABBIX_VERSION_PATCH) ZABBIX_VERSION_RC
#define ZABBIX_REVISION ZBX_STR(ZABBIX_VERSION_REVISION)
diff --git a/include/zbxalgo.h b/include/zbxalgo.h
index 1779138d8c3..d7b82c09465 100644
--- a/include/zbxalgo.h
+++ b/include/zbxalgo.h
@@ -472,6 +472,7 @@ void zbx_list_iterator_clear(zbx_list_iterator_t *iterator);
int zbx_list_iterator_equal(const zbx_list_iterator_t *iterator1, const zbx_list_iterator_t *iterator2);
int zbx_list_iterator_isset(const zbx_list_iterator_t *iterator);
void zbx_list_iterator_update(zbx_list_iterator_t *iterator);
+void *zbx_list_iterator_remove_next(zbx_list_iterator_t *iterator);
ZBX_PTR_VECTOR_DECL(tags, zbx_tag_t*)
diff --git a/sass/stylesheets/sass/screen.scss b/sass/stylesheets/sass/screen.scss
index 0ac36c7868c..a8b64a57301 100644
--- a/sass/stylesheets/sass/screen.scss
+++ b/sass/stylesheets/sass/screen.scss
@@ -5619,7 +5619,8 @@ $range-input-width: 31px;
}
/* Special styling for WebKit/Blink */
- &::-webkit-slider-thumb {
+ &::-webkit-slider-thumb,
+ &::-moz-range-thumb {
margin-top: 1px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
height: $range-thumb-size;
width: $range-thumb-size;
diff --git a/src/go/pkg/uri/uri.go b/src/go/pkg/uri/uri.go
index 39d8791a18f..a532d0b81d6 100644
--- a/src/go/pkg/uri/uri.go
+++ b/src/go/pkg/uri/uri.go
@@ -97,9 +97,18 @@ func (u *URI) Addr() string {
// String reassembles the URI to a valid URI string.
func (u *URI) String() string {
+ return u.string(u.rawQuery)
+}
+
+// NoQueryString reassembles the URI to a valid URI string with no query.
+func (u *URI) NoQueryString() string {
+ return u.string("")
+}
+
+func (u *URI) string(query string) string {
t := &url.URL{
Scheme: u.scheme,
- RawQuery: u.rawQuery,
+ RawQuery: query,
}
if u.socket != "" {
diff --git a/src/go/pkg/uri/uri_test.go b/src/go/pkg/uri/uri_test.go
index 2a0b4775de7..4e8c8b28574 100644
--- a/src/go/pkg/uri/uri_test.go
+++ b/src/go/pkg/uri/uri_test.go
@@ -153,6 +153,193 @@ func TestURI_String(t *testing.T) {
}
}
+func TestURI_NoQueryString(t *testing.T) {
+ type fields struct {
+ scheme string
+ host string
+ port string
+ rawQuery string
+ socket string
+ user string
+ password string
+ rawUri string
+ path string
+ }
+ tests := []struct {
+ name string
+ fields fields
+ want string
+ }{
+ {
+ "Should return URI with creds. Test 1",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix",
+ password: "a35c2787-6ab4-4f6b-b538-0fcf91e678ed"},
+ "https://zabbix:a35c2787-6ab4-4f6b-b538-0fcf91e678ed@127.0.0.1:8003",
+ },
+ {
+ "Should return URI with creds. Test 2",
+ fields{scheme: "unix", socket: "/tmp/redis.sock", user: "zabbix", password: "secret"},
+ "unix://zabbix:secret@/tmp/redis.sock",
+ },
+ {
+ "Should return URI with user only",
+ fields{scheme: "unix", socket: "/tmp/redis.sock", user: "zabbix"},
+ "unix://zabbix@/tmp/redis.sock",
+ },
+ {
+ "Should return URI with creds containing special characters",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix",
+ password: `!@#$%^&*()_+{}?|\/., -=_+`},
+ "https://zabbix:%21%40%23$%25%5E&%2A%28%29_+%7B%7D%3F%7C%5C%2F.,%20-=_+@127.0.0.1:8003",
+ },
+ {
+ "Should return URI with username",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix"},
+ "https://zabbix@127.0.0.1:8003",
+ },
+ {
+ "Should return URI without creds",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003"},
+ "https://127.0.0.1:8003",
+ },
+ {
+ "Should return URI with path and no query",
+ fields{scheme: "oracle", host: "127.0.0.1", port: "1521", rawQuery: "dbname=XE"},
+ "oracle://127.0.0.1:1521",
+ },
+ {
+ "Should return URI without port",
+ fields{scheme: "https", host: "127.0.0.1"},
+ "https://127.0.0.1",
+ },
+ {
+ "Should return URI with socket",
+ fields{scheme: "unix", socket: "/var/lib/mysql/mysql.sock"},
+ "unix:///var/lib/mysql/mysql.sock",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ u := &URI{
+ scheme: tt.fields.scheme,
+ host: tt.fields.host,
+ port: tt.fields.port,
+ rawQuery: tt.fields.rawQuery,
+ socket: tt.fields.socket,
+ user: tt.fields.user,
+ password: tt.fields.password,
+ rawUri: tt.fields.rawUri,
+ path: tt.fields.path,
+ }
+ if got := u.NoQueryString(); got != tt.want {
+ t.Errorf("URI.NoQueryString() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestURI_string(t *testing.T) {
+ type fields struct {
+ scheme string
+ host string
+ port string
+ rawQuery string
+ socket string
+ user string
+ password string
+ rawUri string
+ }
+ type args struct {
+ query string
+ }
+ tests := []struct {
+ name string
+ fields fields
+ args args
+ want string
+ }{
+ {
+ "Should return URI with creds. Test 1",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix",
+ password: "a35c2787-6ab4-4f6b-b538-0fcf91e678ed"},
+ args{""},
+ "https://zabbix:a35c2787-6ab4-4f6b-b538-0fcf91e678ed@127.0.0.1:8003",
+ },
+ {
+ "Should return URI with creds. Test 2",
+ fields{scheme: "unix", socket: "/tmp/redis.sock", user: "zabbix", password: "secret"},
+ args{""},
+ "unix://zabbix:secret@/tmp/redis.sock",
+ },
+ {
+ "Should return URI with user only",
+ fields{scheme: "unix", socket: "/tmp/redis.sock", user: "zabbix"},
+ args{""},
+ "unix://zabbix@/tmp/redis.sock",
+ },
+ {
+ "Should return URI with creds containing special characters",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix",
+ password: `!@#$%^&*()_+{}?|\/., -=_+`},
+ args{""},
+ "https://zabbix:%21%40%23$%25%5E&%2A%28%29_+%7B%7D%3F%7C%5C%2F.,%20-=_+@127.0.0.1:8003",
+ },
+ {
+ "Should return URI with username",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003", user: "zabbix"},
+ args{""},
+ "https://zabbix@127.0.0.1:8003",
+ },
+ {
+ "Should return URI without creds",
+ fields{scheme: "https", host: "127.0.0.1", port: "8003"},
+ args{""},
+ "https://127.0.0.1:8003",
+ },
+ {
+ "Should return URI with path and no query",
+ fields{scheme: "oracle", host: "127.0.0.1", port: "1521", rawQuery: "dbname=XE"},
+ args{""},
+ "oracle://127.0.0.1:1521",
+ },
+ {
+ "Should return URI with path and with query",
+ fields{scheme: "oracle", host: "127.0.0.1", port: "1521", rawQuery: "dbname=XE"},
+ args{"dbname=XE"},
+ "oracle://127.0.0.1:1521?dbname=XE",
+ },
+ {
+ "Should return URI without port",
+ fields{scheme: "https", host: "127.0.0.1"},
+ args{""},
+ "https://127.0.0.1",
+ },
+ {
+ "Should return URI with socket",
+ fields{scheme: "unix", socket: "/var/lib/mysql/mysql.sock"},
+ args{""},
+ "unix:///var/lib/mysql/mysql.sock",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ u := &URI{
+ scheme: tt.fields.scheme,
+ host: tt.fields.host,
+ port: tt.fields.port,
+ rawQuery: tt.fields.rawQuery,
+ socket: tt.fields.socket,
+ user: tt.fields.user,
+ password: tt.fields.password,
+ rawUri: tt.fields.rawUri,
+ }
+ if got := u.string(tt.args.query); got != tt.want {
+ t.Errorf("string() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
var (
defaults = &Defaults{Scheme: "https", Port: "443"}
defaultsWithoutPort = &Defaults{Scheme: "https"}
diff --git a/src/go/pkg/version/version.go b/src/go/pkg/version/version.go
index 9aaee7d7780..b0735954730 100644
--- a/src/go/pkg/version/version.go
+++ b/src/go/pkg/version/version.go
@@ -29,8 +29,8 @@ const (
ZABBIX_REVDATE = "4 April 2022"
ZABBIX_VERSION_MAJOR = 6
ZABBIX_VERSION_MINOR = 0
- ZABBIX_VERSION_PATCH = 3
- ZABBIX_VERSION_RC = ""
+ ZABBIX_VERSION_PATCH = 4
+ ZABBIX_VERSION_RC = "rc1"
ZABBIX_VERSION_RC_NUM = "{ZABBIX_RC_NUM}"
ZABBIX_VERSION_REVISION = "{ZABBIX_REVISION}"
copyrightMessage = "Copyright (C) 2022 Zabbix SIA\n" +
diff --git a/src/go/pkg/zbxcmd/zbxcmd_nix.go b/src/go/pkg/zbxcmd/zbxcmd_nix.go
index addd629406e..59f83a49303 100644
--- a/src/go/pkg/zbxcmd/zbxcmd_nix.go
+++ b/src/go/pkg/zbxcmd/zbxcmd_nix.go
@@ -1,5 +1,4 @@
//go:build !windows
-// +build !windows
/*
** Zabbix
@@ -65,7 +64,9 @@ func execute(s string, timeout time.Duration, path string, strict bool) (string,
// we need to check error after t.Stop so we can inform the user if timeout was reached and Zabbix agent2 terminated the command
if strict && werr != nil && !errors.Is(werr, syscall.ECHILD) {
- return "", fmt.Errorf("Command execution failed: %s", werr)
+ log.Debugf("Command [%s] execution failed: %s\n%s", s, werr, b.String())
+
+ return "", fmt.Errorf("Command execution failed: %w", werr)
}
if MaxExecuteOutputLenB <= len(b.String()) {
diff --git a/src/go/plugins/postgres/conn.go b/src/go/plugins/postgres/conn.go
index 79ad07a1847..9303393b997 100755
--- a/src/go/plugins/postgres/conn.go
+++ b/src/go/plugins/postgres/conn.go
@@ -58,6 +58,7 @@ type PGConn struct {
lastTimeAccess time.Time
version int
queryStorage *yarn.Yarn
+ address string
}
var errorQueryNotFound = "query %q not found"
@@ -127,7 +128,7 @@ func (conn *PGConn) updateAccessTime() {
type ConnManager struct {
sync.Mutex
connMutex sync.Mutex
- connections map[uri.URI]*PGConn
+ connections map[string]*PGConn
keepAlive time.Duration
connectTimeout time.Duration
callTimeout time.Duration
@@ -141,7 +142,7 @@ func NewConnManager(keepAlive, connectTimeout, callTimeout,
ctx, cancel := context.WithCancel(context.Background())
connMgr := &ConnManager{
- connections: make(map[uri.URI]*PGConn),
+ connections: make(map[string]*PGConn),
keepAlive: keepAlive,
connectTimeout: connectTimeout,
callTimeout: callTimeout,
@@ -163,7 +164,7 @@ func (c *ConnManager) closeUnused() {
if time.Since(conn.lastTimeAccess) > c.keepAlive {
conn.client.Close()
delete(c.connections, uri)
- log.Debugf("[%s] Closed unused connection: %s", pluginName, uri.Addr())
+ log.Debugf("[%s] Closed unused connection: %s", pluginName, conn.address)
}
}
}
@@ -200,7 +201,7 @@ func (c *ConnManager) create(uri uri.URI, details tlsconfig.Details) (*PGConn, e
c.connMutex.Lock()
defer c.connMutex.Unlock()
- if _, ok := c.connections[uri]; ok {
+ if _, ok := c.connections[uri.NoQueryString()]; ok {
// Should never happen.
panic("connection already exists")
}
@@ -248,18 +249,19 @@ func (c *ConnManager) create(uri uri.URI, details tlsconfig.Details) (*PGConn, e
return nil, fmt.Errorf("postgres version %d is not supported", serverVersion)
}
- c.connections[uri] = &PGConn{
+ c.connections[uri.NoQueryString()] = &PGConn{
client: client,
callTimeout: c.callTimeout,
version: serverVersion,
lastTimeAccess: time.Now(),
ctx: ctx,
queryStorage: &c.queryStorage,
+ address: uri.Addr(),
}
log.Debugf("[%s] Created new connection: %s", pluginName, uri.Addr())
- return c.connections[uri], nil
+ return c.connections[uri.NoQueryString()], nil
}
func createTLSClient(dsn string, timeout time.Duration, details tlsconfig.Details) (*sql.DB, error) {
@@ -304,7 +306,7 @@ func (c *ConnManager) get(uri uri.URI) *PGConn {
c.connMutex.Lock()
defer c.connMutex.Unlock()
- if conn, ok := c.connections[uri]; ok {
+ if conn, ok := c.connections[uri.NoQueryString()]; ok {
conn.updateAccessTime()
return conn
}
diff --git a/src/go/plugins/smart/smart.go b/src/go/plugins/smart/smart.go
index f71407b6b97..36bb16d9b8a 100644
--- a/src/go/plugins/smart/smart.go
+++ b/src/go/plugins/smart/smart.go
@@ -21,12 +21,27 @@ package smart
import (
"encoding/json"
+ "fmt"
+ "strings"
"zabbix.com/pkg/conf"
"zabbix.com/pkg/plugin"
"zabbix.com/pkg/zbxerr"
)
+const (
+ twoParameters = 2
+ oneParameter = 1
+ all = 0
+
+ firstParameter = 0
+ secondParameter = 1
+
+ diskGet = "smart.disk.get"
+ diskDiscovery = "smart.disk.discovery"
+ attributeDiscovery = "smart.attribute.discovery"
+)
+
// Options -
type Options struct {
plugin.SystemOptions `conf:"optional,name=System"`
@@ -61,7 +76,7 @@ func (p *Plugin) Validate(options interface{}) error {
// Export -
func (p *Plugin) Export(key string, params []string, ctx plugin.ContextProvider) (result interface{}, err error) {
- if len(params) > 0 {
+ if len(params) > 0 && key != diskGet {
return nil, zbxerr.ErrorTooManyParameters
}
@@ -72,84 +87,217 @@ func (p *Plugin) Export(key string, params []string, ctx plugin.ContextProvider)
var jsonArray []byte
switch key {
- case "smart.disk.discovery":
- out := []device{}
-
- r, err := p.execute(false)
+ case diskDiscovery:
+ jsonArray, err = p.diskDiscovery()
if err != nil {
- return nil, err
- }
-
- for _, dev := range r.devices {
- out = append(out, device{
- Name: cutPrefix(dev.Info.Name),
- DeviceType: getType(dev.Info.DevType, dev.RotationRate, dev.SmartAttributes.Table),
- Model: dev.ModelName, SerialNumber: dev.SerialNumber,
- })
+ return nil, zbxerr.ErrorCannotFetchData.Wrap(err)
}
- jsonArray, err = json.Marshal(out)
+ case diskGet:
+ jsonArray, err = p.diskGet(params)
if err != nil {
- return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ return nil, zbxerr.ErrorCannotFetchData.Wrap(err)
}
- case "smart.disk.get":
- r, err := p.execute(true)
+ case attributeDiscovery:
+ jsonArray, err = p.attributeDiscovery()
if err != nil {
- return nil, err
+ return nil, zbxerr.ErrorCannotFetchData.Wrap(err)
}
- fields, err := setDiskFields(r.jsonDevices)
- if err != nil {
- return nil, err
- }
+ default:
+ return nil, zbxerr.ErrorUnsupportedMetric
+ }
- if fields == nil {
- jsonArray, err = json.Marshal([]string{})
- if err != nil {
- return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
- }
+ return string(jsonArray), nil
+}
- break
- }
+func (p *Plugin) diskDiscovery() (jsonArray []byte, err error) {
+ out := []device{}
+
+ r, err := p.execute(false)
+ if err != nil {
+ return nil, err
+ }
+
+ for _, dev := range r.devices {
+ out = append(out, device{
+ Name: cutPrefix(dev.Info.Name),
+ DeviceType: getType(dev.Info.DevType, dev.RotationRate, dev.SmartAttributes.Table),
+ Model: dev.ModelName,
+ SerialNumber: dev.SerialNumber,
+ Path: dev.Info.name,
+ RaidType: dev.Info.raidType,
+ Attributes: getAttributes(dev),
+ })
+ }
+
+ jsonArray, err = json.Marshal(out)
+ if err != nil {
+ return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ }
+
+ return
+}
+
+func (p *Plugin) diskGet(params []string) ([]byte, error) {
+ switch len(params) {
+ case twoParameters:
+ return p.diskGetSingle(params[firstParameter], params[secondParameter])
+ case oneParameter:
+ return p.diskGetSingle(params[firstParameter], "")
+ case all:
+ return p.diskGetAll()
+ default:
+ return nil, zbxerr.ErrorTooManyParameters
+ }
+}
+
+func (p *Plugin) diskGetSingle(path, raidType string) ([]byte, error) {
+ executable := path
+
+ if raidType != "" {
+ executable = fmt.Sprintf("%s -d %s", executable, raidType)
+ }
+
+ device, err := p.executeSingle(executable)
+ if err != nil {
+ return nil, err
+ }
+
+ out, err := setSingleDiskFields(device)
+ if err != nil {
+ return nil, err
+ }
+
+ jsonArray, err := json.Marshal(out)
+ if err != nil {
+ return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ }
+
+ return jsonArray, nil
+}
+
+func (p *Plugin) diskGetAll() (jsonArray []byte, err error) {
+ r, err := p.execute(true)
+ if err != nil {
+ return nil, err
+ }
- jsonArray, err = json.Marshal(fields)
+ fields, err := setDiskFields(r.jsonDevices)
+ if err != nil {
+ return nil, err
+ }
+
+ if fields == nil {
+ jsonArray, err = json.Marshal([]string{})
if err != nil {
return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
}
- case "smart.attribute.discovery":
- out := []attribute{}
+ return
+ }
- r, err := p.execute(false)
- if err != nil {
- return nil, err
- }
+ jsonArray, err = json.Marshal(fields)
+ if err != nil {
+ return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ }
- for _, dev := range r.devices {
- t := getAttributeType(dev.Info.DevType, dev.RotationRate, dev.SmartAttributes.Table)
- for _, attr := range dev.SmartAttributes.Table {
- out = append(
- out, attribute{
- Name: cutPrefix(dev.Info.Name),
- DeviceType: t,
- ID: attr.ID,
- Attrname: attr.Attrname,
- Thresh: attr.Thresh,
- })
- }
+ return
+}
+
+func (p *Plugin) attributeDiscovery() (jsonArray []byte, err error) {
+ out := []attribute{}
+
+ r, err := p.execute(false)
+ if err != nil {
+ return nil, err
+ }
+
+ for _, dev := range r.devices {
+ t := getAttributeType(dev.Info.DevType, dev.RotationRate, dev.SmartAttributes.Table)
+ for _, attr := range dev.SmartAttributes.Table {
+ out = append(
+ out, attribute{
+ Name: cutPrefix(dev.Info.Name),
+ DeviceType: t,
+ ID: attr.ID,
+ Attrname: attr.Attrname,
+ Thresh: attr.Thresh,
+ })
}
+ }
- jsonArray, err = json.Marshal(out)
- if err != nil {
- return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ jsonArray, err = json.Marshal(out)
+ if err != nil {
+ return nil, zbxerr.ErrorCannotMarshalJSON.Wrap(err)
+ }
+
+ return
+}
+
+// setSingleDiskFields goes through provided device json data and sets required output fields.
+// It returns an error if there is an issue with unmarshal for the provided input JSON map.
+func setSingleDiskFields(dev []byte) (out map[string]interface{}, err error) {
+ attr := make(map[string]interface{})
+ if err = json.Unmarshal(dev, &attr); err != nil {
+ return out, zbxerr.ErrorCannotUnmarshalJSON.Wrap(err)
+ }
+
+ var sd singleDevice
+ if err = json.Unmarshal(dev, &sd); err != nil {
+ return out, zbxerr.ErrorCannotUnmarshalJSON.Wrap(err)
+ }
+
+ diskType := getType(getTypeFromJson(attr), getRateFromJson(attr), getTablesFromJson(attr))
+
+ out = map[string]interface{}{}
+ out["disk_type"] = diskType
+ out["firmware_version"] = sd.Firmware
+ out["model_name"] = sd.ModelName
+ out["serial_number"] = sd.SerialNumber
+ out["exit_status"] = sd.Smartctl.ExitStatus
+
+ var errors []string
+ for _, msg := range sd.Smartctl.Messages {
+ errors = append(errors, msg.Str)
+ }
+
+ out["error"] = strings.Join(errors, ", ")
+ out["self_test_passed"] = setSelfTest(sd)
+
+ if diskType == nvmeType {
+ out["temperature"] = sd.HealthLog.Temperature
+ out["power_on_time"] = sd.HealthLog.PowerOnTime
+ out["critical_warning"] = sd.HealthLog.CriticalWarning
+ out["media_errors"] = sd.HealthLog.MediaErrors
+ out["percentage_used"] = sd.HealthLog.Percentage_used
+ } else {
+ out["temperature"] = sd.Temperature.Current
+ out["power_on_time"] = sd.PowerOnTime.Hours
+ out["critical_warning"] = 0
+ out["media_errors"] = 0
+ out["percentage_used"] = 0
+ }
+
+ for _, a := range sd.SmartAttributes.Table {
+ if a.Name == unknownAttrName {
+ continue
}
- default:
- return nil, zbxerr.ErrorUnsupportedMetric
+ out[strings.ToLower(a.Name)] = singleRequestAttribute{a.Raw.Value, a.Raw.Str}
}
- return string(jsonArray), nil
+ return
+}
+
+// setSelfTest determines if device is self test capable and if the test is passed.
+func setSelfTest(sd singleDevice) *bool {
+ if sd.Data.Capabilities.SelfTestsSupported {
+ return &sd.Data.SelfTest.Status.Passed
+ }
+
+ return nil
}
// setDiskFields goes through provided device json map and sets disk_name
@@ -242,6 +390,18 @@ func getAttributeType(devType string, rate int, tables []table) string {
return getTypeByRateAndAttr(rate, tables)
}
+func getAttributes(in deviceParser) (out string) {
+ for _, table := range in.SmartAttributes.Table {
+ if table.Attrname == unknownAttrName {
+ continue
+ }
+
+ out = out + " " + table.Attrname
+ }
+
+ return strings.TrimSpace(out)
+}
+
func getType(devType string, rate int, tables []table) string {
switch devType {
case nvmeType:
diff --git a/src/go/plugins/smart/smart_nix.go b/src/go/plugins/smart/smart_nix.go
index 447406c1d3b..5e87a39de9c 100644
--- a/src/go/plugins/smart/smart_nix.go
+++ b/src/go/plugins/smart/smart_nix.go
@@ -39,7 +39,7 @@ func (p *Plugin) executeSmartctl(args string, strict bool) ([]byte, error) {
var out string
var err error
- executable := fmt.Sprintf("sudo %s %s", path, args)
+ executable := fmt.Sprintf("sudo -n %s %s", path, args)
p.Tracef("executing smartctl command: %s", executable)
diff --git a/src/go/plugins/smart/smart_test.go b/src/go/plugins/smart/smart_test.go
index eb73c16c8c6..bce0bc96f34 100644
--- a/src/go/plugins/smart/smart_test.go
+++ b/src/go/plugins/smart/smart_test.go
@@ -25,20 +25,390 @@ import (
"testing"
)
+const (
+ nvme = `{
+ "smartctl": {
+ "exit_status": 0
+ },
+ "device": {
+ "name": "/dev/nvme0",
+ "type": "nvme"
+ },
+ "model_name": "INTEL SSDPEKNW512G8H",
+ "serial_number": "BTNH115603K7512A",
+ "firmware_version": "HPS1",
+ "smart_status": {
+ "passed": true
+ },
+ "nvme_smart_health_information_log": {
+ "critical_warning": 0,
+ "temperature": 25,
+ "percentage_used": 0,
+ "power_on_hours": 2222,
+ "media_errors": 0
+ }
+ }`
+
+ hdd = `{
+ "json_format_version": [
+ 1,
+ 0
+ ],
+ "smartctl": {
+ "version": [
+ 7,
+ 2
+ ],
+ "svn_revision": "5155",
+ "platform_info": "x86_64-linux-5.13.0-30-generic",
+ "build_info": "(local build)",
+ "argv": [
+ "smartctl",
+ "-a",
+ "-j",
+ "/dev/sda"
+ ],
+ "exit_status": 0
+ },
+ "device": {
+ "name": "/dev/sda",
+ "info_name": "/dev/sda [SAT]",
+ "type": "sat",
+ "protocol": "ATA"
+ },
+ "model_family": "Seagate Surveillance",
+ "model_name": "ST1000VX000-1ES162",
+ "serial_number": "Z4Y7SJBD",
+ "wwn": {
+ "naa": 5,
+ "oui": 3152,
+ "id": 2071267458
+ },
+ "firmware_version": "CV26",
+ "rotation_rate": 7200,
+ "ata_smart_data": {
+ "self_test": {
+ "status": {
+ "value": 0,
+ "string": "completed without error",
+ "passed": true
+ }
+ },
+ "capabilities": {
+ "self_tests_supported": true
+ }
+ },
+ "ata_smart_attributes": {
+ "table": [
+ {
+ "id": 1,
+ "name": "Raw_Read_Error_Rate",
+ "raw": {
+ "value": 182786912,
+ "string": "182786912"
+ }
+ },
+ {
+ "id": 3,
+ "name": "Spin_Up_Time",
+ "raw": {
+ "value": 0,
+ "string": "0"
+ }
+ }
+ ]
+ },
+ "power_on_time": {
+ "hours": 39153
+ },
+ "temperature": {
+ "current": 30
+ }
+ }`
+
+ ssd = `
+ {
+ "json_format_version": [
+ 1,
+ 0
+ ],
+ "smartctl": {
+ "exit_status": 0
+ },
+ "device": {
+ "name": "/dev/sda",
+ "info_name": "/dev/sda",
+ "type": "ata",
+ "protocol": "ATA"
+ },
+ "model_name": "TS128GMTS800",
+ "serial_number": "D486530350",
+ "firmware_version": "O1225G",
+ "rotation_rate": 0,
+ "smart_status": {
+ "passed": true
+ },
+ "ata_smart_data": {
+ "self_test": {
+ "status": {
+ "passed": true
+ }
+ },
+ "capabilities": {
+ "values": [
+ 113,
+ 2
+ ],
+ "self_tests_supported": true
+ }
+ },
+ "ata_smart_attributes": {
+ "table": [
+ {
+ "name": "Raw_Read_Error_Rate",
+ "value": 100,
+ "raw": {
+ "value": 0,
+ "string": "0"
+ }
+ },
+ {
+ "name": "Reallocated_Sector_Ct",
+ "raw": {
+ "value": 10,
+ "string": "10"
+ }
+ }
+ ]
+ },
+ "power_on_time": {
+ "hours": 732
+ },
+ "temperature": {
+ "current": 18
+ }
+ }`
+
+ ssdUnknown = `
+ {
+ "json_format_version": [
+ 1,
+ 0
+ ],
+ "smartctl": {
+ "exit_status": 0
+ },
+ "device": {
+ "name": "/dev/sda",
+ "info_name": "/dev/sda",
+ "type": "ata",
+ "protocol": "ATA"
+ },
+ "model_name": "TS128GMTS800",
+ "serial_number": "D486530350",
+ "firmware_version": "O1225G",
+ "rotation_rate": 0,
+ "smart_status": {
+ "passed": true
+ },
+ "ata_smart_data": {
+ "self_test": {
+ "status": {
+ "passed": true
+ }
+ },
+ "capabilities": {
+ "values": [
+ 113,
+ 2
+ ],
+ "self_tests_supported": true
+ }
+ },
+ "ata_smart_attributes": {
+ "table": [
+ {
+ "name": "Raw_Read_Error_Rate",
+ "value": 100,
+ "raw": {
+ "value": 0,
+ "string": "0"
+ }
+ },
+ {
+ "name": "Unknown_Attribute",
+ "value": 0,
+ "raw": {
+ "value": 0,
+ "string": "0"
+ }
+ },
+ {
+ "name": "Reallocated_Sector_Ct",
+ "raw": {
+ "value": 10,
+ "string": "10"
+ }
+ }
+ ]
+ },
+ "power_on_time": {
+ "hours": 732
+ },
+ "temperature": {
+ "current": 18
+ }
+ }`
+)
+
var (
table1 = table{"test1", 1, 11}
table2 = table{"test2", 2, 22}
table3 = table{"test3", 3, 33}
table4 = table{"test4", 4, 44}
attrTable = table{"Spin_Up_Time", 5, 55}
+ unknown = table{"Unknown_Attribute", 0, 0}
)
+func Test_setSingleDiskFields(t *testing.T) {
+ var nilReference *bool
+
+ selftestSuccess := true
+
+ type args struct {
+ dev []byte
+ }
+ tests := []struct {
+ name string
+ args args
+ wantOut map[string]interface{}
+ wantErr bool
+ }{
+ {
+ "nvme_device",
+ args{[]byte(nvme)},
+ map[string]interface{}{
+ "critical_warning": 0,
+ "disk_type": "nvme",
+ "error": "",
+ "exit_status": 0,
+ "firmware_version": "HPS1",
+ "media_errors": 0,
+ "model_name": "INTEL SSDPEKNW512G8H",
+ "percentage_used": 0,
+ "power_on_time": 2222,
+ "self_test_passed": nilReference,
+ "serial_number": "BTNH115603K7512A",
+ "temperature": 25,
+ },
+ false,
+ },
+ {
+ "hdd_device",
+ args{[]byte(hdd)},
+ map[string]interface{}{
+ "critical_warning": 0,
+ "disk_type": "hdd",
+ "error": "",
+ "exit_status": 0,
+ "firmware_version": "CV26",
+ "media_errors": 0,
+ "model_name": "ST1000VX000-1ES162",
+ "percentage_used": 0,
+ "power_on_time": 39153,
+ "self_test_passed": &selftestSuccess,
+ "serial_number": "Z4Y7SJBD",
+ "temperature": 30,
+ "raw_read_error_rate": singleRequestAttribute{
+ Value: 182786912,
+ Raw: "182786912",
+ },
+ "spin_up_time": singleRequestAttribute{
+ Value: 0,
+ Raw: "0",
+ },
+ },
+ false,
+ },
+ {
+ "ssd_device",
+ args{[]byte(ssd)},
+ map[string]interface{}{
+ "critical_warning": 0,
+ "disk_type": "ssd",
+ "error": "",
+ "exit_status": 0,
+ "firmware_version": "O1225G",
+ "media_errors": 0,
+ "model_name": "TS128GMTS800",
+ "percentage_used": 0,
+ "power_on_time": 732,
+ "self_test_passed": &selftestSuccess,
+ "serial_number": "D486530350",
+ "temperature": 18,
+ "raw_read_error_rate": singleRequestAttribute{
+ Value: 0,
+ Raw: "0",
+ },
+ "reallocated_sector_ct": singleRequestAttribute{
+ Value: 10,
+ Raw: "10",
+ },
+ },
+ false,
+ },
+ {
+ "ssd_device_with_unknown_attribute",
+ args{[]byte(ssdUnknown)},
+ map[string]interface{}{
+ "critical_warning": 0,
+ "disk_type": "ssd",
+ "error": "",
+ "exit_status": 0,
+ "firmware_version": "O1225G",
+ "media_errors": 0,
+ "model_name": "TS128GMTS800",
+ "percentage_used": 0,
+ "power_on_time": 732,
+ "self_test_passed": &selftestSuccess,
+ "serial_number": "D486530350",
+ "temperature": 18,
+ "raw_read_error_rate": singleRequestAttribute{
+ Value: 0,
+ Raw: "0",
+ },
+ "reallocated_sector_ct": singleRequestAttribute{
+ Value: 10,
+ Raw: "10",
+ },
+ },
+ false,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ gotOut, err := setSingleDiskFields(tt.args.dev)
+ if (err != nil) != tt.wantErr {
+ t.Errorf("setSingleDiskFields() error = %v, wantErr %v", err, tt.wantErr)
+
+ return
+ }
+
+ if !reflect.DeepEqual(gotOut, tt.wantOut) {
+ t.Errorf("setSingleDiskFields() = %v, want %v", gotOut, tt.wantOut)
+ }
+ })
+ }
+}
+
func Test_setDiskFields(t *testing.T) {
- //nolint:lll
- jsonSdaStr := `{"device": {"name": "/dev/sda","info_name": "/dev/sda [SAT]","type": "sat","protocol": "ATA"},"rotation_rate": 0}`
- //nolint:lll
+ jsonSdaStr := `{
+ "device": {"name": "/dev/sda","info_name": "/dev/sda [SAT]","type": "sat","protocol": "ATA"},"rotation_rate": 0
+ }`
sdaOutStr := map[string]interface{}{
- "device": map[string]interface{}{"name": "/dev/sda", "info_name": "/dev/sda [SAT]", "type": "sat", "protocol": "ATA"},
+ "device": map[string]interface{}{
+ "name": "/dev/sda", "info_name": "/dev/sda [SAT]", "type": "sat", "protocol": "ATA",
+ },
"disk_name": "sda", "disk_type": "ssd", "rotation_rate": 0,
}
@@ -196,6 +566,50 @@ func Test_getAttributeType(t *testing.T) {
}
}
+func Test_getAttributes(t *testing.T) {
+ type args struct {
+ in deviceParser
+ }
+ tests := []struct {
+ name string
+ args args
+ want string
+ }{
+ {
+ "attributes_set",
+ args{deviceParser{SmartAttributes: smartAttributes{Table: []table{table1, table2}}}},
+ "test1 test2",
+ },
+ {
+ "attributes_table_empty",
+ args{deviceParser{SmartAttributes: smartAttributes{Table: []table{}}}},
+ "",
+ },
+ {
+ "unknown_attributes_table_empty",
+ args{deviceParser{SmartAttributes: smartAttributes{Table: []table{table1, unknown, table2}}}},
+ "test1 test2",
+ },
+ {
+ "attributes_missing",
+ args{deviceParser{}},
+ "",
+ },
+ {
+ "parser_missing",
+ args{},
+ "",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := getAttributes(tt.args.in); got != tt.want {
+ t.Errorf("getAttributes() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
func Test_getType(t *testing.T) {
type args struct {
devType string
diff --git a/src/go/plugins/smart/smartfs.go b/src/go/plugins/smart/smartfs.go
index a01b87c4422..b695e853ba4 100644
--- a/src/go/plugins/smart/smartfs.go
+++ b/src/go/plugins/smart/smartfs.go
@@ -42,7 +42,8 @@ const (
ssdType = "ssd"
hddType = "hdd"
- spinUpAttrName = "Spin_Up_Time"
+ spinUpAttrName = "Spin_Up_Time"
+ unknownAttrName = "Unknown_Attribute"
ataSmartAttrFieldName = "ata_smart_attributes"
ataSmartAttrTableFieldName = "table"
@@ -68,12 +69,79 @@ type device struct {
DeviceType string `json:"{#DISKTYPE}"`
Model string `json:"{#MODEL}"`
SerialNumber string `json:"{#SN}"`
+ Path string `json:"{#PATH}"`
+ RaidType string `json:"{#RAIDTYPE}"`
+ Attributes string `json:"{#ATTRIBUTES}"`
}
type jsonDevice struct {
serialNumber string
jsonData string
}
+type singleDevice struct {
+ DiskType string `json:"disk_type"`
+ Firmware string `json:"firmware_version"`
+ ModelName string `json:"model_name"`
+ SerialNumber string `json:"serial_number"`
+ Smartctl smartctlField `json:"smartctl"`
+ HealthLog healthLog `json:"nvme_smart_health_information_log"`
+ SmartAttributes singelRequestTables `json:"ata_smart_attributes"`
+ Data ataData `json:"ata_smart_data"`
+ Temperature temperature `json:"temperature"`
+ PowerOnTime power `json:"power_on_time"`
+ Err string `json:"-"`
+ SelfTest bool `json:"-"`
+}
+
+type healthLog struct {
+ Temperature int `json:"temperature"`
+ PowerOnTime int `json:"power_on_hours"`
+ CriticalWarning int `json:"critical_warning"`
+ MediaErrors int `json:"media_errors"`
+ Percentage_used int `json:"percentage_used"`
+}
+
+type temperature struct {
+ Current int `json:"current"`
+}
+
+type power struct {
+ Hours int `json:"hours"`
+}
+
+type singelRequestTables struct {
+ Table []singelRequestRaw `json:"table"`
+}
+
+type singelRequestRaw struct {
+ Name string `json:"name"`
+ Raw rawField `json:"raw"`
+}
+
+type singleRequestAttribute struct {
+ Value int `json:"value"`
+ Raw string `json:"raw"`
+}
+
+type rawField struct {
+ Value int `json:"value"`
+ Str string `json:"string"`
+}
+
+type ataData struct {
+ SelfTest selfTest `json:"self_test"`
+ Capabilities capabilities `json:"capabilities"`
+}
+type capabilities struct {
+ SelfTestsSupported bool `json:"self_tests_supported"`
+}
+type selfTest struct {
+ Status status `json:"status"`
+}
+type status struct {
+ Passed bool `json:"passed"`
+}
+
type attribute struct {
Name string `json:"{#NAME}"`
DeviceType string `json:"{#DISKTYPE}"`
@@ -96,6 +164,8 @@ type deviceInfo struct {
Name string `json:"name"`
InfoName string `json:"info_name"`
DevType string `json:"type"`
+ name string `json:"-"`
+ raidType string `json:"-"`
}
type smartctl struct {
@@ -184,7 +254,17 @@ func (p *Plugin) execute(jsonRunner bool) (*runner, error) {
return r, err
}
-//executeBase executed runners for basic devices retrived from smartctl
+// executeSingle returns device data for single device from smartctl based on provided path.
+func (p *Plugin) executeSingle(path string) (device []byte, err error) {
+ device, err = p.executeSmartctl(fmt.Sprintf("-a %s -j", path), false)
+ if err != nil {
+ return nil, fmt.Errorf("Failed to execute smartctl: %w.", err)
+ }
+
+ return
+}
+
+//executeBase executed runners for basic devices retrieved from smartctl.
func (r *runner) executeBase(basicDev []deviceInfo, jsonRunner bool) error {
r.startBasicRunners(jsonRunner)
@@ -197,7 +277,7 @@ func (r *runner) executeBase(basicDev []deviceInfo, jsonRunner bool) error {
return r.waitForExecution()
}
-//executeRaids executes runners for raid devices (except megaraid) retrived from smartctl
+//executeRaids executes runners for raid devices (except megaraid) retrieved from smartctl
func (r *runner) executeRaids(raids []deviceInfo, jsonRunner bool) {
raidTypes := []string{"3ware", "areca", "cciss", "sat"}
@@ -216,7 +296,7 @@ func (r *runner) executeRaids(raids []deviceInfo, jsonRunner bool) {
r.waitForRaidExecution(r.raidDone)
}
-//executeMegaRaids executes runners for megaraid devices retrived from smartctl
+//executeMegaRaids executes runners for megaraid devices retrieved from smartctl
func (r *runner) executeMegaRaids(megaraids []deviceInfo, jsonRunner bool) {
r.megaraids = make(chan raidParameters, len(megaraids))
@@ -381,6 +461,8 @@ func (r *runner) getBasicDevices(jsonRunner bool) {
return
}
+ dp.Info.name = name
+
r.mux.Lock()
if jsonRunner {
@@ -454,10 +536,14 @@ runner:
}
if dp.SmartStatus != nil {
+ dp.Info.name = raid.name
+
if raid.rType == satType {
dp.Info.Name = fmt.Sprintf("%s %s", raid.name, raid.rType)
+ dp.Info.raidType = raid.rType
} else {
dp.Info.Name = fmt.Sprintf("%s %s,%d", raid.name, raid.rType, i)
+ dp.Info.raidType = fmt.Sprintf("%s,%d", raid.rType, i)
}
if r.setRaidDevices(dp, device, raid.rType, jsonRunner) {
@@ -523,6 +609,8 @@ func (r *runner) getMegaRaidDevices(jsonRunner bool) {
}
dp.Info.Name = fmt.Sprintf("%s %s", raid.name, raid.rType)
+ dp.Info.name = raid.name
+ dp.Info.raidType = raid.rType
r.setRaidDevices(dp, device, raid.rType, jsonRunner)
}
@@ -619,32 +707,41 @@ func (dp *deviceParser) checkErr() (err error) {
func (p *Plugin) getDevices() (basic, raid, megaraid []deviceInfo, err error) {
basicTmp, err := p.scanDevices("--scan -j")
if err != nil {
- return nil, nil, nil, fmt.Errorf("Failed to scan for devices: %s.", err)
+ return nil, nil, nil, fmt.Errorf("Failed to scan for devices: %w.", err)
}
raidTmp, err := p.scanDevices("--scan -d sat -j")
if err != nil {
- return nil, nil, nil, fmt.Errorf("Failed to scan for sat devices: %s.", err)
+ return nil, nil, nil, fmt.Errorf("Failed to scan for sat devices: %w.", err)
}
-raid:
- for _, tmp := range basicTmp {
- for _, r := range raidTmp {
+ basic, raid, megaraid = formatDeviceOutput(basicTmp, raidTmp)
+
+ return
+}
+
+// formatDeviceOutput removes raid devices from basic device list and separates megaraid devices from the rest of raid
+// devices.
+func formatDeviceOutput(basic, raid []deviceInfo) (basicDev, raidDev, megaraidDev []deviceInfo) {
+loop:
+ for _, tmp := range basic {
+ for _, r := range raid {
if tmp.Name == r.Name {
- continue raid
+ continue loop
}
}
- basic = append(basic, tmp)
+ basicDev = append(basicDev, tmp)
}
- for _, r := range raidTmp {
+ for _, r := range raid {
if strings.Contains(r.DevType, "megaraid") {
- megaraid = append(megaraid, r)
+ megaraidDev = append(megaraidDev, r)
+
continue
}
- raid = append(raid, r)
+ raidDev = append(raidDev, r)
}
return
diff --git a/src/libs/zbxalgo/linked_list.c b/src/libs/zbxalgo/linked_list.c
index b75bc1b8132..3a11fabcb6c 100644
--- a/src/libs/zbxalgo/linked_list.c
+++ b/src/libs/zbxalgo/linked_list.c
@@ -333,3 +333,34 @@ void zbx_list_iterator_update(zbx_list_iterator_t *iterator)
if (NULL != iterator->current)
iterator->next = iterator->current->next;
}
+
+
+/******************************************************************************
+ * *
+ * Purpose: removes next iterator value from list *
+ * *
+ * Parameters: iterator - [IN] list iterator *
+ * *
+ * Return value: The data held by the removed item. *
+ * *
+ ******************************************************************************/
+void *zbx_list_iterator_remove_next(zbx_list_iterator_t *iterator)
+{
+ zbx_list_item_t *next;
+ void *data;
+
+ if (NULL == iterator->current || NULL == iterator->next)
+ return NULL;
+
+ next = iterator->next;
+ data = next->data;
+
+ if (iterator->list->tail == next)
+ iterator->list->tail = iterator->current;
+
+ iterator->current->next = next->next;
+ iterator->next = next->next;
+ iterator->list->mem_free_func(next);
+
+ return data;
+}
diff --git a/src/libs/zbxcommon/str.c b/src/libs/zbxcommon/str.c
index a26fb207ded..f3fa6aebc47 100644
--- a/src/libs/zbxcommon/str.c
+++ b/src/libs/zbxcommon/str.c
@@ -1470,6 +1470,8 @@ const char *zbx_result_string(int result)
return "AGENT_ERROR";
case GATEWAY_ERROR:
return "GATEWAY_ERROR";
+ case SIG_ERROR:
+ return "SIG_ERROR";
case SYSINFO_RET_FAIL:
return "SYSINFO_RET_FAIL";
default:
diff --git a/src/libs/zbxdbcache/dbconfig.c b/src/libs/zbxdbcache/dbconfig.c
index 6d15117683d..b0f952d8d55 100644
--- a/src/libs/zbxdbcache/dbconfig.c
+++ b/src/libs/zbxdbcache/dbconfig.c
@@ -9810,6 +9810,7 @@ static void dc_requeue_items(const zbx_uint64_t *itemids, const int *lastclocks,
case NOTSUPPORTED:
case AGENT_ERROR:
case CONFIG_ERROR:
+ case SIG_ERROR:
dc_item->queue_priority = ZBX_QUEUE_PRIORITY_NORMAL;
dc_requeue_item(dc_item, dc_host, dc_interface, ZBX_ITEM_COLLECTED, lastclocks[i]);
break;
diff --git a/src/libs/zbxexec/execute.c b/src/libs/zbxexec/execute.c
index 29db8bcae57..3e4d3eebc19 100644
--- a/src/libs/zbxexec/execute.c
+++ b/src/libs/zbxexec/execute.c
@@ -305,7 +305,8 @@ exit:
* pass NULL to stay in current directory *
* *
* Return value: SUCCEED if processed successfully, TIMEOUT_ERROR if *
- * timeout occurred or FAIL otherwise *
+ * timeout occurred, SIG_ERROR if interrupted by signal or FAIL *
+ * otherwise *
* *
******************************************************************************/
int zbx_execute(const char *command, char **output, char *error, size_t max_error_len, int timeout,
@@ -480,7 +481,16 @@ close:
if (-1 == rc || -1 == zbx_waitpid(pid, &status))
{
if (EINTR == errno)
- ret = TIMEOUT_ERROR;
+ {
+ if (SUCCEED == zbx_alarm_timed_out())
+ ret = TIMEOUT_ERROR;
+ else
+ {
+ ret = SIG_ERROR;
+ zbx_strlcpy(error, "Signal received while executing a shell script.",
+ max_error_len);
+ }
+ }
else
zbx_snprintf(error, max_error_len, "zbx_waitpid() failed: %s", zbx_strerror(errno));
@@ -508,6 +518,7 @@ close:
{
zbx_snprintf(error, max_error_len, "Process killed by signal: %d.",
WTERMSIG(status));
+ ret = SIG_ERROR;
}
else
zbx_strlcpy(error, "Process terminated unexpectedly.", max_error_len);
diff --git a/src/libs/zbxicmpping/icmpping.c b/src/libs/zbxicmpping/icmpping.c
index c183b2c5479..0713d9f13e9 100644
--- a/src/libs/zbxicmpping/icmpping.c
+++ b/src/libs/zbxicmpping/icmpping.c
@@ -148,7 +148,7 @@ static int get_interval_option(const char *fping, ZBX_FPING_HOST *hosts, int hos
goto out;
}
- if (FAIL == ret_exec)
+ if (SUCCEED != ret_exec)
{
zbx_snprintf(error, max_error_len, "Cannot execute \"%s\": %s", tmp, err);
goto out;
diff --git a/src/libs/zbxnix/daemon.c b/src/libs/zbxnix/daemon.c
index cde17b0fe47..eede4b3d59e 100644
--- a/src/libs/zbxnix/daemon.c
+++ b/src/libs/zbxnix/daemon.c
@@ -29,6 +29,11 @@
#include "sighandler.h"
#include "sigcommon.h"
+#if defined(__linux__)
+#define ZBX_PID_FILE_TIMEOUT 20
+#define ZBX_PID_FILE_SLEEP_TIME 100000000
+#endif
+
char *CONFIG_PID_FILE = NULL;
static int parent_pid = -1;
@@ -375,8 +380,29 @@ int daemon_start(int allow_root, const char *user, unsigned int flags)
if (0 == (flags & ZBX_TASK_FLAG_FOREGROUND))
{
- if (0 != zbx_fork())
+ pid_t child_pid;
+
+ if(0 != (child_pid = zbx_fork()))
+ {
+#if defined(__linux__)
+ if (0 < child_pid)
+ {
+ int pid_file_timeout = ZBX_PID_FILE_TIMEOUT;
+ zbx_stat_t stat_buff;
+ struct timespec ts = {0, ZBX_PID_FILE_SLEEP_TIME};
+
+ /* wait for the forked child to create pid file */
+ while (0 < pid_file_timeout && 0 != zbx_stat(CONFIG_PID_FILE, &stat_buff))
+ {
+ pid_file_timeout--;
+ nanosleep(&ts, NULL);
+ }
+ }
+#else
+ ZBX_UNUSED(child_pid);
+#endif
exit(EXIT_SUCCESS);
+ }
setsid();
diff --git a/src/zabbix_agent/active.c b/src/zabbix_agent/active.c
index 7a1ec415975..756d6e0ef5f 100644
--- a/src/zabbix_agent/active.c
+++ b/src/zabbix_agent/active.c
@@ -1458,7 +1458,8 @@ ZBX_THREAD_ENTRY(active_checks_thread, args)
zbx_free(session_token);
#ifdef _WINDOWS
- zbx_addr_free(&activechk_args.addrs);
+ zbx_vector_ptr_clear_ext(&activechk_args.addrs, (zbx_clean_func_t)zbx_addr_free);
+ zbx_vector_ptr_destroy(&activechk_args.addrs);
free_active_metrics();
ZBX_DO_EXIT();
diff --git a/src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java b/src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
index 96de861a1f6..27278a7e5ac 100644
--- a/src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
+++ b/src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
@@ -24,7 +24,7 @@ class GeneralInformation
static final String APPLICATION_NAME = "Zabbix Java Gateway";
static final String REVISION_DATE = "4 April 2022";
static final String REVISION = "{ZABBIX_REVISION}";
- static final String VERSION = "6.0.3";
+ static final String VERSION = "6.0.4rc1";
static void printVersion()
{
diff --git a/src/zabbix_js/zabbix_js.c b/src/zabbix_js/zabbix_js.c
index faafee8c956..3913fbde59e 100644
--- a/src/zabbix_js/zabbix_js.c
+++ b/src/zabbix_js/zabbix_js.c
@@ -249,6 +249,9 @@ int main(int argc, char **argv)
printf("\n%s\n", result);
close:
zabbix_close_log();
+#ifndef _WINDOWS
+ zbx_locks_destroy();
+#endif
clean:
zbx_free(result);
zbx_free(error);
diff --git a/src/zabbix_sender/zabbix_sender.c b/src/zabbix_sender/zabbix_sender.c
index 76c039a731a..a0959e8cd83 100644
--- a/src/zabbix_sender/zabbix_sender.c
+++ b/src/zabbix_sender/zabbix_sender.c
@@ -1859,6 +1859,9 @@ exit:
}
#endif
zabbix_close_log();
+#ifndef _WINDOWS
+ zbx_locks_destroy();
+#endif
#if defined(_WINDOWS)
while (0 == WSACleanup())
;
diff --git a/src/zabbix_server/escalator/escalator.c b/src/zabbix_server/escalator/escalator.c
index 488d5ed91eb..d9b3177dc8a 100644
--- a/src/zabbix_server/escalator/escalator.c
+++ b/src/zabbix_server/escalator/escalator.c
@@ -1502,7 +1502,7 @@ fail:
}
}
- if (FAIL == rc)
+ if (SUCCEED != rc)
status = ALERT_STATUS_FAILED;
add_command_alert(&db_insert, alerts_num++, alertid, host.host, event, r_event, actionid,
diff --git a/src/zabbix_server/ha/ha_manager.c b/src/zabbix_server/ha/ha_manager.c
index 7ab6cedfe66..544e38f1d9a 100644
--- a/src/zabbix_server/ha/ha_manager.c
+++ b/src/zabbix_server/ha/ha_manager.c
@@ -716,6 +716,63 @@ finish:
/******************************************************************************
* *
+ * Purpose: check for active and standby node availability and update *
+ * unavailable nodes accordingly *
+ * *
+ ******************************************************************************/
+static int ha_db_check_unavailable_nodes(zbx_ha_info_t *info, zbx_vector_ha_node_t *nodes, int db_time)
+{
+ int i, ret = SUCCEED;
+
+ zbx_vector_str_t unavailable_nodes;
+
+ zbx_vector_str_create(&unavailable_nodes);
+
+ for (i = 0; i < nodes->values_num; i++)
+ {
+ if (SUCCEED == zbx_cuid_compare(nodes->values[i]->ha_nodeid, info->ha_nodeid))
+ continue;
+
+ if (ZBX_NODE_STATUS_STANDBY != nodes->values[i]->status &&
+ ZBX_NODE_STATUS_ACTIVE != nodes->values[i]->status)
+ {
+ continue;
+ }
+
+
+ if (db_time >= nodes->values[i]->lastaccess + info->failover_delay)
+ {
+ zbx_vector_str_append(&unavailable_nodes, nodes->values[i]->ha_nodeid.str);
+
+ zbx_audit_ha_create_entry(AUDIT_ACTION_UPDATE, nodes->values[i]->ha_nodeid.str,
+ nodes->values[i]->name);
+ zbx_audit_ha_update_field_int(nodes->values[i]->ha_nodeid.str, ZBX_AUDIT_HA_STATUS,
+ nodes->values[i]->status, ZBX_NODE_STATUS_UNAVAILABLE);
+ }
+ }
+
+ if (0 != unavailable_nodes.values_num)
+ {
+ char *sql = NULL;
+ size_t sql_alloc = 0, sql_offset = 0;
+
+ zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "update ha_node set status=%d where",
+ ZBX_NODE_STATUS_UNAVAILABLE);
+
+ DBadd_str_condition_alloc(&sql, &sql_alloc, &sql_offset, "ha_nodeid",
+ (const char **)unavailable_nodes.values, unavailable_nodes.values_num);
+
+ ret = ha_db_execute(info, "%s", sql);
+ zbx_free(sql);
+ }
+
+ zbx_vector_str_destroy(&unavailable_nodes);
+
+ return ret;
+}
+
+/******************************************************************************
+ * *
* Purpose: register server node *
* *
* Return value: SUCCEED - node was registered or database was offline *
@@ -811,6 +868,9 @@ static void ha_db_register_node(zbx_ha_info_t *info)
ha_db_execute(info, "delete from ha_node where name<>''");
}
+ if (ZBX_HA_IS_CLUSTER() && ZBX_NODE_STATUS_ERROR != info->ha_status && ZBX_NODE_STATUS_ACTIVE == ha_status)
+ ha_db_check_unavailable_nodes(info, &nodes, db_time);
+
ha_flush_audit(info);
zbx_free(sql);
@@ -842,49 +902,11 @@ finish:
******************************************************************************/
static int ha_check_standby_nodes(zbx_ha_info_t *info, zbx_vector_ha_node_t *nodes, int db_time)
{
- int i, ret = SUCCEED;
- zbx_vector_str_t unavailable_nodes;
+ int ret;
zbx_audit_init(info->auditlog);
- zbx_vector_str_create(&unavailable_nodes);
-
- for (i = 0; i < nodes->values_num; i++)
- {
- if (nodes->values[i]->status != ZBX_NODE_STATUS_STANDBY)
- continue;
-
- if (db_time >= nodes->values[i]->lastaccess + info->failover_delay)
- {
- zbx_vector_str_append(&unavailable_nodes, nodes->values[i]->ha_nodeid.str);
-
- zbx_audit_ha_create_entry(AUDIT_ACTION_UPDATE, nodes->values[i]->ha_nodeid.str,
- nodes->values[i]->name);
- zbx_audit_ha_update_field_int(nodes->values[i]->ha_nodeid.str, ZBX_AUDIT_HA_STATUS,
- nodes->values[i]->status, ZBX_NODE_STATUS_UNAVAILABLE);
- }
- }
-
- if (0 != unavailable_nodes.values_num)
- {
- char *sql = NULL;
- size_t sql_alloc = 0, sql_offset = 0;
-
- zbx_snprintf_alloc(&sql, &sql_alloc, &sql_offset, "update ha_node set status=%d where",
- ZBX_NODE_STATUS_UNAVAILABLE);
-
- DBadd_str_condition_alloc(&sql, &sql_alloc, &sql_offset, "ha_nodeid",
- (const char **)unavailable_nodes.values, unavailable_nodes.values_num);
-
- if (SUCCEED != ha_db_execute(info, "%s", sql))
- ret = FAIL;
-
- zbx_free(sql);
- }
-
- zbx_vector_str_destroy(&unavailable_nodes);
-
- if (SUCCEED == ret)
+ if (SUCCEED == (ret = ha_db_check_unavailable_nodes(info, nodes, db_time)))
ha_flush_audit(info);
else
zbx_audit_clean();
diff --git a/src/zabbix_server/lld/lld_item.c b/src/zabbix_server/lld/lld_item.c
index e46e3aa63da..bc0948b67d9 100644
--- a/src/zabbix_server/lld/lld_item.c
+++ b/src/zabbix_server/lld/lld_item.c
@@ -1835,6 +1835,16 @@ static void lld_items_validate(zbx_uint64_t hostid, zbx_vector_ptr_t *items, zbx
dependent = (zbx_lld_item_t *)item->dependent_items.values[j];
dependent->flags &= ~ZBX_FLAG_LLD_ITEM_DISCOVERED;
}
+
+ continue;
+ }
+
+ if (0 != item->master_itemid && (FAIL != zbx_vector_ptr_bsearch(item_prototypes, &item->master_itemid,
+ ZBX_DEFAULT_UINT64_PTR_COMPARE_FUNC)))
+ {
+ item->flags &= ~ZBX_FLAG_LLD_ITEM_DISCOVERED;
+ *error = zbx_strdcatf(*error, "Cannot %s dependent item: master item is not discovered.\n",
+ (0 != item->itemid ? "update" : "create"));
}
}
diff --git a/src/zabbix_server/poller/checks_external.c b/src/zabbix_server/poller/checks_external.c
index 786bcd4dc77..f1a03eeecd3 100644
--- a/src/zabbix_server/poller/checks_external.c
+++ b/src/zabbix_server/poller/checks_external.c
@@ -73,17 +73,21 @@ int get_value_external(const DC_ITEM *item, AGENT_RESULT *result)
zbx_free(param_esc);
}
- if (SUCCEED == zbx_execute(cmd, &buf, error, sizeof(error), CONFIG_TIMEOUT, ZBX_EXIT_CODE_CHECKS_DISABLED, NULL))
+ if (SUCCEED == (ret = zbx_execute(cmd, &buf, error, sizeof(error), CONFIG_TIMEOUT,
+ ZBX_EXIT_CODE_CHECKS_DISABLED, NULL)))
{
zbx_rtrim(buf, ZBX_WHITESPACE);
set_result_type(result, ITEM_VALUE_TYPE_TEXT, buf);
zbx_free(buf);
-
- ret = SUCCEED;
}
else
+ {
+ if (SIG_ERROR != ret)
+ ret = NOTSUPPORTED;
+
SET_MSG_RESULT(result, zbx_strdup(NULL, error));
+ }
out:
zbx_free(cmd);
diff --git a/src/zabbix_server/poller/poller.c b/src/zabbix_server/poller/poller.c
index ee9048b22e5..58338b6d91e 100644
--- a/src/zabbix_server/poller/poller.c
+++ b/src/zabbix_server/poller/poller.c
@@ -835,6 +835,9 @@ static int get_values(unsigned char poller_type, int *nextcheck)
case CONFIG_ERROR:
/* nothing to do */
break;
+ case SIG_ERROR:
+ /* nothing to do, execution was forcibly interrupted by signal */
+ break;
default:
zbx_error("unknown response code returned: %d", errcodes[i]);
THIS_SHOULD_NEVER_HAPPEN;
diff --git a/src/zabbix_server/preprocessor/preproc_manager.c b/src/zabbix_server/preprocessor/preproc_manager.c
index 19f21b5c3f5..02bfa7831f2 100644
--- a/src/zabbix_server/preprocessor/preproc_manager.c
+++ b/src/zabbix_server/preprocessor/preproc_manager.c
@@ -25,6 +25,8 @@
#include "zbxlld.h"
#include "preprocessing.h"
#include "preproc_history.h"
+#include "../../libs/zbxalgo/vectorimpl.h"
+#include "preproc_manager.h"
extern ZBX_THREAD_LOCAL unsigned char process_type;
extern unsigned char program_type;
@@ -53,13 +55,18 @@ typedef enum
}
zbx_preprocessing_kind_t;
-typedef struct zbx_preprocessing_request_base
+typedef struct zbx_preprocessing_request_base zbx_preprocessing_request_base_t;
+
+ZBX_PTR_VECTOR_DECL(preprocessing_request_base, zbx_preprocessing_request_base_t *)
+ZBX_PTR_VECTOR_IMPL(preprocessing_request_base, zbx_preprocessing_request_base_t *)
+
+struct zbx_preprocessing_request_base
{
zbx_preprocessing_kind_t kind;
zbx_preprocessing_states_t state;
- struct zbx_preprocessing_request_base *pending; /* the request waiting on this request to complete */
-}
-zbx_preprocessing_request_base_t;
+ zbx_preprocessing_request_base_t *pending; /* the request waiting on this request to complete */
+ zbx_vector_preprocessing_request_base_t flush_queue; /* processed request waiting to be flushed */
+};
/* preprocessing request */
typedef struct preprocessing_request
@@ -291,9 +298,11 @@ static zbx_uint32_t preprocessor_create_task(zbx_preprocessing_manager_t *manage
static void preprocessor_set_request_state_done(zbx_preprocessing_manager_t *manager,
zbx_preprocessing_request_base_t *base, const zbx_list_item_t *queue_item)
{
- zbx_item_link_t *index, index_local;
- zbx_preprocessing_request_t *request;
- zbx_preprocessing_dep_request_t *dep_request;
+ zbx_item_link_t *index, index_local;
+ zbx_list_iterator_t iterator, next_iterator;
+ zbx_preprocessing_request_t *request;
+ zbx_preprocessing_dep_request_t *dep_request;
+ zbx_preprocessing_request_base_t *prev;
base->state = REQUEST_STATE_DONE;
@@ -320,6 +329,31 @@ static void preprocessor_set_request_state_done(zbx_preprocessing_manager_t *man
{
zbx_hashset_remove_direct(&manager->linked_items, index);
}
+
+ if (NULL == manager->queue.head)
+ return;
+
+ zbx_list_iterator_init(&manager->queue, &iterator);
+ if (iterator.next == queue_item)
+ return;
+
+ while (SUCCEED == zbx_list_iterator_next(&iterator))
+ {
+ if (iterator.next == queue_item)
+ break;
+ }
+
+ prev = (zbx_preprocessing_request_base_t *)iterator.current->data;
+ zbx_vector_preprocessing_request_base_append(&prev->flush_queue, base);
+
+ next_iterator = iterator;
+ if (SUCCEED == zbx_list_iterator_next(&next_iterator))
+ {
+ if (SUCCEED == zbx_list_iterator_equal(&next_iterator, &manager->priority_tail))
+ manager->priority_tail = iterator;
+ }
+
+ (void)zbx_list_iterator_remove_next(&iterator);
}
/******************************************************************************
@@ -623,6 +657,9 @@ static void preprocessor_free_request(zbx_preprocessing_request_base_t *base)
zbx_preprocessing_request_t *request;
zbx_preprocessing_dep_request_t *dep_request;
+ zbx_vector_preprocessing_request_base_clear_ext(&base->flush_queue, preprocessor_free_request);
+ zbx_vector_preprocessing_request_base_destroy(&base->flush_queue);
+
switch (base->kind)
{
case ZBX_PREPROC_ITEM:
@@ -708,6 +745,40 @@ static void preprocessor_flush_dep_results(zbx_preprocessing_manager_t *manager,
/******************************************************************************
* *
+ * Purpose: recursively flush processed request and the other processed *
+ * requests that were waiting on this request to be finished *
+ * *
+ * Parameters: manager - [IN] preprocessing manager *
+ * base - [IN] the preprocessing request *
+ * *
+ ******************************************************************************/
+static void preprocessing_flush_request(zbx_preprocessing_manager_t *manager,
+ zbx_preprocessing_request_base_t *base)
+{
+ zbx_preprocessing_request_t *request;
+ zbx_preprocessing_dep_request_t *dep_request;
+ int i;
+
+ switch (base->kind)
+ {
+ case ZBX_PREPROC_ITEM:
+ request = (zbx_preprocessing_request_t *)base;
+ preprocessor_flush_value(&request->value);
+ manager->processed_num++;
+ manager->queued_num--;
+ break;
+ case ZBX_PREPROC_DEPS:
+ dep_request = (zbx_preprocessing_dep_request_t *)base;
+ preprocessor_flush_dep_results(manager, dep_request);
+ break;
+ }
+
+ for (i = 0; i < base->flush_queue.values_num; i++)
+ preprocessing_flush_request(manager, base->flush_queue.values[i]);
+}
+
+/******************************************************************************
+ * *
* Purpose: add all sequential processed values from beginning of the queue *
* to the local history cache *
* *
@@ -716,8 +787,6 @@ static void preprocessor_flush_dep_results(zbx_preprocessing_manager_t *manager,
******************************************************************************/
static void preprocessing_flush_queue(zbx_preprocessing_manager_t *manager)
{
- zbx_preprocessing_request_t *request;
- zbx_preprocessing_dep_request_t *dep_request;
zbx_preprocessing_request_base_t *base;
zbx_list_iterator_t iterator;
@@ -729,19 +798,7 @@ static void preprocessing_flush_queue(zbx_preprocessing_manager_t *manager)
if (REQUEST_STATE_DONE != base->state)
break;
- switch (base->kind)
- {
- case ZBX_PREPROC_ITEM:
- request = (zbx_preprocessing_request_t *)base;
- preprocessor_flush_value(&request->value);
- manager->processed_num++;
- manager->queued_num--;
- break;
- case ZBX_PREPROC_DEPS:
- dep_request = (zbx_preprocessing_dep_request_t *)base;
- preprocessor_flush_dep_results(manager, dep_request);
- break;
- }
+ preprocessing_flush_request(manager, base);
if (SUCCEED == zbx_list_iterator_equal(&iterator, &manager->priority_tail))
zbx_list_iterator_clear(&manager->priority_tail);
@@ -883,8 +940,9 @@ static void preprocessor_enqueue(zbx_preprocessing_manager_t *manager, zbx_prepr
state = REQUEST_STATE_QUEUED;
request = (zbx_preprocessing_request_t *)zbx_malloc(NULL, sizeof(zbx_preprocessing_request_t));
- request->base.kind = ZBX_PREPROC_ITEM;
memset(request, 0, sizeof(zbx_preprocessing_request_t));
+ request->base.kind = ZBX_PREPROC_ITEM;
+ zbx_vector_preprocessing_request_base_create(&request->base.flush_queue);
memcpy(&request->value, value, sizeof(zbx_preproc_item_value_t));
request->base.state = state;
@@ -995,6 +1053,7 @@ static void preprocessor_enqueue_dependent(zbx_preprocessing_manager_t *manager,
dep_request->base.kind = ZBX_PREPROC_DEPS;
dep_request->base.state = REQUEST_STATE_QUEUED;
dep_request->base.pending = NULL;
+ zbx_vector_preprocessing_request_base_create(&dep_request->base.flush_queue);
dep_request->hostid = hostid;
dep_request->ts = NULL != ts ? *ts : (zbx_timespec_t){0, 0};
diff --git a/src/zabbix_server/scripts/scripts.c b/src/zabbix_server/scripts/scripts.c
index 8dcd7112708..9d88243113a 100644
--- a/src/zabbix_server/scripts/scripts.c
+++ b/src/zabbix_server/scripts/scripts.c
@@ -458,8 +458,11 @@ int zbx_script_execute(const zbx_script_t *script, const DC_HOST *host, const ch
break;
case ZBX_SCRIPT_EXECUTE_ON_SERVER:
case ZBX_SCRIPT_EXECUTE_ON_PROXY:
- ret = zbx_execute(script->command, result, error, max_error_len,
- CONFIG_TRAPPER_TIMEOUT, ZBX_EXIT_CODE_CHECKS_ENABLED, NULL);
+ if (SUCCEED != (ret = zbx_execute(script->command, result, error, max_error_len,
+ CONFIG_TRAPPER_TIMEOUT, ZBX_EXIT_CODE_CHECKS_ENABLED, NULL)))
+ {
+ ret = FAIL;
+ }
break;
default:
zbx_snprintf(error, max_error_len, "Invalid 'Execute on' option \"%d\".",
diff --git a/templates/app/openweathermap_http/README.md b/templates/app/openweathermap_http/README.md
index bc9c12b0df4..223ae8e9135 100644
--- a/templates/app/openweathermap_http/README.md
+++ b/templates/app/openweathermap_http/README.md
@@ -22,8 +22,8 @@ It works without any external scripts and uses the Script item.
- by location name (for example: Riga)
- by location ID. Link to the list of city ID: http://bulk.openweathermap.org/sample/city.list.json.gz
- by zip/post code with a country code (for example: 94040,us)
- A few locations can be added to the macro at the same time by "|" delimiter.
- For example: 43.81821,7.76115|Riga|2643743|94040,us.
+ A few locations can be added to the macro at the same time by `|` delimiter.
+ For example: `43.81821,7.76115|Riga|2643743|94040,us`.
Please note that API requests by city name, zip-codes and city id will be deprecated soon.
Language and units macros can be customized too if necessary.
@@ -39,7 +39,7 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
|{$LANG} |<p>List of available languages https://openweathermap.org/current#multi.</p> |`en` |
-|{$LOCATION} |<p>Locations can be set by few ways:</p><p>1. by geo coordinates (for example: 56.95,24.0833)</p><p>2. by location name (for example: Riga)</p><p>3. by location ID. Link to the list of city ID: http://bulk.openweathermap.org/sample/city.list.json.gz</p><p>4. by zip/post code with a country code (for example: 94040,us)</p><p>A few locations can be added to the macro at the same time by "|" delimiter. </p><p>For example: 43.81821,7.76115|Riga|2643743|94040,us.</p><p>Please note that API requests by city name, zip-codes and city id will be deprecated soon.</p> |`Riga` |
+|{$LOCATION} |<p>Locations can be set by few ways:</p><p>1. by geo coordinates (for example: 56.95,24.0833)</p><p>2. by location name (for example: Riga)</p><p>3. by location ID. Link to the list of city ID: http://bulk.openweathermap.org/sample/city.list.json.gz</p><p>4. by zip/post code with a country code (for example: 94040,us)</p><p>A few locations can be added to the macro at the same time by <code>\|</code> delimiter. </p><p>For example: <code>43.81821,7.76115\|Riga\|2643743\|94040,us</code>.</p><p>Please note that API requests by city name, zip-codes and city id will be deprecated soon.</p> |`Riga` |
|{$OPENWEATHERMAP.API.ENDPOINT} |<p>OpenWeatherMap API endpoint.</p> |`api.openweathermap.org/data/2.5/weather?` |
|{$OPENWEATHERMAP.API.TOKEN} |<p>Specify openweathermap API key.</p> |`` |
|{$OPENWEATHERMAP.DATA.TIMEOUT} |<p>Response timeout for OpenWeatherMap API.</p> |`3s` |
diff --git a/templates/app/openweathermap_http/template_app_openweathermap_http.yaml b/templates/app/openweathermap_http/template_app_openweathermap_http.yaml
index 799d9b9c817..3c8b07d8d9a 100644
--- a/templates/app/openweathermap_http/template_app_openweathermap_http.yaml
+++ b/templates/app/openweathermap_http/template_app_openweathermap_http.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:33:28Z'
+ date: '2022-03-30T13:31:18Z'
groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
@@ -705,8 +705,8 @@ zabbix_export:
2. by location name (for example: Riga)
3. by location ID. Link to the list of city ID: http://bulk.openweathermap.org/sample/city.list.json.gz
4. by zip/post code with a country code (for example: 94040,us)
- A few locations can be added to the macro at the same time by "|" delimiter.
- For example: 43.81821,7.76115|Riga|2643743|94040,us.
+ A few locations can be added to the macro at the same time by `|` delimiter.
+ For example: `43.81821,7.76115|Riga|2643743|94040,us`.
Please note that API requests by city name, zip-codes and city id will be deprecated soon.
-
macro: '{$OPENWEATHERMAP.API.ENDPOINT}'
diff --git a/templates/app/pfsense_snmp/README.md b/templates/app/pfsense_snmp/README.md
index 21a35f4c6cf..451fd642db9 100644
--- a/templates/app/pfsense_snmp/README.md
+++ b/templates/app/pfsense_snmp/README.md
@@ -55,6 +55,8 @@ No specific Zabbix configuration is required.
|{$SWAP.PFREE.MIN.WARN} |<p>Threshold of free swap space for warning trigger in %.</p> |`50` |
|{$VFS.DEV.DEVNAME.MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|cd[0-9]*|pass[0-9]*|zram[0-9]*)` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/var/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.*(9.3|hrFSBerkeleyFFS)$` |
@@ -72,28 +74,28 @@ There are no template links in this template.
|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
-|Block devices discovery |<p>Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable)</p> |SNMP |vfs.dev.discovery<p>**Filter**:</p>AND <p>- {#DEVNAME} MATCHES_REGEX `{$VFS.DEV.DEVNAME.MATCHES}`</p><p>- {#DEVNAME} NOT_MATCHES_REGEX `{$VFS.DEV.DEVNAME.NOT_MATCHES}`</p> |
+|Block devices discovery |<p>Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable).</p> |SNMP |vfs.dev.discovery<p>**Filter**:</p>AND <p>- {#DEVNAME} MATCHES_REGEX `{$VFS.DEV.DEVNAME.MATCHES}`</p><p>- {#DEVNAME} NOT_MATCHES_REGEX `{$VFS.DEV.DEVNAME.NOT_MATCHES}`</p> |
|CPU discovery |<p>This discovery will create set of per core CPU metrics from UCD-SNMP-MIB, using {#CPU.COUNT} in preprocessing. That's the only reason why LLD is used.</p> |DEPENDENT |cpu.discovery<p>**Preprocessing**:</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p> |
-|Mounted filesystem discovery |<p>HOST-RESOURCES-MIB::hrFS discovery with filter</p> |SNMP |vfs.fs.discovery<p>**Filter**:</p>AND <p>- {#FSTYPE} MATCHES_REGEX `{$VFS.FS.FSTYPE.MATCHES}`</p><p>- {#FSTYPE} NOT_MATCHES_REGEX `{$VFS.FS.FSTYPE.NOT_MATCHES}`</p><p>- {#FSNAME} MATCHES_REGEX `{$VFS.FS.FSNAME.MATCHES}`</p><p>- {#FSNAME} NOT_MATCHES_REGEX `{$VFS.FS.FSNAME.NOT_MATCHES}`</p> |
+|Mounted filesystem discovery |<p>HOST-RESOURCES-MIB::hrFS discovery with filter.</p> |SNMP |vfs.fs.discovery<p>**Filter**:</p>AND <p>- {#FSTYPE} MATCHES_REGEX `{$VFS.FS.FSTYPE.MATCHES}`</p><p>- {#FSTYPE} NOT_MATCHES_REGEX `{$VFS.FS.FSTYPE.NOT_MATCHES}`</p><p>- {#FSNAME} MATCHES_REGEX `{$VFS.FS.FSNAME.MATCHES}`</p><p>- {#FSNAME} NOT_MATCHES_REGEX `{$VFS.FS.FSNAME.NOT_MATCHES}`</p> |
|Network interfaces discovery |<p>Discovering interfaces from IF-MIB.</p> |SNMP |net.if.discovery<p>**Filter**:</p>AND <p>- {#IFADMINSTATUS} MATCHES_REGEX `{$NET.IF.IFADMINSTATUS.MATCHES}`</p><p>- {#IFADMINSTATUS} NOT_MATCHES_REGEX `{$NET.IF.IFADMINSTATUS.NOT_MATCHES}`</p><p>- {#IFOPERSTATUS} MATCHES_REGEX `{$NET.IF.IFOPERSTATUS.MATCHES}`</p><p>- {#IFOPERSTATUS} NOT_MATCHES_REGEX `{$NET.IF.IFOPERSTATUS.NOT_MATCHES}`</p><p>- {#IFNAME} MATCHES_REGEX `{$NET.IF.IFNAME.MATCHES}`</p><p>- {#IFNAME} NOT_MATCHES_REGEX `{$NET.IF.IFNAME.NOT_MATCHES}`</p><p>- {#IFDESCR} MATCHES_REGEX `{$NET.IF.IFDESCR.MATCHES}`</p><p>- {#IFDESCR} NOT_MATCHES_REGEX `{$NET.IF.IFDESCR.NOT_MATCHES}`</p><p>- {#IFALIAS} MATCHES_REGEX `{$NET.IF.IFALIAS.MATCHES}`</p><p>- {#IFALIAS} NOT_MATCHES_REGEX `{$NET.IF.IFALIAS.NOT_MATCHES}`</p><p>- {#IFTYPE} MATCHES_REGEX `{$NET.IF.IFTYPE.MATCHES}`</p><p>- {#IFTYPE} NOT_MATCHES_REGEX `{$NET.IF.IFTYPE.NOT_MATCHES}`</p> |
## Items collected
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|CPU |PFSense: Interrupts per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of interrupts processed</p> |SNMP |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|CPU |PFSense: Context switches per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of context switches</p> |SNMP |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|CPU |PFSense: Interrupts per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of interrupts processed.</p> |SNMP |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|CPU |PFSense: Context switches per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of context switches.</p> |SNMP |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|CPU |PFSense: Load average (1m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 1 minute load averages.</p> |SNMP |system.cpu.load.avg1 |
|CPU |PFSense: Load average (5m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 5 minutes load averages.</p> |SNMP |system.cpu.load.avg5 |
|CPU |PFSense: Load average (15m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 15 minutes load averages.</p> |SNMP |system.cpu.load.avg15 |
-|CPU |PFSense: Number of CPUs |<p>MIB: HOST-RESOURCES-MIB</p><p>Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD</p> |SNMP |system.cpu.num<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//count the number of cores return JSON.parse(value).length; `</p> |
+|CPU |PFSense: Number of CPUs |<p>MIB: HOST-RESOURCES-MIB</p><p>Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD.</p> |SNMP |system.cpu.num<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//count the number of cores return JSON.parse(value).length; `</p> |
|CPU |PFSense: CPU idle time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent doing nothing.</p> |SNMP |system.cpu.idle[{#SNMPINDEX}] |
|CPU |PFSense: CPU system time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running the kernel and its processes.</p> |SNMP |system.cpu.system[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |PFSense: CPU user time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that are not niced.</p> |SNMP |system.cpu.user[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |PFSense: CPU nice time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that have been niced.</p> |SNMP |system.cpu.nice[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |PFSense: CPU iowait time |<p>MIB: UCD-SNMP-MIB</p><p>Amount of time the CPU has been waiting for I/O to complete.</p> |SNMP |system.cpu.iowait[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |PFSense: CPU interrupt time |<p>MIB: UCD-SNMP-MIB</p><p>The amount of time the CPU has been servicing hardware interrupts.</p> |SNMP |system.cpu.interrupt[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |PFSense: CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
+|CPU |PFSense: CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
|General |PFSense: System contact details |<p>MIB: SNMPv2-MIB</p><p>The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.</p> |SNMP |system.contact<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
|General |PFSense: System description |<p>MIB: SNMPv2-MIB</p><p>System description of the host.</p> |SNMP |system.descr<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
|General |PFSense: System location |<p>MIB: SNMPv2-MIB</p><p>The physical location of this node. If the location is unknown, the value is the zero-length string.</p> |SNMP |system.location<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
@@ -102,7 +104,7 @@ There are no template links in this template.
|Memory |PFSense: Free memory |<p>MIB: UCD-SNMP-MIB</p><p>The amount of real/physical memory currently unused or available.</p> |SNMP |vm.memory.free<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |PFSense: Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of real or virtual memory currently allocated for use as memory buffers.</p> |SNMP |vm.memory.buffers<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |PFSense: Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of real or virtual memory currently allocated for use as cached memory.</p> |SNMP |vm.memory.cached<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |PFSense: Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes</p> |SNMP |vm.memory.total<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |PFSense: Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes.</p> |SNMP |vm.memory.total<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |PFSense: Available memory |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.available<p>**Expression**:</p>`last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)` |
|Memory |PFSense: Memory utilization |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`(last(//vm.memory.total)-(last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)))/last(//vm.memory.total)*100` |
|Memory |PFSense: Total swap space |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of swap space configured for this host.</p> |SNMP |system.swap.total<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
@@ -117,24 +119,24 @@ There are no template links in this template.
|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Speed |<p>MIB: IF-MIB</p><p>An estimate of the interface's current bandwidth in units of 1,000,000 bits per second. If this object reports a value of `n' then the speed of the interface is somewhere in the range of `n-500,000' to`n+499,999'. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. For a sub-layer which has no concept of bandwidth, this object should be zero.</p> |SNMP |net.if.speed[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1000000`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Operational status |<p>MIB: IF-MIB</p><p>The current operational state of the interface.</p><p>- The testing(3) state indicates that no operational packet scan be passed</p><p>- If ifAdminStatus is down(2) then ifOperStatus should be down(2)</p><p>- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic</p><p>- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)</p><p>- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state</p><p>- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.</p> |SNMP |net.if.status[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Interface type |<p>MIB: IF-MIB</p><p>The type of interface.</p><p>Additional values for ifType are assigned by the Internet Assigned Numbers Authority (IANA),</p><p>through updating the syntax of the IANAifType textual convention.</p> |SNMP |net.if.type[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Rules references count |<p>BEGEMOT-PF-MIB</p><p>The number of rules referencing this interface.</p> |SNMP |net.if.rules.refs[{#SNMPINDEX}] |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 traffic passed |<p>BEGEMOT-PF-MIB</p><p>IPv4 bits per second passed coming in on this interface.</p> |SNMP |net.if.in.pass.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 traffic blocked |<p>BEGEMOT-PF-MIB</p><p>IPv4 bits per second blocked coming in on this interface.</p> |SNMP |net.if.in.block.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 traffic passed |<p>BEGEMOT-PF-MIB</p><p>IPv4 bits per second passed going out on this interface.</p> |SNMP |net.if.out.pass.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 traffic blocked |<p>BEGEMOT-PF-MIB</p><p>IPv4 bits per second blocked going out on this interface.</p> |SNMP |net.if.out.block.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 packets passed |<p>BEGEMOT-PF-MIB</p><p>The number of IPv4 packets passed coming in on this interface.</p> |SNMP |net.if.in.pass.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 packets blocked |<p>BEGEMOT-PF-MIB</p><p>The number of IPv4 packets blocked coming in on this interface.</p> |SNMP |net.if.in.block.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 packets passed |<p>BEGEMOT-PF-MIB</p><p>The number of IPv4 packets passed going out on this interface.</p> |SNMP |net.if.out.pass.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 packets blocked |<p>BEGEMOT-PF-MIB</p><p>The number of IPv4 packets blocked going out on this interface.</p> |SNMP |net.if.out.block.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 traffic passed |<p>BEGEMOT-PF-MIB</p><p>IPv6 bits per second passed coming in on this interface.</p> |SNMP |net.if.in.pass.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 traffic blocked |<p>BEGEMOT-PF-MIB</p><p>IPv6 bits per second blocked coming in on this interface.</p> |SNMP |net.if.in.block.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 traffic passed |<p>BEGEMOT-PF-MIB</p><p>IPv6 bits per second passed going out on this interface.</p> |SNMP |net.if.out.pass.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 traffic blocked |<p>BEGEMOT-PF-MIB</p><p>IPv6 bits per second blocked going out on this interface.</p> |SNMP |net.if.out.block.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 packets passed |<p>BEGEMOT-PF-MIB</p><p>The number of IPv6 packets passed coming in on this interface.</p> |SNMP |net.if.in.pass.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 packets blocked |<p>BEGEMOT-PF-MIB</p><p>The number of IPv6 packets blocked coming in on this interface.</p> |SNMP |net.if.in.block.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 packets passed |<p>BEGEMOT-PF-MIB</p><p>The number of IPv6 packets passed going out on this interface.</p> |SNMP |net.if.out.pass.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 packets blocked |<p>BEGEMOT-PF-MIB</p><p>The number of IPv6 packets blocked going out on this interface.</p> |SNMP |net.if.out.block.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Packet filter running status |<p>MIB: BEGEMOT-PF-MIB</p><p>True if packet filter is currently enabled</p> |SNMP |pfsense.pf.status |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Rules references count |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of rules referencing this interface.</p> |SNMP |net.if.rules.refs[{#SNMPINDEX}] |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 traffic passed |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv4 bits per second passed coming in on this interface.</p> |SNMP |net.if.in.pass.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 traffic blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv4 bits per second blocked coming in on this interface.</p> |SNMP |net.if.in.block.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 traffic passed |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv4 bits per second passed going out on this interface.</p> |SNMP |net.if.out.pass.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 traffic blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv4 bits per second blocked going out on this interface.</p> |SNMP |net.if.out.block.v4.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 packets passed |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv4 packets passed coming in on this interface.</p> |SNMP |net.if.in.pass.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv4 packets blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv4 packets blocked coming in on this interface.</p> |SNMP |net.if.in.block.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 packets passed |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv4 packets passed going out on this interface.</p> |SNMP |net.if.out.pass.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv4 packets blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv4 packets blocked going out on this interface.</p> |SNMP |net.if.out.block.v4.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 traffic passed |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv6 bits per second passed coming in on this interface.</p> |SNMP |net.if.in.pass.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 traffic blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv6 bits per second blocked coming in on this interface.</p> |SNMP |net.if.in.block.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 traffic passed |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv6 bits per second passed going out on this interface.</p> |SNMP |net.if.out.pass.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 traffic blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>IPv6 bits per second blocked going out on this interface.</p> |SNMP |net.if.out.block.v6.bps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 packets passed |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv6 packets passed coming in on this interface.</p> |SNMP |net.if.in.pass.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound IPv6 packets blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv6 packets blocked coming in on this interface.</p> |SNMP |net.if.in.block.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 packets passed |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv6 packets passed going out on this interface.</p> |SNMP |net.if.out.pass.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Network interfaces |PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound IPv6 packets blocked |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of IPv6 packets blocked going out on this interface.</p> |SNMP |net.if.out.block.v6.pps[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Packet filter running status |<p>MIB: BEGEMOT-PF-MIB</p><p>True if packet filter is currently enabled.</p> |SNMP |pfsense.pf.status |
|pfSense |PFSense: States table current |<p>MIB: BEGEMOT-PF-MIB</p><p>Number of entries in the state table.</p> |SNMP |pfsense.state.table.count |
|pfSense |PFSense: States table limit |<p>MIB: BEGEMOT-PF-MIB</p><p>Maximum number of 'keep state' rules in the ruleset.</p> |SNMP |pfsense.state.table.limit |
|pfSense |PFSense: States table utilization in % |<p>Utilization of state table in %.</p> |CALCULATED |pfsense.state.table.pused<p>**Expression**:</p>`last(//pfsense.state.table.count) * 100 / last(//pfsense.state.table.limit)` |
@@ -144,12 +146,12 @@ There are no template links in this template.
|pfSense |PFSense: DHCP server status |<p>MIB: HOST-RESOURCES-MIB</p><p>The status of DHCP server process.</p> |SNMP |pfsense.dhcpd.status<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED: ``</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> 0`</p> |
|pfSense |PFSense: DNS server status |<p>MIB: HOST-RESOURCES-MIB</p><p>The status of DNS server process.</p> |SNMP |pfsense.dns.status<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED: ``</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> 0`</p> |
|pfSense |PFSense: State of nginx process |<p>MIB: HOST-RESOURCES-MIB</p><p>The status of nginx process.</p> |SNMP |pfsense.nginx.status<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED: ``</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> 0`</p> |
-|pfSense |PFSense: Packets matched a filter rule |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.match<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Packets with bad offset |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.bad.offset<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Fragmented packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.fragment<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Short packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.short<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Normalized packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.normalize<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|pfSense |PFSense: Packets dropped due to memory limitation |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory</p> |SNMP |pfsense.packets.mem.drop<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Packets matched a filter rule |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.match<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Packets with bad offset |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.bad.offset<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Fragmented packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.fragment<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Short packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.short<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Normalized packets |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.normalize<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|pfSense |PFSense: Packets dropped due to memory limitation |<p>MIB: BEGEMOT-PF-MIB</p><p>True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.</p> |SNMP |pfsense.packets.mem.drop<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|pfSense |PFSense: Firewall rules count |<p>MIB: BEGEMOT-PF-MIB</p><p>The number of labeled filter rules on this system.</p> |SNMP |pfsense.rules.count |
|Status |PFSense: ICMP ping |<p>Host accessibility by ICMP.</p><p>0 - ICMP ping fails.</p><p>1 - ICMP ping successful.</p> |SIMPLE |icmpping |
|Status |PFSense: ICMP loss |<p>Percentage of lost packets.</p> |SIMPLE |icmppingloss |
@@ -162,7 +164,7 @@ There are no template links in this template.
|Storage |PFSense: [{#FSNAME}]: Free inodes in % |<p>MIB: UCD-SNMP-MIB</p><p>If having problems collecting this item make sure access to UCD-SNMP-MIB is allowed.</p> |SNMP |vfs.fs.inode.pfree[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100-value);`</p> |
|Storage |PFSense: [{#DEVNAME}]: Disk read rate |<p>MIB: UCD-DISKIO-MIB</p><p>The number of read accesses from this device since boot.</p> |SNMP |vfs.dev.read.rate[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|Storage |PFSense: [{#DEVNAME}]: Disk write rate |<p>MIB: UCD-DISKIO-MIB</p><p>The number of write accesses from this device since boot.</p> |SNMP |vfs.dev.write.rate[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
-|Storage |PFSense: [{#DEVNAME}]: Disk utilization |<p>MIB: UCD-DISKIO-MIB</p><p>The 1 minute average load of disk (%)</p> |SNMP |vfs.dev.util[{#SNMPINDEX}] |
+|Storage |PFSense: [{#DEVNAME}]: Disk utilization |<p>MIB: UCD-DISKIO-MIB</p><p>The 1 minute average load of disk (%).</p> |SNMP |vfs.dev.util[{#SNMPINDEX}] |
## Triggers
@@ -185,9 +187,9 @@ There are no template links in this template.
|PFSense: Source tracking table usage is high |<p>Please check the number of sticky connections https://docs.netgate.com/pfsense/en/latest/monitoring/status/firewall-states-sources.html</p> |`min(/PFSense SNMP/pfsense.source.tracking.table.pused,#3)>{$SOURCE.TRACKING.TABLE.UTIL.MAX}` |WARNING | |
|PFSense: DHCP server is not running |<p>Please check DHCP server settings https://docs.netgate.com/pfsense/en/latest/services/dhcp/index.html</p> |`last(/PFSense SNMP/pfsense.dhcpd.status)=0` |AVERAGE | |
|PFSense: DNS server is not running |<p>Please check DNS server settings https://docs.netgate.com/pfsense/en/latest/services/dns/index.html</p> |`last(/PFSense SNMP/pfsense.dns.status)=0` |AVERAGE | |
-|PFSense: Web server is not running |<p>Please check nginx service status</p> |`last(/PFSense SNMP/pfsense.nginx.status)=0` |AVERAGE | |
+|PFSense: Web server is not running |<p>Please check nginx service status.</p> |`last(/PFSense SNMP/pfsense.nginx.status)=0` |AVERAGE | |
|PFSense: Unavailable by ICMP ping |<p>Last three attempts returned timeout. Please check device connectivity.</p> |`max(/PFSense SNMP/icmpping,#3)=0` |HIGH | |
-|PFSense: High ICMP ping loss |<p>ICMP packets loss detected</p> |`min(/PFSense SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/PFSense SNMP/icmppingloss,5m)<100` |WARNING |<p>**Depends on**:</p><p>- PFSense: Unavailable by ICMP ping</p> |
+|PFSense: High ICMP ping loss |<p>ICMP packets loss detected.</p> |`min(/PFSense SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/PFSense SNMP/icmppingloss,5m)<100` |WARNING |<p>**Depends on**:</p><p>- PFSense: Unavailable by ICMP ping</p> |
|PFSense: High ICMP ping response time |<p>Average ICMP response time is too big.</p> |`avg(/PFSense SNMP/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}` |WARNING |<p>**Depends on**:</p><p>- PFSense: Unavailable by ICMP ping</p> |
|PFSense: has been restarted |<p>Uptime is less than 10 minutes</p> |`last(/PFSense SNMP/system.uptime)<10m` |INFO |<p>Manual close: YES</p> |
|PFSense: No SNMP data collection |<p>SNMP is not available for polling. Please check device connectivity and SNMP settings.</p> |`max(/PFSense SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0` |WARNING |<p>**Depends on**:</p><p>- PFSense: Unavailable by ICMP ping</p> |
diff --git a/templates/app/pfsense_snmp/template_app_pfsense_snmp.yaml b/templates/app/pfsense_snmp/template_app_pfsense_snmp.yaml
index a0e43d0e42d..3a96db7aab1 100644
--- a/templates/app/pfsense_snmp/template_app_pfsense_snmp.yaml
+++ b/templates/app/pfsense_snmp/template_app_pfsense_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:33:31Z'
+ date: '2022-04-10T20:58:35Z'
groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
@@ -83,7 +83,7 @@ zabbix_export:
name: 'PFSense: High ICMP ping loss'
opdata: 'Loss: {ITEM.LASTVALUE1}'
priority: WARNING
- description: 'ICMP packets loss detected'
+ description: 'ICMP packets loss detected.'
dependencies:
-
name: 'PFSense: Unavailable by ICMP ping'
@@ -230,7 +230,7 @@ zabbix_export:
name: 'PFSense: Web server is not running'
opdata: 'Current state: {ITEM.LASTVALUE1}'
priority: AVERAGE
- description: 'Please check nginx service status'
+ description: 'Please check nginx service status.'
tags:
-
tag: scope
@@ -246,7 +246,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -267,7 +267,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -288,7 +288,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -309,7 +309,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -330,7 +330,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -351,7 +351,7 @@ zabbix_export:
units: pps
description: |
MIB: BEGEMOT-PF-MIB
- True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory
+ True if the packet was logged with the specified packet filter reason code. The known codes are: match, bad-offset, fragment, short, normalize, and memory.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -370,7 +370,7 @@ zabbix_export:
history: 7d
description: |
MIB: BEGEMOT-PF-MIB
- True if packet filter is currently enabled
+ True if packet filter is currently enabled.
valuemap:
name: 'SNMPv2-TC::TruthValue'
tags:
@@ -387,7 +387,7 @@ zabbix_export:
name: 'PFSense: Packet filter is not running'
opdata: 'Current running state: {ITEM.LASTVALUE1}'
priority: HIGH
- description: 'Please check PF status'
+ description: 'Please check PF status.'
tags:
-
tag: scope
@@ -549,7 +549,7 @@ zabbix_export:
value_type: FLOAT
description: |
MIB: UCD-SNMP-MIB
- Number of interrupts processed
+ Number of interrupts processed.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -613,7 +613,7 @@ zabbix_export:
history: 7d
description: |
MIB: HOST-RESOURCES-MIB
- Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD
+ Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD.
preprocessing:
-
type: JAVASCRIPT
@@ -635,7 +635,7 @@ zabbix_export:
value_type: FLOAT
description: |
MIB: UCD-SNMP-MIB
- Number of context switches
+ Number of context switches.
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -843,7 +843,7 @@ zabbix_export:
name: 'PFSense: has been restarted'
event_name: 'PFSense: has been restarted (uptime < 10m)'
priority: INFO
- description: 'Uptime is less than 10 minutes'
+ description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
tags:
-
@@ -932,7 +932,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Total memory in Bytes
+ Total memory in Bytes.
preprocessing:
-
type: MULTIPLIER
@@ -1181,7 +1181,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -1348,7 +1348,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv4 bits per second blocked coming in on this interface.
preprocessing:
-
@@ -1381,7 +1381,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv4 packets blocked coming in on this interface.
preprocessing:
-
@@ -1410,7 +1410,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv6 bits per second blocked coming in on this interface.
preprocessing:
-
@@ -1443,7 +1443,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv6 packets blocked coming in on this interface.
preprocessing:
-
@@ -1527,10 +1527,10 @@ zabbix_export:
event_name: 'PFSense: High input error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m)'
opdata: 'errors in: {ITEM.LASTVALUE1}'
priority: WARNING
- description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold'
+ description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.'
dependencies:
-
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
tags:
-
@@ -1545,7 +1545,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv4 bits per second passed coming in on this interface.
preprocessing:
-
@@ -1578,7 +1578,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv4 packets passed coming in on this interface.
preprocessing:
-
@@ -1607,7 +1607,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv6 bits per second passed coming in on this interface.
preprocessing:
-
@@ -1640,7 +1640,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv6 packets passed coming in on this interface.
preprocessing:
-
@@ -1699,7 +1699,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv4 bits per second blocked going out on this interface.
preprocessing:
-
@@ -1732,7 +1732,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv4 packets blocked going out on this interface.
preprocessing:
-
@@ -1761,7 +1761,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv6 bits per second blocked going out on this interface.
preprocessing:
-
@@ -1794,7 +1794,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv6 packets blocked going out on this interface.
preprocessing:
-
@@ -1878,10 +1878,10 @@ zabbix_export:
event_name: 'PFSense: High output error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m)'
opdata: 'errors out: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold'
+ description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.'
dependencies:
-
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
tags:
-
@@ -1896,7 +1896,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv4 bits per second passed going out on this interface.
preprocessing:
-
@@ -1929,7 +1929,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv4 packets passed going out on this interface.
preprocessing:
-
@@ -1958,7 +1958,7 @@ zabbix_export:
history: 7d
units: bps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
IPv6 bits per second passed going out on this interface.
preprocessing:
-
@@ -1991,7 +1991,7 @@ zabbix_export:
history: 7d
units: pps
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of IPv6 packets passed going out on this interface.
preprocessing:
-
@@ -2049,7 +2049,7 @@ zabbix_export:
key: 'net.if.rules.refs[{#SNMPINDEX}]'
history: 7d
description: |
- BEGEMOT-PF-MIB
+ MIB: BEGEMOT-PF-MIB
The number of rules referencing this interface.
tags:
-
@@ -2131,7 +2131,7 @@ zabbix_export:
-
uuid: d4392162d62541aeb148718ddd7f5d57
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
opdata: 'Current state: {ITEM.LASTVALUE1}'
priority: AVERAGE
description: |
@@ -2190,13 +2190,13 @@ zabbix_export:
recovery_expression: |
(change(/PFSense SNMP/net.if.speed[{#SNMPINDEX}])>0 and last(/PFSense SNMP/net.if.speed[{#SNMPINDEX}],#2)>0) or
(last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)
- name: 'PFSense: Ethernet has changed to lower speed than it was before'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Ethernet has changed to lower speed than it was before'
opdata: 'Current reported speed: {ITEM.LASTVALUE1}'
priority: INFO
description: 'This Ethernet connection has transitioned down from its known maximum speed. This might be a sign of autonegotiation issues. Ack to close.'
dependencies:
-
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
tags:
-
@@ -2216,7 +2216,7 @@ zabbix_export:
description: 'The network interface utilization is close to its estimated maximum bandwidth.'
dependencies:
-
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
tags:
-
@@ -2236,7 +2236,7 @@ zabbix_export:
description: 'The network interface utilization is close to its estimated maximum bandwidth.'
dependencies:
-
- name: 'PFSense: Link down'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Link down'
expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/PFSense SNMP/net.if.status[{#SNMPINDEX}])=2)'
tags:
-
@@ -2245,7 +2245,7 @@ zabbix_export:
graph_prototypes:
-
uuid: 4679de2da218418e9564f0cc5a13e31a
- name: 'PFSense: Inbound packet filter traffic interface [{#IFNAME}({#IFALIAS})]'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Inbound packet filter traffic'
graph_items:
-
color: 1A7C11
@@ -2300,7 +2300,7 @@ zabbix_export:
key: 'net.if.in.block.v6.pps[{#SNMPINDEX}]'
-
uuid: 3acc01b7ad11441ca2ea4dab13274efa
- name: 'PFSense: Network traffic interface [{#IFNAME}({#IFALIAS})]'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Network traffic'
graph_items:
-
drawtype: GRADIENT_LINE
@@ -2345,7 +2345,7 @@ zabbix_export:
key: 'net.if.in.discards[{#SNMPINDEX}]'
-
uuid: 58b7aa7618274c9e9285d4c0b63c2ca8
- name: 'PFSense: Outbound packet filter traffic interface [{#IFNAME}({#IFALIAS})]'
+ name: 'PFSense: Interface [{#IFNAME}({#IFALIAS})]: Outbound packet filter traffic'
graph_items:
-
color: 1A7C11
@@ -2417,7 +2417,7 @@ zabbix_export:
value: '{$VFS.DEV.DEVNAME.NOT_MATCHES}'
operator: NOT_MATCHES_REGEX
formulaid: B
- description: 'Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable)'
+ description: 'Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable).'
item_prototypes:
-
uuid: afda1ff507ea43f39dceaf76f3552690
@@ -2454,7 +2454,7 @@ zabbix_export:
units: '%'
description: |
MIB: UCD-DISKIO-MIB
- The 1 minute average load of disk (%)
+ The 1 minute average load of disk (%).
tags:
-
tag: component
@@ -2489,7 +2489,7 @@ zabbix_export:
graph_prototypes:
-
uuid: 68683d3f206245639c89bda5da17e0d3
- name: 'PFSense: Disk [{#DEVNAME}] read/write rates'
+ name: 'PFSense: [{#DEVNAME}]: Disk read/write rates'
graph_items:
-
color: 1A7C11
@@ -2531,7 +2531,7 @@ zabbix_export:
value: '{$VFS.FS.FSNAME.NOT_MATCHES}'
operator: NOT_MATCHES_REGEX
formulaid: B
- description: 'HOST-RESOURCES-MIB::hrFS discovery with filter'
+ description: 'HOST-RESOURCES-MIB::hrFS discovery with filter.'
item_prototypes:
-
uuid: 73c51f990076413f959abe81cdcd5225
@@ -2660,16 +2660,16 @@ zabbix_export:
uuid: 711e2c5b136e4a51a2fb745d847a9fc5
expression: |
last(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<5G or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
- name: 'PFSense: Disk space is critically low'
+ ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
+ name: 'PFSense: [{#FSNAME}]: Disk space is critically low'
event_name: 'PFSense: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"PFSense"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
priority: AVERAGE
description: |
- Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"PFSense"}.
- Second condition should be one of the following:
- - The disk free space is less than 5G.
- - The disk will be full in less than 24 hours.
+ Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
+ Second condition should be one of the following:
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
+ - The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
-
@@ -2682,23 +2682,23 @@ zabbix_export:
uuid: ef0273e1092a40ff888e0ea87c859abb
expression: |
last(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<10G or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
- name: 'PFSense: Disk space is low'
+ ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
+ name: 'PFSense: [{#FSNAME}]: Disk space is low'
event_name: 'PFSense: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"PFSense"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
priority: WARNING
description: |
- Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"PFSense"}.
- Second condition should be one of the following:
- - The disk free space is less than 10G.
- - The disk will be full in less than 24 hours.
+ Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
+ Second condition should be one of the following:
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
+ - The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
-
name: 'PFSense: Disk space is critically low'
expression: |
last(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<5G or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
+ ((last(/PFSense SNMP/vfs.fs.total[{#SNMPINDEX}])-last(/PFSense SNMP/vfs.fs.used[{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/PFSense SNMP/vfs.fs.pused[{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -2709,7 +2709,7 @@ zabbix_export:
graph_prototypes:
-
uuid: af57ea943b0f45f6b03028ef48c07605
- name: 'PFSense: Disk [{#FSNAME}] space usage'
+ name: 'PFSense: [{#FSNAME}]: Disk space usage'
width: '600'
height: '340'
type: PIE
@@ -2846,6 +2846,14 @@ zabbix_export:
value: '^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|cd[0-9]*|pass[0-9]*|zram[0-9]*)'
description: 'This macro is used in block devices discovery. Can be overridden on the host or linked template level'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -3816,7 +3824,7 @@ zabbix_export:
event_name: 'PFSense: High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'PFSense: High memory utilization'
@@ -3838,7 +3846,7 @@ zabbix_export:
event_name: 'PFSense: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})'
opdata: 'Available: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: AVERAGE
- description: 'The system is running out of memory'
+ description: 'The system is running out of memory.'
tags:
-
tag: scope
diff --git a/templates/app/proxmox/README.md b/templates/app/proxmox/README.md
new file mode 100644
index 00000000000..dc6ea199431
--- /dev/null
+++ b/templates/app/proxmox/README.md
@@ -0,0 +1,145 @@
+
+# Proxmox VE by HTTP
+
+## Overview
+
+For Zabbix version: 6.0 and higher
+Proxmox VE uses a REST like API. The concept is described in (Resource Oriented Architecture - ROA).
+
+We choose JSON as primary data format, and the whole API is formally defined using JSON Schema.
+
+You can explore the API documentation at http://pve.proxmox.com/pve-docs/api-viewer/index.html
+
+
+## Setup
+
+Create an API token for the monitoring user. Important note: for security reasons, it is recommended to create a separate user (Datacenter - Permissions).
+
+For the created API token and user, provide the necessary access levels:
+
+* Check: ["perm","/",["Sys.Audit"]]
+
+* Check: ["perm","/nodes/{node}",["Sys.Audit"]]
+
+* Check: ["perm","/vms/{vmid}",["VM.Audit"]]
+
+Copy the resulting Token ID and Secret into host macros.
+
+
+## Zabbix configuration
+
+No specific Zabbix configuration is required.
+
+### Macros used
+
+|Name|Description|Default|
+|----|-----------|-------|
+|{$PVE.CPU.PUSE.MAX.WARN} |<p>Maximum used CPU in percentage.</p> |`90` |
+|{$PVE.LXC.CPU.PUSE.MAX.WARN} |<p>Maximum used CPU in percentage.</p> |`90` |
+|{$PVE.LXC.MEMORY.PUSE.MAX.WARN} |<p>Maximum used memory in percentage.</p> |`90` |
+|{$PVE.MEMORY.PUSE.MAX.WARN} |<p>Maximum used memory in percentage.</p> |`90` |
+|{$PVE.ROOT.PUSE.MAX.WARN} |<p>Maximum used root space in percentage.</p> |`90` |
+|{$PVE.STORAGE.PUSE.MAX.WARN} |<p>Maximum used storage space in percentage.</p> |`90` |
+|{$PVE.SWAP.PUSE.MAX.WARN} |<p>Maximum used swap space in percentage.</p> |`90` |
+|{$PVE.TOKEN.ID} |<p>API tokens allow stateless access to most parts of the REST API by another system, software or API client.</p> |`USER@REALM!TOKENID` |
+|{$PVE.TOKEN.SECRET} |<p>Secret key.</p> |`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
+|{$PVE.URL.PORT} |<p>The API uses the HTTPS protocol and the server listens to port 8006 by default.</p> |`8006` |
+|{$PVE.VM.CPU.PUSE.MAX.WARN} |<p>Maximum used CPU in percentage.</p> |`90` |
+|{$PVE.VM.MEMORY.PUSE.MAX.WARN} |<p>Maximum used memory in percentage.</p> |`90` |
+
+## Template links
+
+There are no template links in this template.
+
+## Discovery rules
+
+|Name|Description|Type|Key and additional info|
+|----|-----------|----|----|
+|Cluster discovery |<p>-</p> |DEPENDENT |proxmox.cluster.discovery<p>**Filter**:</p>AND <p>- {#RESOURCE.TYPE} MATCHES_REGEX `^cluster$`</p> |
+|LXC discovery |<p>-</p> |DEPENDENT |proxmox.lxc.discovery<p>**Filter**:</p>AND <p>- {#RESOURCE.TYPE} MATCHES_REGEX `^lxc$`</p> |
+|Node discovery |<p>-</p> |DEPENDENT |proxmox.node.discovery<p>**Filter**:</p>AND <p>- {#RESOURCE.TYPE} MATCHES_REGEX `^node$`</p> |
+|QEMU discovery |<p>-</p> |DEPENDENT |proxmox.qemu.discovery<p>**Filter**:</p>AND <p>- {#RESOURCE.TYPE} MATCHES_REGEX `^qemu$`</p> |
+|Storage discovery |<p>-</p> |DEPENDENT |proxmox.storage.discovery<p>**Filter**:</p>AND <p>- {#RESOURCE.TYPE} MATCHES_REGEX `^storage$`</p> |
+
+## Items collected
+
+|Group|Name|Description|Type|Key and additional info|
+|-----|----|-----------|----|---------------------|
+|CPU |Proxmox: Node [{#NODE.NAME}]: CPU, usage |<p>CPU usage.</p> |DEPENDENT |proxmox.node.cpu[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.cpu`</p><p>- MULTIPLIER: `100`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|CPU |Proxmox: Node [{#NODE.NAME}]: CPU, loadavg |<p>CPU average load.</p> |DEPENDENT |proxmox.node.loadavg[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.loadavg`</p><p>- MULTIPLIER: `100`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|CPU |Proxmox: Node [{#NODE.NAME}]: CPU, iowait |<p>CPU iowait time.</p> |DEPENDENT |proxmox.node.iowait[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.iowait`</p><p>- MULTIPLIER: `100`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|CPU |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: CPU usage |<p>CPU load.</p> |DEPENDENT |proxmox.qemu.cpu[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.cpu`</p><p>- MULTIPLIER: `100`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|CPU |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: CPU usage |<p>CPU load.</p> |DEPENDENT |proxmox.lxc.cpu[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.cpu`</p><p>- MULTIPLIER: `100`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|General |Proxmox: Node [{#NODE.NAME}]: Time zone |<p>Time zone.</p> |DEPENDENT |proxmox.node.timezone[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.timezone`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
+|General |Proxmox: Node [{#NODE.NAME}]: Localtime |<p>Seconds since 1970-01-01 00:00:00 (local time).</p> |DEPENDENT |proxmox.node.localtime[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.localtime`</p> |
+|General |Proxmox: Node [{#NODE.NAME}]: Time |<p>Seconds since 1970-01-01 00:00:00 UTC.</p> |DEPENDENT |proxmox.node.utctime[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.time`</p> |
+|Inventory |Proxmox: Node [{#NODE.NAME}]: PVE version |<p>PVE manager version.</p> |DEPENDENT |proxmox.node.pveversion[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.pveversion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
+|Inventory |Proxmox: Node [{#NODE.NAME}]: Kernel version |<p>Kernel version info.</p> |DEPENDENT |proxmox.node.kernelversion[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.kversion`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
+|Memory |Proxmox: Node [{#NODE.NAME}]: Memory, used |<p>Memory usage.</p> |DEPENDENT |proxmox.node.memused[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.memused`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Memory |Proxmox: Node [{#NODE.NAME}]: Memory, total |<p>Memory total.</p> |DEPENDENT |proxmox.node.memtotal[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.memtotal`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Memory |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Memory usage |<p>Used memory in Bytes.</p> |DEPENDENT |proxmox.qemu.mem[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.mem`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Memory |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Memory total |<p>Total memory in Bytes.</p> |DEPENDENT |proxmox.qemu.maxmem[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.maxmem`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Memory |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Memory usage |<p>Used memory in Bytes.</p> |DEPENDENT |proxmox.lxc.mem[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.mem`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Memory |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Memory total |<p>Total memory in Bytes.</p> |DEPENDENT |proxmox.lxc.maxmem[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.maxmem`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: Node [{#NODE.NAME}]: Outgoing data, rate |<p>Network usage.</p> |DEPENDENT |proxmox.node.netout[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.netout`</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: Node [{#NODE.NAME}]: Incoming data, rate |<p>Network usage.</p> |DEPENDENT |proxmox.node.netin[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.netin`</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Incoming data, rate |<p>Incoming data rate.</p> |DEPENDENT |proxmox.qemu.netin[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netin`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Outgoing data, rate |<p>Outgoing data rate.</p> |DEPENDENT |proxmox.qemu.netout[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netout`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Incoming data, rate |<p>Incoming data rate.</p> |DEPENDENT |proxmox.lxc.netin[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netin`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Network interfaces |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Outgoing data, rate |<p>Outgoing data rate.</p> |DEPENDENT |proxmox.lxc.netout[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.netout`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Status |Proxmox: API service status |<p>Get API service status.</p> |SCRIPT |proxmox.api.available<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p><p>**Expression**:</p>`The text is too long. Please see the template.` |
+|Status |Proxmox: Cluster [{#RESOURCE.NAME}]: Quorate |<p>Indicates if there is a majority of nodes online to make decisions.</p> |DEPENDENT |proxmox.cluster.quorate[{#RESOURCE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.[?(@.name == '{#RESOURCE.NAME}' && @.type == 'cluster')].quorate.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Status |Proxmox: Node [{#NODE.NAME}]: Status |<p>Indicates if the node is online or offline.</p> |DEPENDENT |proxmox.node.online[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.[?(@.name == '{#NODE.NAME}' && @.type == 'node')].online.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Status |Proxmox: Node [{#NODE.NAME}]: Uptime |<p>System uptime in 'N days, hh:mm:ss' format.</p> |DEPENDENT |proxmox.node.uptime[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.uptime`</p> |
+|Status |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Uptime |<p>System uptime in 'N days, hh:mm:ss' format.</p> |DEPENDENT |proxmox.qemu.uptime[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.uptime`</p> |
+|Status |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Status |<p>-</p> |DEPENDENT |proxmox.qemu.vmstatus[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.status`</p> |
+|Status |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Uptime |<p>System uptime in 'N days, hh:mm:ss' format.</p> |DEPENDENT |proxmox.lxc.uptime[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.uptime`</p> |
+|Status |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Status |<p>-</p> |DEPENDENT |proxmox.lxc.vmstatus[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.status`</p> |
+|Storage |Proxmox: Node [{#NODE.NAME}]: Root filesystem, used |<p>Root filesystem usage.</p> |DEPENDENT |proxmox.node.rootused[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.rootused`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: Node [{#NODE.NAME}]: Root filesystem, total |<p>Root filesystem total.</p> |DEPENDENT |proxmox.node.roottotal[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.roottotal`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: Node [{#NODE.NAME}]: Swap filesystem, total |<p>Swap total.</p> |DEPENDENT |proxmox.node.swaptotal[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.swaptotal`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: Node [{#NODE.NAME}]: Swap filesystem, used |<p>Swap used.</p> |DEPENDENT |proxmox.node.swapused[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.swapused`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Type |<p>More specific type, if available.</p> |DEPENDENT |proxmox.node.plugintype[{#NODE.NAME},{#STORAGE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].plugintype.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
+|Storage |Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Size |<p>Storage size in bytes.</p> |DEPENDENT |proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].maxdisk.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Content |<p>Allowed storage content types.</p> |DEPENDENT |proxmox.node.content[{#NODE.NAME},{#STORAGE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].content.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
+|Storage |Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Used |<p>Used disk space in bytes.</p> |DEPENDENT |proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].disk.first()`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Disk write, rate |<p>Disk write.</p> |DEPENDENT |proxmox.qemu.diskwrite[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskwrite`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Disk read, rate |<p>Disk read.</p> |DEPENDENT |proxmox.qemu.diskread[{#QEMU.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskread`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk write, rate |<p>Disk write.</p> |DEPENDENT |proxmox.lxc.diskwrite[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskwrite`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Storage |Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk read, rate |<p>Disk read.</p> |DEPENDENT |proxmox.lxc.diskread[{#LXC.ID}]<p>**Preprocessing**:</p><p>- JSONPATH: `$.data.diskread`</p><p>- CHANGE_PER_SECOND</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `10m`</p> |
+|Zabbix raw items |Proxmox: Get cluster resources |<p>Resources index.</p> |HTTP_AGENT |proxmox.cluster.resources<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> Error getting data`</p> |
+|Zabbix raw items |Proxmox: Get cluster status |<p>Get cluster status information.</p> |HTTP_AGENT |proxmox.cluster.status<p>**Preprocessing**:</p><p>- CHECK_NOT_SUPPORTED</p><p>⛔️ON_FAIL: `CUSTOM_VALUE -> Error getting data`</p> |
+|Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: Status |<p>Read node status.</p> |HTTP_AGENT |proxmox.node.status[{#NODE.NAME}] |
+|Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: RRD statistics |<p>Read node RRD statistics.</p> |HTTP_AGENT |proxmox.node.rrd[{#NODE.NAME}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `var rrd_data = JSON.parse(value).data; return JSON.stringify(rrd_data[rrd_data.length - 2]) `</p> |
+|Zabbix raw items |Proxmox: Node [{#NODE.NAME}]: Time |<p>Read server time and time zone settings.</p> |HTTP_AGENT |proxmox.node.time[{#NODE.NAME}] |
+|Zabbix raw items |Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME}]: Status |<p>Read VM status.</p> |HTTP_AGENT |proxmox.qemu.status[{#QEMU.ID}] |
+|Zabbix raw items |Proxmox: LXC [{#LXC.NAME}/{#LXC.NAME}]: Status |<p>Read LXC status.</p> |HTTP_AGENT |proxmox.lxc.status[{#LXC.ID}] |
+
+## Triggers
+
+|Name|Description|Expression|Severity|Dependencies and additional info|
+|----|-----------|----|----|----|
+|Proxmox: Node [{#NODE.NAME}] high CPU usage |<p>CPU usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.cpu[{#NODE.NAME}],5m) > {$PVE.CPU.PUSE.MAX.WARN:"{#NODE.NAME}"}` |WARNING | |
+|Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high CPU usage |<p>CPU usage.</p> |`min(/Proxmox VE by HTTP/proxmox.qemu.cpu[{#QEMU.ID}],5m) > {$PVE.VM.CPU.PUSE.MAX.WARN:"{#QEMU.ID}"}` |WARNING | |
+|Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high CPU usage |<p>CPU usage.</p> |`min(/Proxmox VE by HTTP/proxmox.lxc.cpu[{#LXC.ID}],5m) > {$PVE.LXC.CPU.PUSE.MAX.WARN:"{#LXC.ID}"}` |WARNING | |
+|Proxmox: Node [{#NODE.NAME}]: PVE manager has changed |<p>Firmware version has changed. Ack to close</p> |`last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}],#1)<>last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}],#2) and length(last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}]))>0` |INFO |<p>Manual close: YES</p> |
+|Proxmox: Node [{#NODE.NAME}]: Kernel version has changed |<p>Firmware version has changed. Ack to close</p> |`last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}],#1)<>last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}],#2) and length(last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}]))>0` |INFO |<p>Manual close: YES</p> |
+|Proxmox: Node [{#NODE.NAME}] high memory usage |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.memused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.memtotal[{#NODE.NAME}]) * 100 >{$PVE.MEMORY.PUSE.MAX.WARN:"{#NODE.NAME}"}` |WARNING | |
+|Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high memory usage |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.qemu.mem[{#QEMU.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.qemu.maxmem[{#QEMU.ID}]) * 100 >{$PVE.VM.MEMORY.PUSE.MAX.WARN:"{#QEMU.ID}"}` |WARNING | |
+|Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high memory usage |<p>Memory usage.</p> |`min(/Proxmox VE by HTTP/proxmox.lxc.mem[{#LXC.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.lxc.maxmem[{#LXC.ID}]) * 100 >{$PVE.LXC.MEMORY.PUSE.MAX.WARN:"{#LXC.ID}"}` |WARNING | |
+|Proxmox: API service not available |<p>The API service is not available. Check your network and authorization settings.</p> |`last(/Proxmox VE by HTTP/proxmox.api.available) <> 200` |HIGH | |
+|Proxmox: Cluster [{#RESOURCE.NAME}] not quorum |<p>Proxmox VE use a quorum-based technique to provide a consistent state among all cluster nodes.</p> |`last(/Proxmox VE by HTTP/proxmox.cluster.quorate[{#RESOURCE.NAME}]) <> 1` |HIGH | |
+|Proxmox: Node [{#NODE.NAME}] offline |<p>Node offline.</p> |`last(/Proxmox VE by HTTP/proxmox.node.online[{#NODE.NAME}]) <> 1` |HIGH | |
+|Proxmox: Node [{#NODE.NAME}]: has been restarted |<p>Uptime is less than 10 minutes</p> |`last(/Proxmox VE by HTTP/proxmox.node.uptime[{#NODE.NAME}])<10m` |INFO |<p>Manual close: YES</p> |
+|Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME}]: has been restarted |<p>Uptime is less than 10 minutes</p> |`last(/Proxmox VE by HTTP/proxmox.qemu.uptime[{#QEMU.ID}])<10m` |INFO |<p>Manual close: YES</p> |
+|Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Not running |<p>VM state is not "running".</p> |`last(/Proxmox VE by HTTP/proxmox.qemu.vmstatus[{#QEMU.ID}])<>"running"` |AVERAGE | |
+|Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME}]: has been restarted |<p>Uptime is less than 10 minutes</p> |`last(/Proxmox VE by HTTP/proxmox.lxc.uptime[{#LXC.ID}])<10m` |INFO |<p>Manual close: YES</p> |
+|Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Not running |<p>LXC state is not "running".</p> |`last(/Proxmox VE by HTTP/proxmox.lxc.vmstatus[{#LXC.ID}])<>"running"` |AVERAGE | |
+|Proxmox: Node [{#NODE.NAME}] high root filesystem space usage |<p>Root filesystem space usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.rootused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.roottotal[{#NODE.NAME}]) * 100 >{$PVE.ROOT.PUSE.MAX.WARN:"{#NODE.NAME}"}` |WARNING | |
+|Proxmox: Node [{#NODE.NAME}] high root filesystem space usage |<p>This trigger is ignored, if there is no swap configured.</p> |`min(/Proxmox VE by HTTP/proxmox.node.swapused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) * 100 > {$PVE.SWAP.PUSE.MAX.WARN:"{#NODE.NAME}"} and last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) > 0` |WARNING | |
+|Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}] high filesystem space usage |<p>Root filesystem space usage.</p> |`min(/Proxmox VE by HTTP/proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]) * 100 >{$PVE.STORAGE.PUSE.MAX.WARN:"{#NODE.NAME}/{#STORAGE.NAME}"}` |WARNING | |
+
+## Feedback
+
+Please report any issues with the template at https://support.zabbix.com
+
diff --git a/templates/app/proxmox/template_app_proxmox.yaml b/templates/app/proxmox/template_app_proxmox.yaml
new file mode 100644
index 00000000000..05298f20763
--- /dev/null
+++ b/templates/app/proxmox/template_app_proxmox.yaml
@@ -0,0 +1,2401 @@
+zabbix_export:
+ version: '6.0'
+ date: '2022-04-06T07:48:16Z'
+ groups:
+ -
+ uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
+ name: Templates/Applications
+ templates:
+ -
+ uuid: 4958b76448d74ff1b6d7d6280449beee
+ template: 'Proxmox VE by HTTP'
+ name: 'Proxmox VE by HTTP'
+ description: 'Template tooling version used: 0.41'
+ groups:
+ -
+ name: Templates/Applications
+ items:
+ -
+ uuid: 75f8f8c507774f529ade4bc4255f5fd2
+ name: 'Proxmox: API service status'
+ type: SCRIPT
+ key: proxmox.api.available
+ delay: 5m
+ history: 7d
+ params: |
+ try {
+ var params = JSON.parse(value);
+ var req = new HttpRequest();
+ req.addHeader('Authorization: PVEAPIToken=' + params.token + '=' + params.secret);
+ req.get(encodeURI('https://' + params.url + ':' + params.port + '/api2/json/version'));
+ } catch (error) {
+ Zabbix.log(3, "Proxmox API failed: " + params.url + " Error: " + error);
+ if (!Number.isInteger(error))
+ return 520;
+ }
+ return req.getStatus();
+ description: 'Get API service status.'
+ valuemap:
+ name: 'HTTP response status code'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 12h
+ timeout: 10s
+ parameters:
+ -
+ name: token
+ value: '{$PVE.TOKEN.ID}'
+ -
+ name: secret
+ value: '{$PVE.TOKEN.SECRET}'
+ -
+ name: url
+ value: '{HOST.CONN}'
+ -
+ name: port
+ value: '{$PVE.URL.PORT}'
+ tags:
+ -
+ tag: component
+ value: system
+ triggers:
+ -
+ uuid: 7ef8290fd6e242339d0e56d5e8eedb1a
+ expression: 'last(/Proxmox VE by HTTP/proxmox.api.available) <> 200'
+ name: 'Proxmox: API service not available'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: HIGH
+ description: 'The API service is not available. Check your network and authorization settings.'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: 4fe4fa1323cd481f8aff3bfb716eeae2
+ name: 'Proxmox: Get cluster resources'
+ type: HTTP_AGENT
+ key: proxmox.cluster.resources
+ delay: 5m
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Resources index.'
+ preprocessing:
+ -
+ type: CHECK_NOT_SUPPORTED
+ parameters:
+ - ''
+ error_handler: CUSTOM_VALUE
+ error_handler_params: 'Error getting data'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/cluster/resources'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: 6e6a5046b8154bafad375813ca210e1f
+ name: 'Proxmox: Get cluster status'
+ type: HTTP_AGENT
+ key: proxmox.cluster.status
+ delay: 5m
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Get cluster status information.'
+ preprocessing:
+ -
+ type: CHECK_NOT_SUPPORTED
+ parameters:
+ - ''
+ error_handler: CUSTOM_VALUE
+ error_handler_params: 'Error getting data'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/cluster/status'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ discovery_rules:
+ -
+ uuid: e01bb8d7614144ba82e31d91618dee31
+ name: 'Cluster discovery'
+ type: DEPENDENT
+ key: proxmox.cluster.discovery
+ delay: '0'
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#RESOURCE.TYPE}'
+ value: ^cluster$
+ formulaid: A
+ item_prototypes:
+ -
+ uuid: 4b5d9197cfa042ceac1415a524912b63
+ name: 'Proxmox: Cluster [{#RESOURCE.NAME}]: Quorate'
+ type: DEPENDENT
+ key: 'proxmox.cluster.quorate[{#RESOURCE.NAME}]'
+ delay: '0'
+ history: 7d
+ description: 'Indicates if there is a majority of nodes online to make decisions.'
+ valuemap:
+ name: 'Cluster quorate'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data.[?(@.name == ''{#RESOURCE.NAME}'' && @.type == ''cluster'')].quorate.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: proxmox.cluster.status
+ tags:
+ -
+ tag: cluster
+ value: '{#RESOURCE.NAME}'
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 142e02d47b8a4ac9a9ad28b68b097ebd
+ expression: 'last(/Proxmox VE by HTTP/proxmox.cluster.quorate[{#RESOURCE.NAME}]) <> 1'
+ name: 'Proxmox: Cluster [{#RESOURCE.NAME}] not quorum'
+ opdata: 'Current value: {ITEM.LASTVALUE}'
+ priority: HIGH
+ description: 'Proxmox VE use a quorum-based technique to provide a consistent state among all cluster nodes.'
+ tags:
+ -
+ tag: scope
+ value: availability
+ master_item:
+ key: proxmox.cluster.status
+ lld_macro_paths:
+ -
+ lld_macro: '{#RESOURCE.TYPE}'
+ path: $.type
+ -
+ lld_macro: '{#RESOURCE.NAME}'
+ path: $.name
+ -
+ uuid: 78a4018328954d408e415aa0ce7ce41c
+ name: 'LXC discovery'
+ type: DEPENDENT
+ key: proxmox.lxc.discovery
+ delay: '0'
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#RESOURCE.TYPE}'
+ value: ^lxc$
+ formulaid: A
+ item_prototypes:
+ -
+ uuid: dda211b14d7b4c419196a98ee5153307
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: CPU usage'
+ type: DEPENDENT
+ key: 'proxmox.lxc.cpu[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU load.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.cpu
+ -
+ type: MULTIPLIER
+ parameters:
+ - '100'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ trigger_prototypes:
+ -
+ uuid: c0436342a19d4d6482fac70d2f04f530
+ expression: 'min(/Proxmox VE by HTTP/proxmox.lxc.cpu[{#LXC.ID}],5m) > {$PVE.LXC.CPU.PUSE.MAX.WARN:"{#LXC.ID}"}'
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high CPU usage'
+ event_name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high CPU usage (over {$PVE.LXC.CPU.PUSE.MAX.WARN:"{#LXC.ID}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'CPU usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 8bc1bb78bf1340f3ab8d9f888d081e23
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk read, rate'
+ type: DEPENDENT
+ key: 'proxmox.lxc.diskread[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: 'Disk read.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.diskread
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: cee89da9e4a842228b30cc708e4d7745
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk write, rate'
+ type: DEPENDENT
+ key: 'proxmox.lxc.diskwrite[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: 'Disk write.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.diskwrite
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 686490c2a07f4a859bc7f1d56056cc5e
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Memory total'
+ type: DEPENDENT
+ key: 'proxmox.lxc.maxmem[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Total memory in Bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.maxmem
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: a60eaec875d347bd9247a174ba84f21e
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Memory usage'
+ type: DEPENDENT
+ key: 'proxmox.lxc.mem[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Used memory in Bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.mem
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: b19b6b5895d64ed9b4942f955e66dc81
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Incoming data, rate'
+ type: DEPENDENT
+ key: 'proxmox.lxc.netin[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Incoming data rate.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.netin
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 5ac20ae95e664a3cb62b58cde4f67471
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Outgoing data, rate'
+ type: DEPENDENT
+ key: 'proxmox.lxc.netout[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Outgoing data rate.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.netout
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: lxc
+ value: '{#LXC.ID}'
+ -
+ tag: name
+ value: '{#LXC.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 58efec1a4bb94bfab59d5985d036811e
+ name: 'Proxmox: LXC [{#LXC.NAME}/{#LXC.NAME}]: Status'
+ type: HTTP_AGENT
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Read LXC status.'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/nodes/{#NODE.NAME}/{#LXC.ID}/status/current'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: bd213f6de4db4e1e84894b80acffa330
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Uptime'
+ type: DEPENDENT
+ key: 'proxmox.lxc.uptime[{#LXC.ID}]'
+ delay: '0'
+ history: 2w
+ trends: 0d
+ units: uptime
+ description: 'System uptime in ''N days, hh:mm:ss'' format.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.uptime
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 0e55935a79b94bc096b6213d500f4f59
+ expression: 'last(/Proxmox VE by HTTP/proxmox.lxc.uptime[{#LXC.ID}])<10m'
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME}]: has been restarted'
+ event_name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME}]: has been restarted (uptime < 10m)'
+ priority: INFO
+ description: 'Uptime is less than 10 minutes'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 535f521800564b0f83211740aabbc137
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Status'
+ type: DEPENDENT
+ key: 'proxmox.lxc.vmstatus[{#LXC.ID}]'
+ delay: '0'
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.status
+ master_item:
+ key: 'proxmox.lxc.status[{#LXC.ID}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 71623950edf44bcb9453b2e8e63cb97b
+ expression: 'last(/Proxmox VE by HTTP/proxmox.lxc.vmstatus[{#LXC.ID}])<>"running"'
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Not running'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: 'LXC state is not "running".'
+ tags:
+ -
+ tag: scope
+ value: notice
+ trigger_prototypes:
+ -
+ uuid: f59e43f9de01419897aec1b9d4539b48
+ expression: 'min(/Proxmox VE by HTTP/proxmox.lxc.mem[{#LXC.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.lxc.maxmem[{#LXC.ID}]) * 100 >{$PVE.LXC.MEMORY.PUSE.MAX.WARN:"{#LXC.ID}"}'
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high memory usage'
+ event_name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})] high memory usage (over {$PVE.LXC.MEMORY.PUSE.MAX.WARN:"{#LXC.ID}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Memory usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: faad4c399e6047ea9fd95ffea40ce511
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: CPU usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.cpu[{#LXC.ID}]'
+ -
+ uuid: 2a850f53e5064ee3b4fb99aa191d411d
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Disk usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.diskwrite[{#LXC.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.diskread[{#LXC.ID}]'
+ -
+ uuid: 54e79a1949ed40988a3901acf21bc3af
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Memory usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.mem[{#LXC.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.maxmem[{#LXC.ID}]'
+ -
+ uuid: c6f2970f22294c7d8de7548a177596de
+ name: 'Proxmox: LXC [{#NODE.NAME}/{#LXC.NAME} ({#LXC.ID})]: Network usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.netin[{#LXC.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.lxc.netout[{#LXC.ID}]'
+ master_item:
+ key: proxmox.cluster.resources
+ lld_macro_paths:
+ -
+ lld_macro: '{#RESOURCE.TYPE}'
+ path: $.type
+ -
+ lld_macro: '{#NODE.NAME}'
+ path: $.node
+ -
+ lld_macro: '{#LXC.NAME}'
+ path: $.name
+ -
+ lld_macro: '{#LXC.ID}'
+ path: $.id
+ -
+ uuid: ba55f69b12ee46faa319203483d8008f
+ name: 'Node discovery'
+ type: DEPENDENT
+ key: proxmox.node.discovery
+ delay: '0'
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#RESOURCE.TYPE}'
+ value: ^node$
+ formulaid: A
+ item_prototypes:
+ -
+ uuid: c5e50056abda49f190e21f46f8cf7379
+ name: 'Proxmox: Node [{#NODE.NAME}]: CPU, usage'
+ type: DEPENDENT
+ key: 'proxmox.node.cpu[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU usage.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.cpu
+ -
+ type: MULTIPLIER
+ parameters:
+ - '100'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ trigger_prototypes:
+ -
+ uuid: 84041dcb7c84426dad538ab32375fdb1
+ expression: 'min(/Proxmox VE by HTTP/proxmox.node.cpu[{#NODE.NAME}],5m) > {$PVE.CPU.PUSE.MAX.WARN:"{#NODE.NAME}"}'
+ name: 'Proxmox: Node [{#NODE.NAME}] high CPU usage'
+ event_name: 'Proxmox: Node [{#NODE.NAME}] high CPU usage (over {$PVE.CPU.PUSE.MAX.WARN:"{#NODE.NAME}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'CPU usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 78e02931cf5c4c93b9c0092bd407a897
+ name: 'Proxmox: Node [{#NODE.NAME}]: CPU, iowait'
+ type: DEPENDENT
+ key: 'proxmox.node.iowait[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU iowait time.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.iowait
+ -
+ type: MULTIPLIER
+ parameters:
+ - '100'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: c31b9d3f9f4d4f6fa5611038bb9a8401
+ name: 'Proxmox: Node [{#NODE.NAME}]: Kernel version'
+ type: DEPENDENT
+ key: 'proxmox.node.kernelversion[{#NODE.NAME}]'
+ delay: '0'
+ history: 2w
+ trends: '0'
+ value_type: CHAR
+ description: 'Kernel version info.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.kversion
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1d
+ master_item:
+ key: 'proxmox.node.status[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 4020236474e840acb1bc480eb8c52a1f
+ expression: 'last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}],#1)<>last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}],#2) and length(last(/Proxmox VE by HTTP/proxmox.node.kernelversion[{#NODE.NAME}]))>0'
+ name: 'Proxmox: Node [{#NODE.NAME}]: Kernel version has changed'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: INFO
+ description: 'Firmware version has changed. Ack to close'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 155bcbfd12f54614ab55d29e0fb5c2aa
+ name: 'Proxmox: Node [{#NODE.NAME}]: CPU, loadavg'
+ type: DEPENDENT
+ key: 'proxmox.node.loadavg[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU average load.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.loadavg
+ -
+ type: MULTIPLIER
+ parameters:
+ - '100'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 59aab7121b1f4ff0b98a38cc75f39fb3
+ name: 'Proxmox: Node [{#NODE.NAME}]: Localtime'
+ type: DEPENDENT
+ key: 'proxmox.node.localtime[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ units: unixtime
+ description: 'Seconds since 1970-01-01 00:00:00 (local time).'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.localtime
+ master_item:
+ key: 'proxmox.node.time[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 0bb66733d10843438a090bf39eae92e2
+ name: 'Proxmox: Node [{#NODE.NAME}]: Memory, total'
+ type: DEPENDENT
+ key: 'proxmox.node.memtotal[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Memory total.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.memtotal
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 04a2028e5d6640958da01c372f4407ec
+ name: 'Proxmox: Node [{#NODE.NAME}]: Memory, used'
+ type: DEPENDENT
+ key: 'proxmox.node.memused[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Memory usage.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.memused
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 892f3b733a25475cb8fe30eeca3750f2
+ name: 'Proxmox: Node [{#NODE.NAME}]: Incoming data, rate'
+ type: DEPENDENT
+ key: 'proxmox.node.netin[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Network usage.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.netin
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 3048c6c023bc4fb58a8710d7306052fb
+ name: 'Proxmox: Node [{#NODE.NAME}]: Outgoing data, rate'
+ type: DEPENDENT
+ key: 'proxmox.node.netout[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Network usage.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.netout
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: b8c3ff9544d5490286c668d3320d2ee0
+ name: 'Proxmox: Node [{#NODE.NAME}]: Status'
+ type: DEPENDENT
+ key: 'proxmox.node.online[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ description: 'Indicates if the node is online or offline.'
+ valuemap:
+ name: 'Node online'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data.[?(@.name == ''{#NODE.NAME}'' && @.type == ''node'')].online.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: proxmox.cluster.status
+ tags:
+ -
+ tag: component
+ value: cluster
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ trigger_prototypes:
+ -
+ uuid: 41b7efb8822948b08de8adace2e124a9
+ expression: 'last(/Proxmox VE by HTTP/proxmox.node.online[{#NODE.NAME}]) <> 1'
+ name: 'Proxmox: Node [{#NODE.NAME}] offline'
+ opdata: 'Current value: {ITEM.LASTVALUE}'
+ priority: HIGH
+ description: 'Node offline.'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: f220249168d947b6b8b99c068af35650
+ name: 'Proxmox: Node [{#NODE.NAME}]: PVE version'
+ type: DEPENDENT
+ key: 'proxmox.node.pveversion[{#NODE.NAME}]'
+ delay: '0'
+ history: 2w
+ trends: '0'
+ value_type: CHAR
+ description: 'PVE manager version.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.pveversion
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1d
+ master_item:
+ key: 'proxmox.node.status[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 5b92af55dbd84181bcab0f39e6effbe0
+ expression: 'last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}],#1)<>last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}],#2) and length(last(/Proxmox VE by HTTP/proxmox.node.pveversion[{#NODE.NAME}]))>0'
+ name: 'Proxmox: Node [{#NODE.NAME}]: PVE manager has changed'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: INFO
+ description: 'Firmware version has changed. Ack to close'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 067954795121482093dd7967c6ca6ede
+ name: 'Proxmox: Node [{#NODE.NAME}]: Root filesystem, total'
+ type: DEPENDENT
+ key: 'proxmox.node.roottotal[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Root filesystem total.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.roottotal
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 2beadf6ba8b04a21b008ddf63bd2fa6b
+ name: 'Proxmox: Node [{#NODE.NAME}]: Root filesystem, used'
+ type: DEPENDENT
+ key: 'proxmox.node.rootused[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Root filesystem usage.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.rootused
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: fa2a60a98fd4445eadff4398ae6872bd
+ name: 'Proxmox: Node [{#NODE.NAME}]: RRD statistics'
+ type: HTTP_AGENT
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Read node RRD statistics.'
+ preprocessing:
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ var rrd_data = JSON.parse(value).data;
+ return JSON.stringify(rrd_data[rrd_data.length - 2])
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/nodes/{#NODE.NAME}/rrddata'
+ query_fields:
+ -
+ name: timeframe
+ value: hour
+ -
+ name: cf
+ value: AVERAGE
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: c1ea4d4f83114c9b96fe81069602f060
+ name: 'Proxmox: Node [{#NODE.NAME}]: Status'
+ type: HTTP_AGENT
+ key: 'proxmox.node.status[{#NODE.NAME}]'
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Read node status.'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/nodes/{#NODE.NAME}/status'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: 0dce6e5edd6d4ddab69932796b4301c0
+ name: 'Proxmox: Node [{#NODE.NAME}]: Swap filesystem, total'
+ type: DEPENDENT
+ key: 'proxmox.node.swaptotal[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Swap total.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.swaptotal
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 5f42addb719a412da6fd448d38d1a7d0
+ name: 'Proxmox: Node [{#NODE.NAME}]: Swap filesystem, used'
+ type: DEPENDENT
+ key: 'proxmox.node.swapused[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Swap used.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.swapused
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.node.rrd[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 42d7b4ff315a4cfa9af1aed5e141661d
+ name: 'Proxmox: Node [{#NODE.NAME}]: Time zone'
+ type: DEPENDENT
+ key: 'proxmox.node.timezone[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: 'Time zone.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.timezone
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 12h
+ master_item:
+ key: 'proxmox.node.time[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: c0c03653a0af426b8f61c77cabab38a4
+ name: 'Proxmox: Node [{#NODE.NAME}]: Time'
+ type: HTTP_AGENT
+ key: 'proxmox.node.time[{#NODE.NAME}]'
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Read server time and time zone settings.'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/nodes/{#NODE.NAME}/time'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: fc7f5811d338484bba5393a8a5718f67
+ name: 'Proxmox: Node [{#NODE.NAME}]: Uptime'
+ type: DEPENDENT
+ key: 'proxmox.node.uptime[{#NODE.NAME}]'
+ delay: '0'
+ history: 2w
+ trends: 0d
+ units: uptime
+ description: 'System uptime in ''N days, hh:mm:ss'' format.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.uptime
+ master_item:
+ key: 'proxmox.node.status[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 529b69b98a86409d914d3464569b7901
+ expression: 'last(/Proxmox VE by HTTP/proxmox.node.uptime[{#NODE.NAME}])<10m'
+ name: 'Proxmox: Node [{#NODE.NAME}]: has been restarted'
+ event_name: 'Proxmox: Node [{#NODE.NAME}]: has been restarted (uptime < 10m)'
+ priority: INFO
+ description: 'Uptime is less than 10 minutes'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 384d479a04f044b192a74743f0a459b4
+ name: 'Proxmox: Node [{#NODE.NAME}]: Time'
+ type: DEPENDENT
+ key: 'proxmox.node.utctime[{#NODE.NAME}]'
+ delay: '0'
+ history: 7d
+ units: unixtime
+ description: 'Seconds since 1970-01-01 00:00:00 UTC.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.time
+ master_item:
+ key: 'proxmox.node.time[{#NODE.NAME}]'
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ trigger_prototypes:
+ -
+ uuid: a0445b4e1ffd451595ecea0468b4a6a6
+ expression: 'min(/Proxmox VE by HTTP/proxmox.node.memused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.memtotal[{#NODE.NAME}]) * 100 >{$PVE.MEMORY.PUSE.MAX.WARN:"{#NODE.NAME}"}'
+ name: 'Proxmox: Node [{#NODE.NAME}] high memory usage'
+ event_name: 'Proxmox: Node [{#NODE.NAME}] high memory usage (over {$PVE.MEMORY.PUSE.MAX.WARN:"{#NODE.NAME}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Memory usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 3f88526e10a14319983fe14621ef10f9
+ expression: 'min(/Proxmox VE by HTTP/proxmox.node.rootused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.roottotal[{#NODE.NAME}]) * 100 >{$PVE.ROOT.PUSE.MAX.WARN:"{#NODE.NAME}"}'
+ name: 'Proxmox: Node [{#NODE.NAME}] high root filesystem space usage'
+ event_name: 'Proxmox: Node [{#NODE.NAME}] high root filesystem space usage (over {$PVE.ROOT.PUSE.MAX.WARN:"{#NODE.NAME}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Root filesystem space usage.'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ uuid: f38ccc2e0e40430e801bf98b488e12e4
+ expression: 'min(/Proxmox VE by HTTP/proxmox.node.swapused[{#NODE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) * 100 > {$PVE.SWAP.PUSE.MAX.WARN:"{#NODE.NAME}"} and last(/Proxmox VE by HTTP/proxmox.node.swaptotal[{#NODE.NAME}]) > 0'
+ name: 'Proxmox: Node [{#NODE.NAME}] high root filesystem space usage'
+ event_name: 'Proxmox: Node [{#NODE.NAME}] high root filesystem space usage (over {$PVE.SWAP.PUSE.MAX.WARN:"{#NODE.NAME}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'This trigger is ignored, if there is no swap configured.'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ graph_prototypes:
+ -
+ uuid: 6c4fddd2a12d4e87987e47611e4a925f
+ name: 'Proxmox: Node [{#NODE.NAME}]: CPU usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.cpu[{#NODE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.iowait[{#NODE.NAME}]'
+ -
+ sortorder: '2'
+ drawtype: GRADIENT_LINE
+ color: F63100
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.loadavg[{#NODE.NAME}]'
+ -
+ uuid: 0d59c329f12b494ebc8ff458a6b4714a
+ name: 'Proxmox: Node [{#NODE.NAME}]: Memory usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.memused[{#NODE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.memtotal[{#NODE.NAME}]'
+ -
+ uuid: f07213b83a964aac9f51e2857936bef2
+ name: 'Proxmox: Node [{#NODE.NAME}]: Network usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.netin[{#NODE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.netout[{#NODE.NAME}]'
+ -
+ uuid: f24340ea09324dd594f84c140f2797cc
+ name: 'Proxmox: Node [{#NODE.NAME}]: Root filesystem usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.rootused[{#NODE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.roottotal[{#NODE.NAME}]'
+ -
+ uuid: f47c4c734737403d97a630f5f10b7d84
+ name: 'Proxmox: Node [{#NODE.NAME}]: Swap usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.swapused[{#NODE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.swaptotal[{#NODE.NAME}]'
+ master_item:
+ key: proxmox.cluster.resources
+ lld_macro_paths:
+ -
+ lld_macro: '{#RESOURCE.TYPE}'
+ path: $.type
+ -
+ lld_macro: '{#NODE.NAME}'
+ path: $.node
+ -
+ uuid: 31aa7234aa294fce8f4735a9216ddf31
+ name: 'QEMU discovery'
+ type: DEPENDENT
+ key: proxmox.qemu.discovery
+ delay: '0'
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#RESOURCE.TYPE}'
+ value: ^qemu$
+ formulaid: A
+ item_prototypes:
+ -
+ uuid: 196bf027d77742ea8960e350d9ea579e
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: CPU usage'
+ type: DEPENDENT
+ key: 'proxmox.qemu.cpu[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU load.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.cpu
+ -
+ type: MULTIPLIER
+ parameters:
+ - '100'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ trigger_prototypes:
+ -
+ uuid: 84ed68d7cf2b48a48fc44e9c7a0d9b92
+ expression: 'min(/Proxmox VE by HTTP/proxmox.qemu.cpu[{#QEMU.ID}],5m) > {$PVE.VM.CPU.PUSE.MAX.WARN:"{#QEMU.ID}"}'
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high CPU usage'
+ event_name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high CPU usage (over {$PVE.VM.CPU.PUSE.MAX.WARN:"{#QEMU.ID}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'CPU usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: ffd3c0a6e9764d9ea0091d2fcf0234e2
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Disk read, rate'
+ type: DEPENDENT
+ key: 'proxmox.qemu.diskread[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: 'Disk read.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.diskread
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: 7c02301822414849b8dc38ae26c74a7b
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Disk write, rate'
+ type: DEPENDENT
+ key: 'proxmox.qemu.diskwrite[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: 'Disk write.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.diskwrite
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: 3c46d7e2f07049fc8f749157cf5627e9
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Memory total'
+ type: DEPENDENT
+ key: 'proxmox.qemu.maxmem[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Total memory in Bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.maxmem
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: 9f4402482af549288f32f108ab801950
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Memory usage'
+ type: DEPENDENT
+ key: 'proxmox.qemu.mem[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: 'Used memory in Bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.mem
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: ffd3c0a6e9764d9ea0091d2fcf0234e2
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Incoming data, rate'
+ type: DEPENDENT
+ key: 'proxmox.qemu.netin[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Incoming data rate.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.netin
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: 2cd398f1b9814551a7fad7e2bc66f6af
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Outgoing data, rate'
+ type: DEPENDENT
+ key: 'proxmox.qemu.netout[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: bps
+ description: 'Outgoing data rate.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.netout
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: name
+ value: '{#QEMU.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ tag: qemu
+ value: '{#QEMU.ID}'
+ -
+ uuid: a3562f2f48834a88842da612fb6f464c
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME}]: Status'
+ type: HTTP_AGENT
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ history: '0'
+ trends: '0'
+ value_type: TEXT
+ description: 'Read VM status.'
+ url: 'https://{HOST.CONN}:{$PVE.URL.PORT}/api2/json/nodes/{#NODE.NAME}/{#QEMU.ID}/status/current'
+ headers:
+ -
+ name: Authorization
+ value: 'PVEAPIToken={$PVE.TOKEN.ID}={$PVE.TOKEN.SECRET}'
+ tags:
+ -
+ tag: component
+ value: raw
+ -
+ uuid: 77ba70e0ce6f486585f870d3b57033ba
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Uptime'
+ type: DEPENDENT
+ key: 'proxmox.qemu.uptime[{#QEMU.ID}]'
+ delay: '0'
+ history: 2w
+ trends: 0d
+ units: uptime
+ description: 'System uptime in ''N days, hh:mm:ss'' format.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.uptime
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: d4ba1faeb67940a192c1b50460793813
+ expression: 'last(/Proxmox VE by HTTP/proxmox.qemu.uptime[{#QEMU.ID}])<10m'
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME}]: has been restarted'
+ event_name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME}]: has been restarted (uptime < 10m)'
+ priority: INFO
+ description: 'Uptime is less than 10 minutes'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 77ba70e0ce6f486585f870d3b57033ba
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Status'
+ type: DEPENDENT
+ key: 'proxmox.qemu.vmstatus[{#QEMU.ID}]'
+ delay: '0'
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - $.data.status
+ master_item:
+ key: 'proxmox.qemu.status[{#QEMU.ID}]'
+ tags:
+ -
+ tag: component
+ value: system
+ trigger_prototypes:
+ -
+ uuid: 8f57d13f278b459299c565846b4091f5
+ expression: 'last(/Proxmox VE by HTTP/proxmox.qemu.vmstatus[{#QEMU.ID}])<>"running"'
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Not running'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: 'VM state is not "running".'
+ tags:
+ -
+ tag: scope
+ value: notice
+ trigger_prototypes:
+ -
+ uuid: 5305bf2b71aa4b74917379c6e1b3c065
+ expression: 'min(/Proxmox VE by HTTP/proxmox.qemu.mem[{#QEMU.ID}],5m) / last(/Proxmox VE by HTTP/proxmox.qemu.maxmem[{#QEMU.ID}]) * 100 >{$PVE.VM.MEMORY.PUSE.MAX.WARN:"{#QEMU.ID}"}'
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high memory usage'
+ event_name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})] high memory usage (over {$PVE.VM.MEMORY.PUSE.MAX.WARN:"{#QEMU.ID}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Memory usage.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: 602ae1d9d65149ada7aa56cc2d7d9309
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: CPU usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.cpu[{#QEMU.ID}]'
+ -
+ uuid: 391421ce25c74c14abe35723965f3357
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Disk usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.diskwrite[{#QEMU.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.diskread[{#QEMU.ID}]'
+ -
+ uuid: 8522e98f30104f67bfdd1aff8b94d280
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Memory usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.mem[{#QEMU.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.maxmem[{#QEMU.ID}]'
+ -
+ uuid: 391421ce25c74c14abe35723965f3357
+ name: 'Proxmox: VM [{#NODE.NAME}/{#QEMU.NAME} ({#QEMU.ID})]: Network usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.netin[{#QEMU.ID}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.qemu.netout[{#QEMU.ID}]'
+ master_item:
+ key: proxmox.cluster.resources
+ lld_macro_paths:
+ -
+ lld_macro: '{#RESOURCE.TYPE}'
+ path: $.type
+ -
+ lld_macro: '{#NODE.NAME}'
+ path: $.node
+ -
+ lld_macro: '{#QEMU.NAME}'
+ path: $.name
+ -
+ lld_macro: '{#QEMU.ID}'
+ path: $.id
+ -
+ uuid: 61faca6204854bc4af8dc6c5c63ddcd1
+ name: 'Storage discovery'
+ type: DEPENDENT
+ key: proxmox.storage.discovery
+ delay: '0'
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#RESOURCE.TYPE}'
+ value: ^storage$
+ formulaid: A
+ item_prototypes:
+ -
+ uuid: c803813b43f24390b7e0d79fda824a54
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Content'
+ type: DEPENDENT
+ key: 'proxmox.node.content[{#NODE.NAME},{#STORAGE.NAME}]'
+ delay: '0'
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: 'Allowed storage content types.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].content.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 12h
+ master_item:
+ key: proxmox.cluster.resources
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#STORAGE.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 0edb3506231648c9820103a337486d63
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Used'
+ type: DEPENDENT
+ key: 'proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}]'
+ delay: '0'
+ history: 7d
+ units: B
+ description: 'Used disk space in bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].disk.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: proxmox.cluster.resources
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#STORAGE.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: ced02242ff46454f9c49f3d44bf0de9a
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Size'
+ type: DEPENDENT
+ key: 'proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]'
+ delay: '0'
+ history: 7d
+ units: B
+ description: 'Storage size in bytes.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].maxdisk.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 10m
+ master_item:
+ key: proxmox.cluster.resources
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#STORAGE.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ -
+ uuid: 4360858342254aecba7a77eb315cc2bb
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Type'
+ type: DEPENDENT
+ key: 'proxmox.node.plugintype[{#NODE.NAME},{#STORAGE.NAME}]'
+ delay: '0'
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: 'More specific type, if available.'
+ preprocessing:
+ -
+ type: JSONPATH
+ parameters:
+ - '$.data[?(@.id == "storage/{#NODE.NAME}/{#STORAGE.NAME}")].plugintype.first()'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 12h
+ master_item:
+ key: proxmox.cluster.resources
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: name
+ value: '{#STORAGE.NAME}'
+ -
+ tag: node
+ value: '{#NODE.NAME}'
+ trigger_prototypes:
+ -
+ uuid: 404d9a8a6fa54d8c880006c9ec32f55a
+ expression: 'min(/Proxmox VE by HTTP/proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}],5m) / last(/Proxmox VE by HTTP/proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]) * 100 >{$PVE.STORAGE.PUSE.MAX.WARN:"{#NODE.NAME}/{#STORAGE.NAME}"}'
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}] high filesystem space usage'
+ event_name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}] high filesystem space usage (over {$PVE.STORAGE.PUSE.MAX.WARN:"{#NODE.NAME}/{#STORAGE.NAME}"}% use)'
+ opdata: 'Current use: {ITEM.LASTVALUE1} of {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Root filesystem space usage.'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ graph_prototypes:
+ -
+ uuid: 726dbf7dd13b40c8b240cb58f753a9bf
+ name: 'Proxmox: Storage [{#NODE.NAME}/{#STORAGE.NAME}]: Usage'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.disk[{#NODE.NAME},{#STORAGE.NAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'Proxmox VE by HTTP'
+ key: 'proxmox.node.maxdisk[{#NODE.NAME},{#STORAGE.NAME}]'
+ master_item:
+ key: proxmox.cluster.resources
+ lld_macro_paths:
+ -
+ lld_macro: '{#RESOURCE.TYPE}'
+ path: $.type
+ -
+ lld_macro: '{#NODE.NAME}'
+ path: $.node
+ -
+ lld_macro: '{#STORAGE.NAME}'
+ path: $.storage
+ tags:
+ -
+ tag: class
+ value: software
+ -
+ tag: target
+ value: proxmox
+ macros:
+ -
+ macro: '{$PVE.CPU.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used CPU in percentage.'
+ -
+ macro: '{$PVE.LXC.CPU.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used CPU in percentage.'
+ -
+ macro: '{$PVE.LXC.MEMORY.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used memory in percentage.'
+ -
+ macro: '{$PVE.MEMORY.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used memory in percentage.'
+ -
+ macro: '{$PVE.ROOT.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used root space in percentage.'
+ -
+ macro: '{$PVE.STORAGE.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used storage space in percentage.'
+ -
+ macro: '{$PVE.SWAP.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used swap space in percentage.'
+ -
+ macro: '{$PVE.TOKEN.ID}'
+ value: USER@REALM!TOKENID
+ description: 'API tokens allow stateless access to most parts of the REST API by another system, software or API client.'
+ -
+ macro: '{$PVE.TOKEN.SECRET}'
+ value: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ description: 'Secret key.'
+ -
+ macro: '{$PVE.URL.PORT}'
+ value: '8006'
+ description: 'The API uses the HTTPS protocol and the server listens to port 8006 by default.'
+ -
+ macro: '{$PVE.VM.CPU.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used CPU in percentage.'
+ -
+ macro: '{$PVE.VM.MEMORY.PUSE.MAX.WARN}'
+ value: '90'
+ description: 'Maximum used memory in percentage.'
+ valuemaps:
+ -
+ uuid: d4bbd08f3a324a57af97a17f819cb3f3
+ name: 'Cluster quorate'
+ mappings:
+ -
+ value: '1'
+ newvalue: 'Yes'
+ -
+ value: '0'
+ newvalue: 'No'
+ -
+ uuid: 87034fae192c44dba6c8bb568cd90bbd
+ name: 'HTTP response status code'
+ mappings:
+ -
+ value: '100'
+ newvalue: Continue
+ -
+ value: '101'
+ newvalue: 'Switching Protocols'
+ -
+ value: '102'
+ newvalue: Processing
+ -
+ value: '200'
+ newvalue: OK
+ -
+ value: '201'
+ newvalue: Created
+ -
+ value: '202'
+ newvalue: Accepted
+ -
+ value: '203'
+ newvalue: 'Non-Authoritative Information'
+ -
+ value: '204'
+ newvalue: 'No Content'
+ -
+ value: '205'
+ newvalue: 'Reset Content'
+ -
+ value: '206'
+ newvalue: 'Partial Content'
+ -
+ value: '207'
+ newvalue: Multi-Status
+ -
+ value: '208'
+ newvalue: 'Already Reported'
+ -
+ value: '226'
+ newvalue: 'IM Used'
+ -
+ value: '300'
+ newvalue: 'Multiple Choices'
+ -
+ value: '301'
+ newvalue: 'Moved Permanently'
+ -
+ value: '302'
+ newvalue: Found
+ -
+ value: '303'
+ newvalue: 'See Other'
+ -
+ value: '304'
+ newvalue: 'Not Modified'
+ -
+ value: '305'
+ newvalue: 'Use Proxy'
+ -
+ value: '306'
+ newvalue: 'Switch Proxy'
+ -
+ value: '307'
+ newvalue: 'Temporary Redirect'
+ -
+ value: '308'
+ newvalue: 'Permanent Redirect/Resume Incomplete'
+ -
+ value: '400'
+ newvalue: 'Bad Request'
+ -
+ value: '401'
+ newvalue: Unauthorized
+ -
+ value: '402'
+ newvalue: 'Payment Required'
+ -
+ value: '403'
+ newvalue: Forbidden
+ -
+ value: '404'
+ newvalue: 'Not Found'
+ -
+ value: '405'
+ newvalue: 'Method Not Allowed'
+ -
+ value: '406'
+ newvalue: 'Not Acceptable'
+ -
+ value: '407'
+ newvalue: 'Proxy Authentication Required'
+ -
+ value: '408'
+ newvalue: 'Request Timeout'
+ -
+ value: '409'
+ newvalue: Conflict
+ -
+ value: '410'
+ newvalue: Gone
+ -
+ value: '411'
+ newvalue: 'Length Required'
+ -
+ value: '412'
+ newvalue: 'Precondition Failed'
+ -
+ value: '413'
+ newvalue: 'Payload Too Large'
+ -
+ value: '414'
+ newvalue: 'Request-URI Too Long'
+ -
+ value: '415'
+ newvalue: 'Unsupported Media Type'
+ -
+ value: '416'
+ newvalue: 'Requested Range Not Satisfiable'
+ -
+ value: '417'
+ newvalue: 'Expectation Failed'
+ -
+ value: '418'
+ newvalue: 'I''m a Teapot'
+ -
+ value: '419'
+ newvalue: 'Authentication Timeout'
+ -
+ value: '420'
+ newvalue: 'Method Failure/Enhance Your Calm'
+ -
+ value: '421'
+ newvalue: 'Misdirected Request'
+ -
+ value: '422'
+ newvalue: 'Unprocessable Entity'
+ -
+ value: '423'
+ newvalue: Locked
+ -
+ value: '424'
+ newvalue: 'Failed Dependency'
+ -
+ value: '426'
+ newvalue: 'Upgrade Required'
+ -
+ value: '428'
+ newvalue: 'Precondition Required'
+ -
+ value: '429'
+ newvalue: 'Too Many Requests'
+ -
+ value: '431'
+ newvalue: 'Request Header Fields Too Large'
+ -
+ value: '440'
+ newvalue: 'Login Timeout'
+ -
+ value: '444'
+ newvalue: 'No Response'
+ -
+ value: '449'
+ newvalue: 'Retry With'
+ -
+ value: '450'
+ newvalue: 'Blocked by Windows Parental Controls'
+ -
+ value: '451'
+ newvalue: 'Unavailable for Legal Reasons/Redirect'
+ -
+ value: '494'
+ newvalue: 'Request Header Too Large'
+ -
+ value: '495'
+ newvalue: 'Cert Error'
+ -
+ value: '496'
+ newvalue: 'No Cert'
+ -
+ value: '497'
+ newvalue: 'HTTP to HTTPS'
+ -
+ value: '498'
+ newvalue: 'Token Expired/Invalid'
+ -
+ value: '499'
+ newvalue: 'Client Closed Request/Token Required'
+ -
+ value: '500'
+ newvalue: 'Internal Server Error'
+ -
+ value: '501'
+ newvalue: 'Not Implemented'
+ -
+ value: '502'
+ newvalue: 'Bad Gateway'
+ -
+ value: '503'
+ newvalue: 'Service Unavailable'
+ -
+ value: '504'
+ newvalue: 'Gateway Timeout'
+ -
+ value: '505'
+ newvalue: 'HTTP Version Not Supported'
+ -
+ value: '506'
+ newvalue: 'Variant Also Negotiates'
+ -
+ value: '507'
+ newvalue: 'Insufficient Storage'
+ -
+ value: '508'
+ newvalue: 'Loop Detected'
+ -
+ value: '509'
+ newvalue: 'Bandwidth Limit Exceeded'
+ -
+ value: '510'
+ newvalue: 'Not Extended'
+ -
+ value: '511'
+ newvalue: 'Network Authentication Required'
+ -
+ value: '520'
+ newvalue: 'Unknown Error'
+ -
+ value: '598'
+ newvalue: 'Network Read Timeout Error'
+ -
+ value: '599'
+ newvalue: 'Network Connect Timeout Error'
+ -
+ uuid: 99c0bc65efb34d298586320bdcf14209
+ name: 'Node online'
+ mappings:
+ -
+ value: '1'
+ newvalue: Online
+ -
+ value: '0'
+ newvalue: Offline
diff --git a/templates/app/rabbitmq_agent/README.md b/templates/app/rabbitmq_agent/README.md
index b2b9b66fb29..021dbd8d860 100644
--- a/templates/app/rabbitmq_agent/README.md
+++ b/templates/app/rabbitmq_agent/README.md
@@ -13,7 +13,7 @@ Template `RabbitMQ Cluster` — collects metrics by polling [RabbitMQ management
This template was tested on:
-- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.8.5, 3.8.12
+- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.7.7, 3.8.5, 3.8.12
## Setup
@@ -146,7 +146,7 @@ It also uses Zabbix agent to collect `RabbitMQ` Linux process stats like CPU usa
This template was tested on:
-- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.8.5, 3.8.12
+- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.7.7, 3.8.5, 3.8.12
## Setup
diff --git a/templates/app/rabbitmq_http/README.md b/templates/app/rabbitmq_http/README.md
index 5020c52b1b0..a26fcf7e443 100644
--- a/templates/app/rabbitmq_http/README.md
+++ b/templates/app/rabbitmq_http/README.md
@@ -13,7 +13,7 @@ Template `RabbitMQ Cluster` — collects metrics by polling [RabbitMQ management
This template was tested on:
-- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.8.5, 3.8.12
+- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.7.7, 3.8.5, 3.8.12
## Setup
@@ -136,7 +136,7 @@ Template `RabbitMQ Node` — (Zabbix version >= 4.2) collects metrics by polling
This template was tested on:
-- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.8.5, 3.8.12
+- RabbitMQ, version 3.5.7, 3.7.17, 3.7.18, 3.7.7, 3.8.5, 3.8.12
## Setup
diff --git a/templates/app/truenas_snmp/README.md b/templates/app/truenas_snmp/README.md
new file mode 100644
index 00000000000..95af339723d
--- /dev/null
+++ b/templates/app/truenas_snmp/README.md
@@ -0,0 +1,199 @@
+
+# TrueNAS SNMP
+
+## Overview
+
+For Zabbix version: 6.0 and higher
+Template for monitoring TrueNAS by SNMP
+
+This template was tested on:
+
+- TrueNAS Core, version 12.0-U8
+
+## Setup
+
+> See [Zabbix template operation](https://www.zabbix.com/documentation/6.0/manual/config/templates_out_of_the_box/network_devices) for basic instructions.
+
+1. Import template into Zabbix
+2. Enable SNMP daemon at Services in TrueNAS web interface https://www.truenas.com/docs/core/services/snmp
+3. Link template to the host
+
+
+## Zabbix configuration
+
+No specific Zabbix configuration is required.
+
+### Macros used
+
+|Name|Description|Default|
+|----|-----------|-------|
+|{$CPU.UTIL.CRIT} |<p>Threshold of CPU utilization for warning trigger in %.</p> |`90` |
+|{$DATASET.FREE.MIN.CRIT} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`5G` |
+|{$DATASET.FREE.MIN.WARN} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`5G` |
+|{$DATASET.NAME.MATCHES} |<p>This macro is used in datasets discovery. Can be overridden on the host or linked template level</p> |`.+` |
+|{$DATASET.NAME.NOT_MATCHES} |<p>This macro is used in datasets discovery. Can be overridden on the host or linked template level</p> |`^(boot|.+\.system(.+)?$)` |
+|{$DATASET.PUSED.MAX.CRIT} |<p>Threshold of used dataset space for average severity trigger in %.</p> |`90` |
+|{$DATASET.PUSED.MAX.WARN} |<p>Threshold of used dataset space for warning trigger in %.</p> |`80` |
+|{$ICMP_LOSS_WARN} |<p>Threshold of ICMP packets loss for warning trigger in %.</p> |`20` |
+|{$ICMP_RESPONSE_TIME_WARN} |<p>Threshold of average ICMP response time for warning trigger in seconds.</p> |`0.15` |
+|{$IF.ERRORS.WARN} |<p>Threshold of error packets rate for warning trigger. Can be used with interface name as context.</p> |`2` |
+|{$IF.UTIL.MAX} |<p>Threshold of interface bandwidth utilization for warning trigger in %. Can be used with interface name as context.</p> |`90` |
+|{$IFCONTROL} |<p>Macro for operational state of the interface for link down trigger. Can be used with interface name as context.</p> |`1` |
+|{$LOAD_AVG_PER_CPU.MAX.WARN} |<p>Load per CPU considered sustainable. Tune if needed.</p> |`1.5` |
+|{$MEMORY.AVAILABLE.MIN} |<p>Threshold of available memory for trigger in bytes.</p> |`20M` |
+|{$MEMORY.UTIL.MAX} |<p>Threshold of memory utilization for trigger in %</p> |`90` |
+|{$NET.IF.IFADMINSTATUS.MATCHES} |<p>This macro is used in filters of network interfaces discovery rule.</p> |`^.*` |
+|{$NET.IF.IFADMINSTATUS.NOT_MATCHES} |<p>Ignore down(2) administrative status</p> |`^2$` |
+|{$NET.IF.IFALIAS.MATCHES} |<p>This macro is used in filters of network interfaces discovery rule.</p> |`.*` |
+|{$NET.IF.IFALIAS.NOT_MATCHES} |<p>This macro is used in filters of network interfaces discovery rule.</p> |`CHANGE_IF_NEEDED` |
+|{$NET.IF.IFDESCR.MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`.*` |
+|{$NET.IF.IFDESCR.NOT_MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`CHANGE_IF_NEEDED` |
+|{$NET.IF.IFNAME.MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`^em[0-9]+$` |
+|{$NET.IF.IFNAME.NOT_MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`^$` |
+|{$NET.IF.IFOPERSTATUS.MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`^.*$` |
+|{$NET.IF.IFOPERSTATUS.NOT_MATCHES} |<p>Ignore notPresent(6)</p> |`^6$` |
+|{$NET.IF.IFTYPE.MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`.*` |
+|{$NET.IF.IFTYPE.NOT_MATCHES} |<p>This macro used in filters of network interfaces discovery rule.</p> |`CHANGE_IF_NEEDED` |
+|{$SNMP.TIMEOUT} |<p>The time interval for SNMP availability trigger.</p> |`5m` |
+|{$SWAP.PFREE.MIN.WARN} |<p>Threshold of free swap space for warning trigger in %.</p> |`50` |
+|{$TEMPERATURE.MAX.CRIT} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`65` |
+|{$TEMPERATURE.MAX.WARN} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`50` |
+|{$VFS.DEV.DEVNAME.MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`.+` |
+|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|cd[0-9]*|pass[0-9]*|zram[0-9]*)` |
+|{$ZPOOL.FREE.MIN.CRIT} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`5G` |
+|{$ZPOOL.FREE.MIN.WARN} |<p>This macro is used for trigger expression. It can be overridden on the host or linked on the template level.</p> |`5G` |
+|{$ZPOOL.PUSED.MAX.CRIT} |<p>Threshold of used pool space for average severity trigger in %.</p> |`90` |
+|{$ZPOOL.PUSED.MAX.WARN} |<p>Threshold of used pool space for warning trigger in %.</p> |`80` |
+
+## Template links
+
+There are no template links in this template.
+
+## Discovery rules
+
+|Name|Description|Type|Key and additional info|
+|----|-----------|----|----|
+|Block devices discovery |<p>Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable).</p> |SNMP |vfs.dev.discovery<p>**Filter**:</p>AND <p>- {#DEVNAME} MATCHES_REGEX `{$VFS.DEV.DEVNAME.MATCHES}`</p><p>- {#DEVNAME} NOT_MATCHES_REGEX `{$VFS.DEV.DEVNAME.NOT_MATCHES}`</p> |
+|CPU discovery |<p>This discovery will create set of per core CPU metrics from UCD-SNMP-MIB, using {#CPU.COUNT} in preprocessing. That's the only reason why LLD is used.</p> |DEPENDENT |cpu.discovery<p>**Preprocessing**:</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p> |
+|Disks temperature discovery |<p>Disks temperature discovery from FREENAS-MIB.</p> |SNMP |truenas.disk.temp.discovery<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|Network interfaces discovery |<p>Discovering interfaces from IF-MIB.</p> |SNMP |net.if.discovery<p>**Filter**:</p>AND <p>- {#IFADMINSTATUS} MATCHES_REGEX `{$NET.IF.IFADMINSTATUS.MATCHES}`</p><p>- {#IFADMINSTATUS} NOT_MATCHES_REGEX `{$NET.IF.IFADMINSTATUS.NOT_MATCHES}`</p><p>- {#IFOPERSTATUS} MATCHES_REGEX `{$NET.IF.IFOPERSTATUS.MATCHES}`</p><p>- {#IFOPERSTATUS} NOT_MATCHES_REGEX `{$NET.IF.IFOPERSTATUS.NOT_MATCHES}`</p><p>- {#IFNAME} MATCHES_REGEX `{$NET.IF.IFNAME.MATCHES}`</p><p>- {#IFNAME} NOT_MATCHES_REGEX `{$NET.IF.IFNAME.NOT_MATCHES}`</p><p>- {#IFDESCR} MATCHES_REGEX `{$NET.IF.IFDESCR.MATCHES}`</p><p>- {#IFDESCR} NOT_MATCHES_REGEX `{$NET.IF.IFDESCR.NOT_MATCHES}`</p><p>- {#IFALIAS} MATCHES_REGEX `{$NET.IF.IFALIAS.MATCHES}`</p><p>- {#IFALIAS} NOT_MATCHES_REGEX `{$NET.IF.IFALIAS.NOT_MATCHES}`</p><p>- {#IFTYPE} MATCHES_REGEX `{$NET.IF.IFTYPE.MATCHES}`</p><p>- {#IFTYPE} NOT_MATCHES_REGEX `{$NET.IF.IFTYPE.NOT_MATCHES}`</p> |
+|ZFS datasets discovery |<p>ZFS datasets discovery from FREENAS-MIB.</p> |SNMP |truenas.zfs.dataset.discovery<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p><p>**Filter**:</p>AND <p>- {#DATASET_NAME} MATCHES_REGEX `{$DATASET.NAME.MATCHES}`</p><p>- {#DATASET_NAME} NOT_MATCHES_REGEX `{$DATASET.NAME.NOT_MATCHES}`</p> |
+|ZFS pools discovery |<p>ZFS pools discovery from FREENAS-MIB.</p> |SNMP |truenas.zfs.pools.discovery<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|ZFS volumes discovery |<p>ZFS volumes discovery from FREENAS-MIB.</p> |SNMP |truenas.zfs.zvols.discovery<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+
+## Items collected
+
+|Group|Name|Description|Type|Key and additional info|
+|-----|----|-----------|----|---------------------|
+|CPU |TrueNAS: Interrupts per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of interrupts processed.</p> |SNMP |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|CPU |TrueNAS: Context switches per second |<p>MIB: UCD-SNMP-MIB</p><p>Number of context switches.</p> |SNMP |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|CPU |TrueNAS: Load average (1m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 1 minute load averages.</p> |SNMP |system.cpu.load.avg1 |
+|CPU |TrueNAS: Load average (5m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 5 minutes load averages.</p> |SNMP |system.cpu.load.avg5 |
+|CPU |TrueNAS: Load average (15m avg) |<p>MIB: UCD-SNMP-MIB</p><p>The 15 minutes load averages.</p> |SNMP |system.cpu.load.avg15 |
+|CPU |TrueNAS: Number of CPUs |<p>MIB: HOST-RESOURCES-MIB</p><p>Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD.</p> |SNMP |system.cpu.num<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//count the number of cores return JSON.parse(value).length; `</p> |
+|CPU |TrueNAS: CPU idle time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent doing nothing.</p> |SNMP |system.cpu.idle[{#SNMPINDEX}] |
+|CPU |TrueNAS: CPU system time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running the kernel and its processes.</p> |SNMP |system.cpu.system[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |TrueNAS: CPU user time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that are not niced.</p> |SNMP |system.cpu.user[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |TrueNAS: CPU nice time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that have been niced.</p> |SNMP |system.cpu.nice[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |TrueNAS: CPU iowait time |<p>MIB: UCD-SNMP-MIB</p><p>Amount of time the CPU has been waiting for I/O to complete.</p> |SNMP |system.cpu.iowait[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |TrueNAS: CPU interrupt time |<p>MIB: UCD-SNMP-MIB</p><p>The amount of time the CPU has been servicing hardware interrupts.</p> |SNMP |system.cpu.interrupt[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |TrueNAS: CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
+|General |TrueNAS: System contact details |<p>MIB: SNMPv2-MIB</p><p>The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.</p> |SNMP |system.contact<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|General |TrueNAS: System description |<p>MIB: SNMPv2-MIB</p><p>System description of the host.</p> |SNMP |system.descr<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|General |TrueNAS: System location |<p>MIB: SNMPv2-MIB</p><p>The physical location of this node. If the location is unknown, the value is the zero-length string.</p> |SNMP |system.location<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|General |TrueNAS: System name |<p>MIB: SNMPv2-MIB</p><p>System host name.</p> |SNMP |system.name<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|General |TrueNAS: System object ID |<p>MIB: SNMPv2-MIB</p><p>The vendor authoritative identification of the network management subsystem contained in the entity. This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining what kind of box is being managed.</p> |SNMP |system.objectid<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|Memory |TrueNAS: Free memory |<p>MIB: UCD-SNMP-MIB</p><p>The amount of real/physical memory currently unused or available.</p> |SNMP |vm.memory.free<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of real or virtual memory currently allocated for use as memory buffers.</p> |SNMP |vm.memory.buffers<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of real or virtual memory currently allocated for use as cached memory.</p> |SNMP |vm.memory.cached<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes.</p> |SNMP |vm.memory.total<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Available memory |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.available<p>**Expression**:</p>`last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)` |
+|Memory |TrueNAS: Memory utilization |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`(last(//vm.memory.total)-(last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)))/last(//vm.memory.total)*100` |
+|Memory |TrueNAS: Total swap space |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of swap space configured for this host.</p> |SNMP |system.swap.total<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Free swap space |<p>MIB: UCD-SNMP-MIB</p><p>The amount of swap space currently unused or available.</p> |SNMP |system.swap.free<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |TrueNAS: Free swap space in % |<p>The free space of swap volume/file in percent.</p> |CALCULATED |system.swap.pfree<p>**Expression**:</p>`last(//system.swap.free)/last(//system.swap.total)*100` |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Inbound packets discarded |<p>MIB: IF-MIB</p><p>The number of inbound packets which were chosen to be discarded</p><p>even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.</p><p>One possible reason for discarding such a packet could be to free up buffer space.</p><p>Discontinuities in the value of this counter can occur at re-initialization of the management system,</p><p>and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in.discards[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Inbound packets with errors |<p>MIB: IF-MIB</p><p>For packet-oriented interfaces, the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in.errors[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Bits received |<p>MIB: IF-MIB</p><p>The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Outbound packets discarded |<p>MIB: IF-MIB</p><p>The number of outbound packets which were chosen to be discarded</p><p>even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.</p><p>One possible reason for discarding such a packet could be to free up buffer space.</p><p>Discontinuities in the value of this counter can occur at re-initialization of the management system,</p><p>and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.out.discards[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Outbound packets with errors |<p>MIB: IF-MIB</p><p>For packet-oriented interfaces, the number of outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of outbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.out.errors[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Bits sent |<p>MIB: IF-MIB</p><p>The total number of octets transmitted out of the interface, including framing characters. This object is a 64-bit version of ifOutOctets.Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.out[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND: ``</p><p>- MULTIPLIER: `8`</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Speed |<p>MIB: IF-MIB</p><p>An estimate of the interface's current bandwidth in units of 1,000,000 bits per second. If this object reports a value of `n' then the speed of the interface is somewhere in the range of `n-500,000' to`n+499,999'. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. For a sub-layer which has no concept of bandwidth, this object should be zero.</p> |SNMP |net.if.speed[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1000000`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Operational status |<p>MIB: IF-MIB</p><p>The current operational state of the interface.</p><p>- The testing(3) state indicates that no operational packet scan be passed</p><p>- If ifAdminStatus is down(2) then ifOperStatus should be down(2)</p><p>- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic</p><p>- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)</p><p>- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state</p><p>- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.</p> |SNMP |net.if.status[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|Network interfaces |TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Interface type |<p>MIB: IF-MIB</p><p>The type of interface.</p><p>Additional values for ifType are assigned by the Internet Assigned Numbers Authority (IANA),</p><p>through updating the syntax of the IANAifType textual convention.</p> |SNMP |net.if.type[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
+|Status |TrueNAS: ICMP ping |<p>Host accessibility by ICMP.</p><p>0 - ICMP ping fails.</p><p>1 - ICMP ping successful.</p> |SIMPLE |icmpping |
+|Status |TrueNAS: ICMP loss |<p>Percentage of lost packets.</p> |SIMPLE |icmppingloss |
+|Status |TrueNAS: ICMP response time |<p>ICMP ping response time (in seconds).</p> |SIMPLE |icmppingsec |
+|Status |TrueNAS: Uptime |<p>MIB: SNMPv2-MIB</p><p>System uptime in 'N days, hh:mm:ss' format.</p> |SNMP |system.uptime<p>**Preprocessing**:</p><p>- MULTIPLIER: `0.01`</p> |
+|Status |TrueNAS: SNMP agent availability |<p>Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.</p><p>Possible value:</p><p>0 - not available</p><p>1 - available</p><p>2 - unknown</p> |INTERNAL |zabbix[host,snmp,available] |
+|Storage |TrueNAS: [{#DEVNAME}]: Disk read rate |<p>MIB: UCD-DISKIO-MIB</p><p>The number of read accesses from this device since boot.</p> |SNMP |vfs.dev.read.rate[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Storage |TrueNAS: [{#DEVNAME}]: Disk write rate |<p>MIB: UCD-DISKIO-MIB</p><p>The number of write accesses from this device since boot.</p> |SNMP |vfs.dev.write.rate[{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|Storage |TrueNAS: [{#DEVNAME}]: Disk utilization |<p>MIB: UCD-DISKIO-MIB</p><p>The 1 minute average load of disk (%).</p> |SNMP |vfs.dev.util[{#SNMPINDEX}] |
+|TrueNAS |TrueNAS: ARC size |<p>MIB: FREENAS-MIB</p><p>ARC size in bytes.</p> |SNMP |truenas.zfs.arc.size<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: ARC metadata size |<p>MIB: FREENAS-MIB</p><p>ARC metadata size used in bytes.</p> |SNMP |truenas.zfs.arc.meta<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|TrueNAS |TrueNAS: ARC data size |<p>MIB: FREENAS-MIB</p><p>ARC data size used in bytes.</p> |SNMP |truenas.zfs.arc.data<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|TrueNAS |TrueNAS: ARC hits |<p>MIB: FREENAS-MIB</p><p>Total amount of cache hits in the ARC per second.</p> |SNMP |truenas.zfs.arc.hits<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: ARC misses |<p>MIB: FREENAS-MIB</p><p>Total amount of cache misses in the ARC per second.</p> |SNMP |truenas.zfs.arc.misses<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: ARC target size of cache |<p>MIB: FREENAS-MIB</p><p>ARC target size of cache in bytes.</p> |SNMP |truenas.zfs.arc.c<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: ARC target size of MRU |<p>MIB: FREENAS-MIB</p><p>ARC target size of MRU in bytes.</p> |SNMP |truenas.zfs.arc.p<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: ARC cache hit ratio |<p>MIB: FREENAS-MIB</p><p>ARC cache hit ration percentage.</p> |SNMP |truenas.zfs.arc.hit.ratio |
+|TrueNAS |TrueNAS: ARC cache miss ratio |<p>MIB: FREENAS-MIB</p><p>ARC cache miss ration percentage.</p> |SNMP |truenas.zfs.arc.miss.ratio |
+|TrueNAS |TrueNAS: L2ARC hits |<p>MIB: FREENAS-MIB</p><p>Hits to the L2 cache per second.</p> |SNMP |truenas.zfs.l2arc.hits<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: L2ARC misses |<p>MIB: FREENAS-MIB</p><p>Misses to the L2 cache per second.</p> |SNMP |truenas.zfs.l2arc.misses<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: L2ARC read rate |<p>MIB: FREENAS-MIB</p><p>Read rate from L2 cache in bytes per second.</p> |SNMP |truenas.zfs.l2arc.read<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: L2ARC write rate |<p>MIB: FREENAS-MIB</p><p>Write rate from L2 cache in bytes per second.</p> |SNMP |truenas.zfs.l2arc.write<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: L2ARC size |<p>MIB: FREENAS-MIB</p><p>L2ARC size in bytes.</p> |SNMP |truenas.zfs.l2arc.size<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: ZIL operations 1 second |<p>MIB: FREENAS-MIB</p><p>The ops column parsed from the command zilstat 1 1.</p> |SNMP |truenas.zfs.zil.ops1 |
+|TrueNAS |TrueNAS: ZIL operations 5 seconds |<p>MIB: FREENAS-MIB</p><p>The ops column parsed from the command zilstat 5 1.</p> |SNMP |truenas.zfs.zil.ops5 |
+|TrueNAS |TrueNAS: ZIL operations 10 seconds |<p>MIB: FREENAS-MIB</p><p>The ops column parsed from the command zilstat 10 1.</p> |SNMP |truenas.zfs.zil.ops10 |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Total space |<p>MIB: FREENAS-MIB</p><p>The size of the storage pool in bytes.</p> |SNMP |truenas.zpool.size.total[{#POOLNAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#POOL_ALLOC_UNITS}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Used space |<p>MIB: FREENAS-MIB</p><p>The used size of the storage pool in bytes.</p> |SNMP |truenas.zpool.used[{#POOLNAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#POOL_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Available space |<p>MIB: FREENAS-MIB</p><p>The available size of the storage pool in bytes.</p> |SNMP |truenas.zpool.avail[{#POOLNAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#POOL_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Usage in % |<p>The used size of the storage pool in %.</p> |CALCULATED |truenas.zpool.pused[{#POOLNAME}]<p>**Expression**:</p>`last(//truenas.zpool.used[{#POOLNAME}]) * 100 / last(//truenas.zpool.size.total[{#POOLNAME}])` |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Health |<p>MIB: FREENAS-MIB</p><p>The current health of the containing pool, as reported by zpool status.</p> |SNMP |truenas.zpool.health[{#POOLNAME}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Read operations rate |<p>MIB: FREENAS-MIB</p><p>The number of read I/O operations sent to the pool or device, including metadata requests (averaged since system booted).</p> |SNMP |truenas.zpool.read.ops[{#POOLNAME}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Write operations rate |<p>MIB: FREENAS-MIB</p><p>The number of write I/O operations sent to the pool or device (averaged since system booted).</p> |SNMP |truenas.zpool.write.ops[{#POOLNAME}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Read rate |<p>MIB: FREENAS-MIB</p><p>The bandwidth of all read operations (including metadata), expressed as units per second (averaged since system booted).</p> |SNMP |truenas.zpool.read.bytes[{#POOLNAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#POOL_ALLOC_UNITS}`</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: Pool [{#POOLNAME}]: Write rate |<p>MIB: FREENAS-MIB</p><p>The bandwidth of all write operations, expressed as units per second (averaged since system booted).</p> |SNMP |truenas.zpool.write.bytes[{#POOLNAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#POOL_ALLOC_UNITS}`</p><p>- CHANGE_PER_SECOND</p> |
+|TrueNAS |TrueNAS: Dataset [{#DATASET_NAME}]: Total space |<p>MIB: FREENAS-MIB</p><p>The size of the dataset in bytes.</p> |SNMP |truenas.dataset.size.total[{#DATASET_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#DATASET_ALLOC_UNITS}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: Dataset [{#DATASET_NAME}]: Used space |<p>MIB: FREENAS-MIB</p><p>The used size of the dataset in bytes.</p> |SNMP |truenas.dataset.used[{#DATASET_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#DATASET_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: Dataset [{#DATASET_NAME}]: Available space |<p>MIB: FREENAS-MIB</p><p>The available size of the dataset in bytes.</p> |SNMP |truenas.dataset.avail[{#DATASET_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#DATASET_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: Dataset [{#DATASET_NAME}]: Usage in % |<p>The used size of the dataset in %.</p> |CALCULATED |truenas.dataset.pused[{#DATASET_NAME}]<p>**Expression**:</p>`last(//truenas.dataset.used[{#DATASET_NAME}]) * 100 / last(//truenas.dataset.size.total[{#DATASET_NAME}])` |
+|TrueNAS |TrueNAS: ZFS volume [{#ZVOL_NAME}]: Total space |<p>MIB: FREENAS-MIB</p><p>The size of the ZFS volume in bytes.</p> |SNMP |truenas.zvol.size.total[{#ZVOL_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ZVOL_ALLOC_UNITS}`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|TrueNAS |TrueNAS: ZFS volume [{#ZVOL_NAME}]: Used space |<p>MIB: FREENAS-MIB</p><p>The used size of the ZFS volume in bytes.</p> |SNMP |truenas.zvol.used[{#ZVOL_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ZVOL_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: ZFS volume [{#ZVOL_NAME}]: Available space |<p>MIB: FREENAS-MIB</p><p>The available of the ZFS volume in bytes.</p> |SNMP |truenas.zvol.avail[{#ZVOL_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ZVOL_ALLOC_UNITS}`</p> |
+|TrueNAS |TrueNAS: Disk [{#DISK_NAME}]: Temperature |<p>MIB: FREENAS-MIB</p><p>The temperature of this HDD in mC.</p> |SNMP |truenas.disk.temp[{#DISK_NAME}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `0.001`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+
+## Triggers
+
+|Name|Description|Expression|Severity|Dependencies and additional info|
+|----|-----------|----|----|----|
+|TrueNAS: Load average is too high (per CPU load over {$LOAD_AVG_PER_CPU.MAX.WARN} for 5m) |<p>Per CPU load average is too high. Your system may be slow to respond.</p> |`min(/TrueNAS SNMP/system.cpu.load.avg1,5m)/last(/TrueNAS SNMP/system.cpu.num)>{$LOAD_AVG_PER_CPU.MAX.WARN} and last(/TrueNAS SNMP/system.cpu.load.avg5)>0 and last(/TrueNAS SNMP/system.cpu.load.avg15)>0 ` |AVERAGE | |
+|TrueNAS: High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m) |<p>CPU utilization is too high. The system might be slow to respond.</p> |`min(/TrueNAS SNMP/system.cpu.util[{#SNMPINDEX}],5m)>{$CPU.UTIL.CRIT}` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Load average is too high (per CPU load over {$LOAD_AVG_PER_CPU.MAX.WARN} for 5m)</p> |
+|TrueNAS: System name has changed (new name: {ITEM.VALUE}) |<p>System name has changed. Ack to close.</p> |`last(/TrueNAS SNMP/system.name,#1)<>last(/TrueNAS SNMP/system.name,#2) and length(last(/TrueNAS SNMP/system.name))>0` |INFO |<p>Manual close: YES</p> |
+|TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2}) |<p>The system is running out of memory.</p> |`min(/TrueNAS SNMP/vm.memory.available,5m)<{$MEMORY.AVAILABLE.MIN} and last(/TrueNAS SNMP/vm.memory.total)>0` |AVERAGE | |
+|TrueNAS: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m) |<p>The system is running out of free memory.</p> |`min(/TrueNAS SNMP/vm.memory.util,5m)>{$MEMORY.UTIL.MAX}` |AVERAGE |<p>**Depends on**:</p><p>- TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})</p> |
+|TrueNAS: High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free) |<p>This trigger is ignored, if there is no swap configured.</p> |`min(/TrueNAS SNMP/system.swap.pfree,5m)<{$SWAP.PFREE.MIN.WARN} and last(/TrueNAS SNMP/system.swap.total)>0` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)</p><p>- TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High input error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m) |<p>Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.</p> |`min(/TrueNAS SNMP/net.if.in.errors[{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"}`<p>Recovery expression:</p>`max(/TrueNAS SNMP/net.if.in.errors[{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High inbound bandwidth usage ( > {$IF.UTIL.MAX:"{#IFNAME}"}% ) |<p>The network interface utilization is close to its estimated maximum bandwidth.</p> |`(avg(/TrueNAS SNMP/net.if.in[{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])) and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0 `<p>Recovery expression:</p>`avg(/TrueNAS SNMP/net.if.in[{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High output error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m) |<p>Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.</p> |`min(/TrueNAS SNMP/net.if.out.errors[{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"}`<p>Recovery expression:</p>`max(/TrueNAS SNMP/net.if.out.errors[{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High outbound bandwidth usage ( > {$IF.UTIL.MAX:"{#IFNAME}"}% ) |<p>The network interface utilization is close to its estimated maximum bandwidth.</p> |`(avg(/TrueNAS SNMP/net.if.out[{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])) and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0 `<p>Recovery expression:</p>`avg(/TrueNAS SNMP/net.if.out[{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Ethernet has changed to lower speed than it was before |<p>This Ethernet connection has transitioned down from its known maximum speed. This might be a sign of autonegotiation issues. Ack to close.</p> |`change(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])<0 and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0 and ( last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=6 or last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=7 or last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=11 or last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=62 or last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=69 or last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=117 ) and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])<>2) `<p>Recovery expression:</p>`(change(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0 and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}],#2)>0) or (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2) ` |INFO |<p>**Depends on**:</p><p>- TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down</p> |
+|TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down |<p>This trigger expression works as follows:</p><p>1. Can be triggered if operations status is down.</p><p>2. {$IFCONTROL:"{#IFNAME}"}=1 - user can redefine Context macro to value - 0. That marks this interface as not important. No new trigger will be fired if this interface is down.</p> |`{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)` |AVERAGE | |
+|TrueNAS: Unavailable by ICMP ping |<p>Last three attempts returned timeout. Please check device connectivity.</p> |`max(/TrueNAS SNMP/icmpping,#3)=0` |HIGH | |
+|TrueNAS: High ICMP ping loss |<p>ICMP packets loss detected.</p> |`min(/TrueNAS SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/TrueNAS SNMP/icmppingloss,5m)<100` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Unavailable by ICMP ping</p> |
+|TrueNAS: High ICMP ping response time |<p>Average ICMP response time is too big.</p> |`avg(/TrueNAS SNMP/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Unavailable by ICMP ping</p> |
+|TrueNAS: has been restarted (uptime < 10m) |<p>Uptime is less than 10 minutes.</p> |`last(/TrueNAS SNMP/system.uptime)<10m` |INFO |<p>Manual close: YES</p> |
+|TrueNAS: No SNMP data collection |<p>SNMP is not available for polling. Please check device connectivity and SNMP settings.</p> |`max(/TrueNAS SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Unavailable by ICMP ping</p> |
+|TrueNAS: Pool [{#POOLNAME}]: Very high space usage (more than {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}% used) |<p>Two conditions should match: First, space utilization should be above {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}%.</p><p>Second condition: The pool free space is less than {$ZPOOL.FREE.MIN.CRIT:"{#POOLNAME}"}.</p> |`min(/TrueNAS SNMP/truenas.zpool.pused[{#POOLNAME}],5m) > {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"} and last(/TrueNAS SNMP/truenas.zpool.avail[{#POOLNAME}]) < {$ZPOOL.FREE.MIN.CRIT:"{#POOLNAME}"}` |AVERAGE | |
+|TrueNAS: Pool [{#POOLNAME}]: High space usage (more than {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"}% used) |<p>Two conditions should match: First, space utilization should be above {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"}%.</p><p>Second condition: The pool free space is less than {$ZPOOL.FREE.MIN.WARN:"{#POOLNAME}"}.</p> |`min(/TrueNAS SNMP/truenas.zpool.pused[{#POOLNAME}],5m) > {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"} and last(/TrueNAS SNMP/truenas.zpool.avail[{#POOLNAME}]) < {$ZPOOL.FREE.MIN.WARN:"{#POOLNAME}"}` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Pool [{#POOLNAME}]: Very high space usage (more than {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}% used)</p> |
+|TrueNAS: Pool [{#POOLNAME}]: Status is not online |<p>Please check pool status.</p> |`last(/TrueNAS SNMP/truenas.zpool.health[{#POOLNAME}]) <> 0` |AVERAGE | |
+|TrueNAS: Dataset [{#DATASET_NAME}]: Very high space usage (more than {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}% used) |<p>Two conditions should match: First, space utilization should be above {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}%.</p><p>Second condition: The dataset free space is less than {$DATASET.FREE.MIN.CRIT:"{#POOLNAME}"}.</p> |`min(/TrueNAS SNMP/truenas.dataset.pused[{#DATASET_NAME}],5m) > {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"} and last(/TrueNAS SNMP/truenas.dataset.avail[{#DATASET_NAME}]) < {$DATASET.FREE.MIN.CRIT:"{#POOLNAME}"}` |AVERAGE | |
+|TrueNAS: Dataset [{#DATASET_NAME}]: High space usage (more than {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"}% used) |<p>Two conditions should match: First, space utilization should be above {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"}%.</p><p>Second condition: The dataset free space is less than {$DATASET.FREE.MIN.WARN:"{#POOLNAME}"}.</p> |`min(/TrueNAS SNMP/truenas.dataset.pused[{#DATASET_NAME}],5m) > {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"} and last(/TrueNAS SNMP/truenas.dataset.avail[{#DATASET_NAME}]) < {$DATASET.FREE.MIN.WARN:"{#POOLNAME}"}` |WARNING |<p>**Depends on**:</p><p>- TrueNAS: Dataset [{#DATASET_NAME}]: Very high space usage (more than {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}% used)</p> |
+|TrueNAS: Disk [{#DISK_NAME}]: Average disk temperature is too high (over {$TEMPERATURE.MAX.CRIT:"{#DISK_NAME}"}C for 5m) |<p>Disk temperature is high.</p> |`avg(/TrueNAS SNMP/truenas.disk.temp[{#DISK_NAME}],5m) > {$TEMPERATURE.MAX.CRIT:"{#DISK_NAME}"}` |AVERAGE | |
+|TrueNAS: Disk [{#DISK_NAME}]: Average disk temperature is too high (over {$TEMPERATURE.MAX.WARN:"{#DISK_NAME}"}C for 5m) |<p>Disk temperature is high.</p> |`avg(/TrueNAS SNMP/truenas.disk.temp[{#DISK_NAME}],5m) > {$TEMPERATURE.MAX.WARN:"{#DISK_NAME}"}` |WARNING | |
+
+## Feedback
+
+Please report any issues with the template at https://support.zabbix.com
+
diff --git a/templates/app/truenas_snmp/template_app_truenas_snmp.yaml b/templates/app/truenas_snmp/template_app_truenas_snmp.yaml
new file mode 100644
index 00000000000..75647e6c324
--- /dev/null
+++ b/templates/app/truenas_snmp/template_app_truenas_snmp.yaml
@@ -0,0 +1,3789 @@
+zabbix_export:
+ version: '6.0'
+ date: '2022-04-04T11:00:59Z'
+ groups:
+ -
+ uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
+ name: Templates/Applications
+ templates:
+ -
+ uuid: 28e31ef9402d4c1ba2fbc730a288d2d8
+ template: 'TrueNAS SNMP'
+ name: 'TrueNAS SNMP'
+ description: |
+ Template for monitoring TrueNAS by SNMP
+ Setup:
+ 1. Import template into Zabbix
+ 2. Enable SNMP daemon at Services in TrueNAS web interface https://www.truenas.com/docs/core/services/snmp
+ 3. Link template to the host
+
+
+ MIBs used:
+ HOST-RESOURCES-MIB
+ SNMPv2-MIB
+ UCD-DISKIO-MIB
+ UCD-SNMP-MIB
+ FREENAS-MIB
+
+ Template tooling version used: 0.41
+ groups:
+ -
+ name: Templates/Applications
+ items:
+ -
+ uuid: c6e16d985fac4070a076c41be78bc29e
+ name: 'TrueNAS: ICMP ping'
+ type: SIMPLE
+ key: icmpping
+ history: 7d
+ description: |
+ Host accessibility by ICMP.
+ 0 - ICMP ping fails.
+ 1 - ICMP ping successful.
+ valuemap:
+ name: 'Service state'
+ tags:
+ -
+ tag: component
+ value: health
+ -
+ tag: component
+ value: network
+ triggers:
+ -
+ uuid: 91468c2218da45b3b1de62575471094e
+ expression: 'max(/TrueNAS SNMP/icmpping,#3)=0'
+ name: 'TrueNAS: Unavailable by ICMP ping'
+ priority: HIGH
+ description: 'Last three attempts returned timeout. Please check device connectivity.'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: 9b420a4b29c6455ab2540a8601c70cb5
+ name: 'TrueNAS: ICMP loss'
+ type: SIMPLE
+ key: icmppingloss
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'Percentage of lost packets.'
+ tags:
+ -
+ tag: component
+ value: health
+ -
+ tag: component
+ value: network
+ triggers:
+ -
+ uuid: e6a39a1bc5d54f49aacc811f6942ef2b
+ expression: 'min(/TrueNAS SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/TrueNAS SNMP/icmppingloss,5m)<100'
+ name: 'TrueNAS: High ICMP ping loss'
+ opdata: 'Loss: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'ICMP packets loss detected.'
+ dependencies:
+ -
+ name: 'TrueNAS: Unavailable by ICMP ping'
+ expression: 'max(/TrueNAS SNMP/icmpping,#3)=0'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 3788e73db5d64245b9ee3819fdfcf4d5
+ name: 'TrueNAS: ICMP response time'
+ type: SIMPLE
+ key: icmppingsec
+ history: 7d
+ value_type: FLOAT
+ units: s
+ description: 'ICMP ping response time (in seconds).'
+ tags:
+ -
+ tag: component
+ value: health
+ -
+ tag: component
+ value: network
+ triggers:
+ -
+ uuid: 4931e6a368b841eeb846b8bc59fea513
+ expression: 'avg(/TrueNAS SNMP/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}'
+ name: 'TrueNAS: High ICMP ping response time'
+ opdata: 'Value: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'Average ICMP response time is too big.'
+ dependencies:
+ -
+ name: 'TrueNAS: Unavailable by ICMP ping'
+ expression: 'max(/TrueNAS SNMP/icmpping,#3)=0'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 0ee6f31c4e49445083a7db5cf9508b17
+ name: 'TrueNAS: System contact details'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.1.4.0
+ key: system.contact
+ delay: 15m
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: |
+ MIB: SNMPv2-MIB
+ The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.
+ inventory_link: CONTACT
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ uuid: b41b8db2212848db83a6a0d9369fecdd
+ name: 'TrueNAS: Interrupts per second'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.59.0
+ key: system.cpu.intr
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: UCD-SNMP-MIB
+ Number of interrupts processed.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 4283476959894b78956973be95d33e72
+ name: 'TrueNAS: Load average (1m avg)'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.10.1.3["index","1.3.6.1.4.1.2021.10.1.2", "Load-1"]'
+ key: system.cpu.load.avg1
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: UCD-SNMP-MIB
+ The 1 minute load averages.
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: a7885b68d6644a2ab5875e742a7bc06f
+ name: 'TrueNAS: Load average (5m avg)'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.10.1.3["index","1.3.6.1.4.1.2021.10.1.2", "Load-5"]'
+ key: system.cpu.load.avg5
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: UCD-SNMP-MIB
+ The 5 minutes load averages.
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 5263b1258bd24219a3f1a7d11012b316
+ name: 'TrueNAS: Load average (15m avg)'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.10.1.3["index","1.3.6.1.4.1.2021.10.1.2", "Load-15"]'
+ key: system.cpu.load.avg15
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: UCD-SNMP-MIB
+ The 15 minutes load averages.
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 94366f840edc4686a230682d623f1f41
+ name: 'TrueNAS: Number of CPUs'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#SNMPVALUE},1.3.6.1.2.1.25.3.3.1.1]'
+ key: system.cpu.num
+ history: 7d
+ description: |
+ MIB: HOST-RESOURCES-MIB
+ Count the number of CPU cores by counting number of cores discovered in hrProcessorTable using LLD.
+ preprocessing:
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //count the number of cores
+ return JSON.parse(value).length;
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: c8740f4489c04eedb072869e27f68a60
+ name: 'TrueNAS: Context switches per second'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.60.0
+ key: system.cpu.switches
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: UCD-SNMP-MIB
+ Number of context switches.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 992e99f0114f4f7589de8dacb56c8c28
+ name: 'TrueNAS: System description'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.1.1.0
+ key: system.descr
+ delay: 15m
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: |
+ MIB: SNMPv2-MIB
+ System description of the host.
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ uuid: 140ebe2bbc744575b0a0776168432666
+ name: 'TrueNAS: System location'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.1.6.0
+ key: system.location
+ delay: 15m
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: |
+ MIB: SNMPv2-MIB
+ The physical location of this node. If the location is unknown, the value is the zero-length string.
+ inventory_link: LOCATION
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ uuid: 213d20b760c3424f9257cc9fa77c40fb
+ name: 'TrueNAS: System name'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.1.5.0
+ key: system.name
+ delay: 15m
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: |
+ MIB: SNMPv2-MIB
+ System host name.
+ inventory_link: NAME
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: system
+ triggers:
+ -
+ uuid: d931601db9244884b6e411d4be2c297e
+ expression: 'last(/TrueNAS SNMP/system.name,#1)<>last(/TrueNAS SNMP/system.name,#2) and length(last(/TrueNAS SNMP/system.name))>0'
+ name: 'TrueNAS: System name has changed (new name: {ITEM.VALUE})'
+ priority: INFO
+ description: 'System name has changed. Ack to close.'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ tag: scope
+ value: security
+ -
+ uuid: fc6ed50ea4764ee6852ecd45b667f8df
+ name: 'TrueNAS: System object ID'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.1.2.0
+ key: system.objectid
+ delay: 15m
+ history: 7d
+ trends: '0'
+ value_type: CHAR
+ description: |
+ MIB: SNMPv2-MIB
+ The vendor authoritative identification of the network management subsystem contained in the entity. This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining what kind of box is being managed.
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: system
+ -
+ uuid: e61f086a8a3942569e6c7f67b24e8f86
+ name: 'TrueNAS: Free swap space'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.4.0
+ key: system.swap.free
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ The amount of swap space currently unused or available.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: storage
+ -
+ uuid: 2a075af85eed44c8adba2cb7bc657b40
+ name: 'TrueNAS: Free swap space in %'
+ type: CALCULATED
+ key: system.swap.pfree
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ params: 'last(//system.swap.free)/last(//system.swap.total)*100'
+ description: 'The free space of swap volume/file in percent.'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: storage
+ -
+ uuid: b0fc3cd77ed348bb955fc98d8636ab76
+ name: 'TrueNAS: Total swap space'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.3.0
+ key: system.swap.total
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ The total amount of swap space configured for this host.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: storage
+ -
+ uuid: a5f8ef4ba55e450d863d2237e940fad5
+ name: 'TrueNAS: Uptime'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.2.1.25.1.1.0
+ key: system.uptime
+ delay: 30s
+ history: 7d
+ trends: 0d
+ units: uptime
+ description: |
+ MIB: SNMPv2-MIB
+ System uptime in 'N days, hh:mm:ss' format.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '0.01'
+ tags:
+ -
+ tag: component
+ value: system
+ triggers:
+ -
+ uuid: 7ea3e6590e28476ea9876e26546af2d3
+ expression: 'last(/TrueNAS SNMP/system.uptime)<10m'
+ name: 'TrueNAS: has been restarted (uptime < 10m)'
+ priority: INFO
+ description: 'Uptime is less than 10 minutes.'
+ manual_close: 'YES'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 2eaaabc61df64756a35aec95650abf7c
+ name: 'TrueNAS: ARC target size of cache'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.6.0
+ key: truenas.zfs.arc.c
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ ARC target size of cache in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: a4ae886ac205413c85df7c527a9aadb3
+ name: 'TrueNAS: ARC data size'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.3.0
+ key: truenas.zfs.arc.data
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ ARC data size used in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: e3c72ceecec2478685e4bd5983e48c12
+ name: 'TrueNAS: ARC cache hit ratio'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.9.0
+ key: truenas.zfs.arc.hit.ratio
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: FREENAS-MIB
+ ARC cache hit ration percentage.
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: f4c6c12561944975999b59c30744b375
+ name: 'TrueNAS: ARC hits'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.4.0
+ key: truenas.zfs.arc.hits
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ Total amount of cache hits in the ARC per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: db3cee6cf685446ca880e3ba0c7a51f1
+ name: 'TrueNAS: ARC metadata size'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.2.0
+ key: truenas.zfs.arc.meta
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ ARC metadata size used in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: d39e5b7524054b5c8121a5b67506fc52
+ name: 'TrueNAS: ARC cache miss ratio'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.10.0
+ key: truenas.zfs.arc.miss.ratio
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: FREENAS-MIB
+ ARC cache miss ration percentage.
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 51b0901f89ca49f18b5af0c6325190ad
+ name: 'TrueNAS: ARC misses'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.5.0
+ key: truenas.zfs.arc.misses
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ Total amount of cache misses in the ARC per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 5b00055c79174a65af5168b47fb4dbd1
+ name: 'TrueNAS: ARC target size of MRU'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.7.0
+ key: truenas.zfs.arc.p
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ ARC target size of MRU in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: a677b4991bc94e5b929bcf9f6a0c08ee
+ name: 'TrueNAS: ARC size'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.4.1.0
+ key: truenas.zfs.arc.size
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ ARC size in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 2b2ca373849045969f6dbcd411a7e688
+ name: 'TrueNAS: L2ARC hits'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.5.1.0
+ key: truenas.zfs.l2arc.hits
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ Hits to the L2 cache per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: ff6827a36cc9451f801dcf5a433378de
+ name: 'TrueNAS: L2ARC misses'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.5.2.0
+ key: truenas.zfs.l2arc.misses
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ Misses to the L2 cache per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: d3408357df26465794eeb6d6706ee05a
+ name: 'TrueNAS: L2ARC read rate'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.5.3.0
+ key: truenas.zfs.l2arc.read
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: |
+ MIB: FREENAS-MIB
+ Read rate from L2 cache in bytes per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: ab95d192720b4f5fa897fed6f1aa40e2
+ name: 'TrueNAS: L2ARC size'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.5.5.0
+ key: truenas.zfs.l2arc.size
+ history: 7d
+ value_type: FLOAT
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ L2ARC size in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 1e04b61c5b0242b095c41495f9f28b57
+ name: 'TrueNAS: L2ARC write rate'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.5.4.0
+ key: truenas.zfs.l2arc.write
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: |
+ MIB: FREENAS-MIB
+ Write rate from L2 cache in bytes per second.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: a504d960680346ad863c5f2117301200
+ name: 'TrueNAS: ZIL operations 1 second'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.6.1.0
+ key: truenas.zfs.zil.ops1
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ The ops column parsed from the command zilstat 1 1.
+ tags:
+ -
+ tag: component
+ value: log
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: d82112c728704383b873289f0b8bbce6
+ name: 'TrueNAS: ZIL operations 5 seconds'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.6.2.0
+ key: truenas.zfs.zil.ops5
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ The ops column parsed from the command zilstat 5 1.
+ tags:
+ -
+ tag: component
+ value: log
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 598dda71f21a410a82ba5b96e1564166
+ name: 'TrueNAS: ZIL operations 10 seconds'
+ type: SNMP_AGENT
+ snmp_oid: .1.3.6.1.4.1.50536.1.6.3.0
+ key: truenas.zfs.zil.ops10
+ history: 7d
+ value_type: FLOAT
+ description: |
+ MIB: FREENAS-MIB
+ The ops column parsed from the command zilstat 10 1.
+ tags:
+ -
+ tag: component
+ value: log
+ -
+ tag: component
+ value: zfs
+ -
+ uuid: 43901b6beb7f4f559464775863d19976
+ name: 'TrueNAS: Available memory'
+ type: CALCULATED
+ key: vm.memory.available
+ history: 7d
+ units: B
+ params: last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)
+ description: 'Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ uuid: 3b6007f808e04eefafe236737773ce7f
+ name: 'TrueNAS: Memory (buffers)'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.14.0
+ key: vm.memory.buffers
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ The total amount of real or virtual memory currently allocated for use as memory buffers.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ uuid: ab4c02a4c1fc4ef69a31e9b83a1a9263
+ name: 'TrueNAS: Memory (cached)'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.15.0
+ key: vm.memory.cached
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ The total amount of real or virtual memory currently allocated for use as cached memory.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ uuid: d55491912c814481b0931e836838e9b0
+ name: 'TrueNAS: Free memory'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.6.0
+ key: vm.memory.free
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ The amount of real/physical memory currently unused or available.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ uuid: e3802f02a4364e6bb37fb7fe780c4137
+ name: 'TrueNAS: Total memory'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.4.5.0
+ key: vm.memory.total
+ history: 7d
+ units: B
+ description: |
+ MIB: UCD-SNMP-MIB
+ Total memory in Bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1024'
+ tags:
+ -
+ tag: component
+ value: memory
+ -
+ uuid: c70fad7e758e480fbae726a677a29ead
+ name: 'TrueNAS: Memory utilization'
+ type: CALCULATED
+ key: vm.memory.util
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ params: '(last(//vm.memory.total)-(last(//vm.memory.free)+last(//vm.memory.buffers)+last(//vm.memory.cached)))/last(//vm.memory.total)*100'
+ description: 'Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.'
+ tags:
+ -
+ tag: component
+ value: memory
+ triggers:
+ -
+ uuid: 3ee054e3d944441d9fd174e13b6a59ee
+ expression: 'min(/TrueNAS SNMP/vm.memory.util,5m)>{$MEMORY.UTIL.MAX}'
+ name: 'TrueNAS: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)'
+ priority: AVERAGE
+ description: 'The system is running out of free memory.'
+ dependencies:
+ -
+ name: 'TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})'
+ expression: 'min(/TrueNAS SNMP/vm.memory.available,5m)<{$MEMORY.AVAILABLE.MIN} and last(/TrueNAS SNMP/vm.memory.total)>0'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 76b7f3e3ec0044718bf3a9c254c1f832
+ name: 'TrueNAS: SNMP agent availability'
+ type: INTERNAL
+ key: 'zabbix[host,snmp,available]'
+ history: 7d
+ description: |
+ Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.
+ Possible value:
+ 0 - not available
+ 1 - available
+ 2 - unknown
+ valuemap:
+ name: zabbix.host.available
+ tags:
+ -
+ tag: component
+ value: health
+ -
+ tag: component
+ value: network
+ triggers:
+ -
+ uuid: 207abb1786ea4a39a7d569e54ee7cdb2
+ expression: 'max(/TrueNAS SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
+ name: 'TrueNAS: No SNMP data collection'
+ opdata: 'Current state: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'SNMP is not available for polling. Please check device connectivity and SNMP settings.'
+ dependencies:
+ -
+ name: 'TrueNAS: Unavailable by ICMP ping'
+ expression: 'max(/TrueNAS SNMP/icmpping,#3)=0'
+ tags:
+ -
+ tag: scope
+ value: availability
+ discovery_rules:
+ -
+ uuid: cc40c0d4ea184b12bf15056f103a4654
+ name: 'CPU discovery'
+ type: DEPENDENT
+ key: cpu.discovery
+ delay: '0'
+ description: 'This discovery will create set of per core CPU metrics from UCD-SNMP-MIB, using {#CPU.COUNT} in preprocessing. That''s the only reason why LLD is used.'
+ item_prototypes:
+ -
+ uuid: 03eaea043f2b4aee9ccc562ae5390656
+ name: 'TrueNAS: CPU idle time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.11.0
+ key: 'system.cpu.idle[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ The time the CPU has spent doing nothing.
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 378d399d09bd4197b20f575f023a9423
+ name: 'TrueNAS: CPU interrupt time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.56.0
+ key: 'system.cpu.interrupt[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ The amount of time the CPU has been servicing hardware interrupts.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //to get utilization in %, divide by N, where N is number of cores.
+ return value/{#CPU.COUNT}
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: bd17c78973cf482a8916645847a9814f
+ name: 'TrueNAS: CPU iowait time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.54.0
+ key: 'system.cpu.iowait[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ Amount of time the CPU has been waiting for I/O to complete.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //to get utilization in %, divide by N, where N is number of cores.
+ return value/{#CPU.COUNT}
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: e25d8fe2e3b24fff86fe2d91e9b4f16e
+ name: 'TrueNAS: CPU nice time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.51.0
+ key: 'system.cpu.nice[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ The time the CPU has spent running users' processes that have been niced.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //to get utilization in %, divide by N, where N is number of cores.
+ return value/{#CPU.COUNT}
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 6782830d2a25423fb0db137d66b2f2dd
+ name: 'TrueNAS: CPU system time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.52.0
+ key: 'system.cpu.system[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ The time the CPU has spent running the kernel and its processes.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //to get utilization in %, divide by N, where N is number of cores.
+ return value/{#CPU.COUNT}
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: d38eaa9cf17a4778b0b6dfea897e3e6e
+ name: 'TrueNAS: CPU user time'
+ type: SNMP_AGENT
+ snmp_oid: 1.3.6.1.4.1.2021.11.50.0
+ key: 'system.cpu.user[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-SNMP-MIB
+ The time the CPU has spent running users' processes that are not niced.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //to get utilization in %, divide by N, where N is number of cores.
+ return value/{#CPU.COUNT}
+ tags:
+ -
+ tag: component
+ value: cpu
+ -
+ uuid: 40f51efcbf47483f84c843c00bd1e034
+ name: 'TrueNAS: CPU utilization'
+ type: DEPENDENT
+ key: 'system.cpu.util[{#SNMPINDEX}]'
+ delay: '0'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: 'CPU utilization in %.'
+ preprocessing:
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //Calculate utilization
+ return (100 - value)
+ master_item:
+ key: 'system.cpu.idle[{#SNMPINDEX}]'
+ tags:
+ -
+ tag: component
+ value: cpu
+ trigger_prototypes:
+ -
+ uuid: 776551cd5322405e8d7c2b9c30b3a82b
+ expression: 'min(/TrueNAS SNMP/system.cpu.util[{#SNMPINDEX}],5m)>{$CPU.UTIL.CRIT}'
+ name: 'TrueNAS: High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m)'
+ opdata: 'Current utilization: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'CPU utilization is too high. The system might be slow to respond.'
+ dependencies:
+ -
+ name: 'TrueNAS: Load average is too high (per CPU load over {$LOAD_AVG_PER_CPU.MAX.WARN} for 5m)'
+ expression: |
+ min(/TrueNAS SNMP/system.cpu.load.avg1,5m)/last(/TrueNAS SNMP/system.cpu.num)>{$LOAD_AVG_PER_CPU.MAX.WARN}
+ and last(/TrueNAS SNMP/system.cpu.load.avg5)>0
+ and last(/TrueNAS SNMP/system.cpu.load.avg15)>0
+ tags:
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: ef6bd369fc964266a4324f314d5dbdc2
+ name: 'TrueNAS: CPU usage{#SINGLETON}'
+ type: STACKED
+ ymin_type_1: FIXED
+ ymax_type_1: FIXED
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.system[{#SNMPINDEX}]'
+ -
+ sortorder: '1'
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.user[{#SNMPINDEX}]'
+ -
+ sortorder: '2'
+ color: F63100
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.nice[{#SNMPINDEX}]'
+ -
+ sortorder: '3'
+ color: A54F10
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.iowait[{#SNMPINDEX}]'
+ -
+ sortorder: '4'
+ color: FC6EA3
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.interrupt[{#SNMPINDEX}]'
+ -
+ uuid: 11de3174f0e24212bedd1ef81429db9d
+ name: 'TrueNAS: CPU utilization{#SINGLETON}'
+ ymin_type_1: FIXED
+ ymax_type_1: FIXED
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'system.cpu.util[{#SNMPINDEX}]'
+ master_item:
+ key: system.cpu.num
+ preprocessing:
+ -
+ type: JAVASCRIPT
+ parameters:
+ - |
+ //count the number of CPU cores
+ return JSON.stringify([{"{#CPU.COUNT}": value, "{#SNMPINDEX}": 0, "{#SINGLETON}":""}])
+ -
+ uuid: ebf01415c97e4cbaa84d39a392af7c37
+ name: 'Network interfaces discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#IFOPERSTATUS},1.3.6.1.2.1.2.2.1.8,{#IFADMINSTATUS},1.3.6.1.2.1.2.2.1.7,{#IFALIAS},1.3.6.1.2.1.31.1.1.1.18,{#IFNAME},1.3.6.1.2.1.31.1.1.1.1,{#IFDESCR},1.3.6.1.2.1.2.2.1.2,{#IFTYPE},1.3.6.1.2.1.2.2.1.3]'
+ key: net.if.discovery
+ delay: 1h
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#IFADMINSTATUS}'
+ value: '{$NET.IF.IFADMINSTATUS.MATCHES}'
+ formulaid: A
+ -
+ macro: '{#IFADMINSTATUS}'
+ value: '{$NET.IF.IFADMINSTATUS.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: B
+ -
+ macro: '{#IFOPERSTATUS}'
+ value: '{$NET.IF.IFOPERSTATUS.MATCHES}'
+ formulaid: I
+ -
+ macro: '{#IFOPERSTATUS}'
+ value: '{$NET.IF.IFOPERSTATUS.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: J
+ -
+ macro: '{#IFNAME}'
+ value: '{$NET.IF.IFNAME.MATCHES}'
+ formulaid: G
+ -
+ macro: '{#IFNAME}'
+ value: '{$NET.IF.IFNAME.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: H
+ -
+ macro: '{#IFDESCR}'
+ value: '{$NET.IF.IFDESCR.MATCHES}'
+ formulaid: E
+ -
+ macro: '{#IFDESCR}'
+ value: '{$NET.IF.IFDESCR.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: F
+ -
+ macro: '{#IFALIAS}'
+ value: '{$NET.IF.IFALIAS.MATCHES}'
+ formulaid: C
+ -
+ macro: '{#IFALIAS}'
+ value: '{$NET.IF.IFALIAS.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: D
+ -
+ macro: '{#IFTYPE}'
+ value: '{$NET.IF.IFTYPE.MATCHES}'
+ formulaid: K
+ -
+ macro: '{#IFTYPE}'
+ value: '{$NET.IF.IFTYPE.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: L
+ description: 'Discovering interfaces from IF-MIB.'
+ item_prototypes:
+ -
+ uuid: 71257fe84dde4281854f4f74f0ea1e4c
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Inbound packets discarded'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.13.{#SNMPINDEX}'
+ key: 'net.if.in.discards[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ The number of inbound packets which were chosen to be discarded
+ even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.
+ One possible reason for discarding such a packet could be to free up buffer space.
+ Discontinuities in the value of this counter can occur at re-initialization of the management system,
+ and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ -
+ uuid: d5d20ce0e2c9429b9b0c5eea23d3dca5
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Inbound packets with errors'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.14.{#SNMPINDEX}'
+ key: 'net.if.in.errors[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ For packet-oriented interfaces, the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ trigger_prototypes:
+ -
+ uuid: 89a43ff26b204fceb91108740ece1ee3
+ expression: 'min(/TrueNAS SNMP/net.if.in.errors[{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"}'
+ recovery_mode: RECOVERY_EXPRESSION
+ recovery_expression: 'max(/TrueNAS SNMP/net.if.in.errors[{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8'
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High input error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m)'
+ opdata: 'errors in: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.'
+ dependencies:
+ -
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: a7f3b11533ac411d8133e6e859f63d61
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Bits received'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.31.1.1.1.6.{#SNMPINDEX}'
+ key: 'net.if.in[{#SNMPINDEX}]'
+ history: 7d
+ units: bps
+ description: |
+ MIB: IF-MIB
+ The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ -
+ uuid: 35c209485ac34a7ebebe7c4785f448b5
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Outbound packets discarded'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.19.{#SNMPINDEX}'
+ key: 'net.if.out.discards[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ The number of outbound packets which were chosen to be discarded
+ even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.
+ One possible reason for discarding such a packet could be to free up buffer space.
+ Discontinuities in the value of this counter can occur at re-initialization of the management system,
+ and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ -
+ uuid: 07adb0c51d6b4f34ab21e48744cad18d
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Outbound packets with errors'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.20.{#SNMPINDEX}'
+ key: 'net.if.out.errors[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ For packet-oriented interfaces, the number of outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of outbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ trigger_prototypes:
+ -
+ uuid: c1cfeff568e2421ba06648ca55bcfef5
+ expression: 'min(/TrueNAS SNMP/net.if.out.errors[{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"}'
+ recovery_mode: RECOVERY_EXPRESSION
+ recovery_expression: 'max(/TrueNAS SNMP/net.if.out.errors[{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8'
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High output error rate ( > {$IF.ERRORS.WARN:"{#IFNAME}"} for 5m)'
+ opdata: 'errors out: {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold.'
+ dependencies:
+ -
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: 4406d8a768ce41c6b383657e22cbf4a1
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Bits sent'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}'
+ key: 'net.if.out[{#SNMPINDEX}]'
+ history: 7d
+ units: bps
+ description: |
+ MIB: IF-MIB
+ The total number of octets transmitted out of the interface, including framing characters. This object is a 64-bit version of ifOutOctets.Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ -
+ type: MULTIPLIER
+ parameters:
+ - '8'
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ -
+ uuid: 94231ecd77da47b49ee2df1afd302e97
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Speed'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.31.1.1.1.15.{#SNMPINDEX}'
+ key: 'net.if.speed[{#SNMPINDEX}]'
+ history: 7d
+ units: bps
+ description: |
+ MIB: IF-MIB
+ An estimate of the interface's current bandwidth in units of 1,000,000 bits per second. If this object reports a value of `n' then the speed of the interface is somewhere in the range of `n-500,000' to`n+499,999'. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. For a sub-layer which has no concept of bandwidth, this object should be zero.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '1000000'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ -
+ uuid: 50bfa188160747b98c3ee4043cb60a96
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Operational status'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}'
+ key: 'net.if.status[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ The current operational state of the interface.
+ - The testing(3) state indicates that no operational packet scan be passed
+ - If ifAdminStatus is down(2) then ifOperStatus should be down(2)
+ - If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic
+ - It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)
+ - It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state
+ - It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.
+ valuemap:
+ name: 'IF-MIB::ifOperStatus'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ trigger_prototypes:
+ -
+ uuid: ba6767729f78405aba8d09bf14b3a0fa
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ opdata: 'Current state: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: |
+ This trigger expression works as follows:
+ 1. Can be triggered if operations status is down.
+ 2. {$IFCONTROL:"{#IFNAME}"}=1 - user can redefine Context macro to value - 0. That marks this interface as not important. No new trigger will be fired if this interface is down.
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: 2f37ffca1e2e47ebadef5a4ed316dd90
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Interface type'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.2.1.2.2.1.3.{#SNMPINDEX}'
+ key: 'net.if.type[{#SNMPINDEX}]'
+ history: 7d
+ description: |
+ MIB: IF-MIB
+ The type of interface.
+ Additional values for ifType are assigned by the Internet Assigned Numbers Authority (IANA),
+ through updating the syntax of the IANAifType textual convention.
+ valuemap:
+ name: 'IF-MIB::ifType'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ tags:
+ -
+ tag: component
+ value: network
+ -
+ tag: description
+ value: '{#IFALIAS}'
+ -
+ tag: interface
+ value: '{#IFNAME}'
+ trigger_prototypes:
+ -
+ uuid: fcc3734390c645f3a4ad5d694675fa3a
+ expression: |
+ change(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])<0 and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0
+ and (
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=6 or
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=7 or
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=11 or
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=62 or
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=69 or
+ last(/TrueNAS SNMP/net.if.type[{#SNMPINDEX}])=117
+ )
+ and
+ (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])<>2)
+ recovery_mode: RECOVERY_EXPRESSION
+ recovery_expression: |
+ (change(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0 and last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}],#2)>0) or
+ (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Ethernet has changed to lower speed than it was before'
+ opdata: 'Current reported speed: {ITEM.LASTVALUE1}'
+ priority: INFO
+ description: 'This Ethernet connection has transitioned down from its known maximum speed. This might be a sign of autonegotiation issues. Ack to close.'
+ dependencies:
+ -
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ uuid: 94adfef34fca4421b88f9253de55554e
+ expression: |
+ (avg(/TrueNAS SNMP/net.if.in[{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])) and
+ last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0
+ recovery_mode: RECOVERY_EXPRESSION
+ recovery_expression: 'avg(/TrueNAS SNMP/net.if.in[{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])'
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High inbound bandwidth usage ( > {$IF.UTIL.MAX:"{#IFNAME}"}% )'
+ opdata: 'In: {ITEM.LASTVALUE1}, speed: {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'The network interface utilization is close to its estimated maximum bandwidth.'
+ dependencies:
+ -
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ tags:
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 9ed09a6968b0416d9ac556ca35a04db4
+ expression: |
+ (avg(/TrueNAS SNMP/net.if.out[{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])) and
+ last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])>0
+ recovery_mode: RECOVERY_EXPRESSION
+ recovery_expression: 'avg(/TrueNAS SNMP/net.if.out[{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/TrueNAS SNMP/net.if.speed[{#SNMPINDEX}])'
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: High outbound bandwidth usage ( > {$IF.UTIL.MAX:"{#IFNAME}"}% )'
+ opdata: 'Out: {ITEM.LASTVALUE1}, speed: {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'The network interface utilization is close to its estimated maximum bandwidth.'
+ dependencies:
+ -
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Link down'
+ expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (last(/TrueNAS SNMP/net.if.status[{#SNMPINDEX}])=2)'
+ tags:
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: bff9db9816624e2e89975084afa60323
+ name: 'TrueNAS: Interface [{#IFNAME}({#IFALIAS})]: Network traffic'
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.in[{#SNMPINDEX}]'
+ -
+ sortorder: '1'
+ drawtype: BOLD_LINE
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.out[{#SNMPINDEX}]'
+ -
+ sortorder: '2'
+ color: F63100
+ yaxisside: RIGHT
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.out.errors[{#SNMPINDEX}]'
+ -
+ sortorder: '3'
+ color: A54F10
+ yaxisside: RIGHT
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.in.errors[{#SNMPINDEX}]'
+ -
+ sortorder: '4'
+ color: FC6EA3
+ yaxisside: RIGHT
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.out.discards[{#SNMPINDEX}]'
+ -
+ sortorder: '5'
+ color: 6C59DC
+ yaxisside: RIGHT
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'net.if.in.discards[{#SNMPINDEX}]'
+ -
+ uuid: b3906a308e4c4631a96a4aa188d22c74
+ name: 'Disks temperature discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#DISK_NAME},.1.3.6.1.4.1.50536.3.1.2]'
+ key: truenas.disk.temp.discovery
+ delay: 1h
+ description: 'Disks temperature discovery from FREENAS-MIB.'
+ item_prototypes:
+ -
+ uuid: 7de2508fff174bd78b4ea0424a67fbf9
+ name: 'TrueNAS: Disk [{#DISK_NAME}]: Temperature'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.3.1.3.{#SNMPINDEX}'
+ key: 'truenas.disk.temp[{#DISK_NAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: C
+ description: |
+ MIB: FREENAS-MIB
+ The temperature of this HDD in mC.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '0.001'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: disk
+ value: '{#DISK_NAME}'
+ trigger_prototypes:
+ -
+ uuid: fda99a2e62064414af85c1137cbf0aef
+ expression: 'avg(/TrueNAS SNMP/truenas.disk.temp[{#DISK_NAME}],5m) > {$TEMPERATURE.MAX.CRIT:"{#DISK_NAME}"}'
+ name: 'TrueNAS: Disk [{#DISK_NAME}]: Average disk temperature is too high (over {$TEMPERATURE.MAX.CRIT:"{#DISK_NAME}"}C for 5m)'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: 'Disk temperature is high.'
+ tags:
+ -
+ tag: scope
+ value: notice
+ -
+ uuid: 73194e7637a84dca976b218e9f4248c2
+ expression: 'avg(/TrueNAS SNMP/truenas.disk.temp[{#DISK_NAME}],5m) > {$TEMPERATURE.MAX.WARN:"{#DISK_NAME}"}'
+ name: 'TrueNAS: Disk [{#DISK_NAME}]: Average disk temperature is too high (over {$TEMPERATURE.MAX.WARN:"{#DISK_NAME}"}C for 5m)'
+ opdata: 'Current value: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: 'Disk temperature is high.'
+ tags:
+ -
+ tag: scope
+ value: notice
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ -
+ uuid: f3d22d302e274b12927afd9453bb787a
+ name: 'ZFS datasets discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#DATASET_NAME},.1.3.6.1.4.1.50536.1.2.1.1.2,{#DATASET_ALLOC_UNITS},.1.3.6.1.4.1.50536.1.2.1.1.3]'
+ key: truenas.zfs.dataset.discovery
+ delay: 1h
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#DATASET_NAME}'
+ value: '{$DATASET.NAME.MATCHES}'
+ formulaid: A
+ -
+ macro: '{#DATASET_NAME}'
+ value: '{$DATASET.NAME.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: B
+ description: 'ZFS datasets discovery from FREENAS-MIB.'
+ item_prototypes:
+ -
+ uuid: 3c3eab95b8e74e608fe3b7abab98c76b
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Available space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.2.1.1.6.{#SNMPINDEX}'
+ key: 'truenas.dataset.avail[{#DATASET_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The available size of the dataset in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#DATASET_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: dataset
+ value: '{#DATASET_NAME}'
+ -
+ uuid: fd6b3a3ebfb041b3a9026fb1b4370ec7
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Usage in %'
+ type: CALCULATED
+ key: 'truenas.dataset.pused[{#DATASET_NAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ params: 'last(//truenas.dataset.used[{#DATASET_NAME}]) * 100 / last(//truenas.dataset.size.total[{#DATASET_NAME}])'
+ description: 'The used size of the dataset in %.'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: dataset
+ value: '{#DATASET_NAME}'
+ -
+ uuid: 5ead1929891a4152b581f9adf35ce4ce
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Total space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.2.1.1.4.{#SNMPINDEX}'
+ key: 'truenas.dataset.size.total[{#DATASET_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The size of the dataset in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#DATASET_ALLOC_UNITS}'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: dataset
+ value: '{#DATASET_NAME}'
+ -
+ uuid: 0e24fceacd64430abed01294ffd28104
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Used space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.2.1.1.5.{#SNMPINDEX}'
+ key: 'truenas.dataset.used[{#DATASET_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The used size of the dataset in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#DATASET_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: dataset
+ value: '{#DATASET_NAME}'
+ trigger_prototypes:
+ -
+ uuid: f759e058ef5345d884662f51db0c222e
+ expression: 'min(/TrueNAS SNMP/truenas.dataset.pused[{#DATASET_NAME}],5m) > {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"} and last(/TrueNAS SNMP/truenas.dataset.avail[{#DATASET_NAME}]) < {$DATASET.FREE.MIN.WARN:"{#POOLNAME}"}'
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: High space usage (more than {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"}% used)'
+ opdata: 'Current usage: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: |
+ Two conditions should match: First, space utilization should be above {$DATASET.PUSED.MAX.WARN:"{#DATASET_NAME}"}%.
+ Second condition: The dataset free space is less than {$DATASET.FREE.MIN.WARN:"{#POOLNAME}"}.
+ dependencies:
+ -
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Very high space usage (more than {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}% used)'
+ expression: 'min(/TrueNAS SNMP/truenas.dataset.pused[{#DATASET_NAME}],5m) > {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"} and last(/TrueNAS SNMP/truenas.dataset.avail[{#DATASET_NAME}]) < {$DATASET.FREE.MIN.CRIT:"{#POOLNAME}"}'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: f0e37c1f63aa4e3090c0dc8c4f0dfe9b
+ expression: 'min(/TrueNAS SNMP/truenas.dataset.pused[{#DATASET_NAME}],5m) > {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"} and last(/TrueNAS SNMP/truenas.dataset.avail[{#DATASET_NAME}]) < {$DATASET.FREE.MIN.CRIT:"{#POOLNAME}"}'
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Very high space usage (more than {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}% used)'
+ opdata: 'Current usage: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: |
+ Two conditions should match: First, space utilization should be above {$DATASET.PUSED.MAX.CRIT:"{#DATASET_NAME}"}%.
+ Second condition: The dataset free space is less than {$DATASET.FREE.MIN.CRIT:"{#POOLNAME}"}.
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: 38637298316543bdb9f2c291285f8077
+ name: 'TrueNAS: Dataset [{#DATASET_NAME}]: Space usage'
+ width: '600'
+ height: '340'
+ type: PIE
+ show_3d: 'YES'
+ graph_items:
+ -
+ color: '969696'
+ calc_fnc: LAST
+ type: GRAPH_SUM
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.dataset.size.total[{#DATASET_NAME}]'
+ -
+ sortorder: '1'
+ color: C80000
+ calc_fnc: LAST
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.dataset.used[{#DATASET_NAME}]'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ -
+ uuid: edde9729f6304a9b83d31a1c62356fdd
+ name: 'ZFS pools discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#POOLNAME},.1.3.6.1.4.1.50536.1.1.1.1.2,{#POOL_ALLOC_UNITS},.1.3.6.1.4.1.50536.1.1.1.1.3]'
+ key: truenas.zfs.pools.discovery
+ delay: 1h
+ description: 'ZFS pools discovery from FREENAS-MIB.'
+ item_prototypes:
+ -
+ uuid: 2727c62d279f46b0938b1ef6c3b70fe5
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Available space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.6.{#SNMPINDEX}'
+ key: 'truenas.zpool.avail[{#POOLNAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The available size of the storage pool in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#POOL_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: 382c3a50845f4d96a44dc22704768d41
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Health'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.7.{#SNMPINDEX}'
+ key: 'truenas.zpool.health[{#POOLNAME}]'
+ history: 7d
+ description: |
+ MIB: FREENAS-MIB
+ The current health of the containing pool, as reported by zpool status.
+ valuemap:
+ name: 'FREENAS-MIB::ZPoolHealthType'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: health
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ trigger_prototypes:
+ -
+ uuid: 676c2abdd102484a92db3501ccc2ca51
+ expression: 'last(/TrueNAS SNMP/truenas.zpool.health[{#POOLNAME}]) <> 0'
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Status is not online'
+ opdata: 'Current state: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: 'Please check pool status.'
+ tags:
+ -
+ tag: scope
+ value: availability
+ -
+ uuid: 5f972063f958463ab132b8d478092bd8
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Usage in %'
+ type: CALCULATED
+ key: 'truenas.zpool.pused[{#POOLNAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ params: 'last(//truenas.zpool.used[{#POOLNAME}]) * 100 / last(//truenas.zpool.size.total[{#POOLNAME}])'
+ description: 'The used size of the storage pool in %.'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: b5766173631a47ee8c58e24f5c0523b5
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Read rate'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.10.{#SNMPINDEX}'
+ key: 'truenas.zpool.read.bytes[{#POOLNAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: |
+ MIB: FREENAS-MIB
+ The bandwidth of all read operations (including metadata), expressed as units per second (averaged since system booted).
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#POOL_ALLOC_UNITS}'
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: f32abc8617c6466d8a92219def967bd8
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Read operations rate'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.8.{#SNMPINDEX}'
+ key: 'truenas.zpool.read.ops[{#POOLNAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: IOPS
+ description: |
+ MIB: FREENAS-MIB
+ The number of read I/O operations sent to the pool or device, including metadata requests (averaged since system booted).
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: 567422ecdcec49faac94540f64a05e3a
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Total space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.4.{#SNMPINDEX}'
+ key: 'truenas.zpool.size.total[{#POOLNAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The size of the storage pool in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#POOL_ALLOC_UNITS}'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: fe5cf78cdcdd4386982f5cd204d99283
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Used space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.5.{#SNMPINDEX}'
+ key: 'truenas.zpool.used[{#POOLNAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The used size of the storage pool in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#POOL_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: d11e981ec16c4da0aee6842bdddfe2fd
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Write rate'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.11.{#SNMPINDEX}'
+ key: 'truenas.zpool.write.bytes[{#POOLNAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: Bps
+ description: |
+ MIB: FREENAS-MIB
+ The bandwidth of all write operations, expressed as units per second (averaged since system booted).
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#POOL_ALLOC_UNITS}'
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ -
+ uuid: e4bfc421633a433ca1b895fa4f5cf96e
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Write operations rate'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.1.1.1.9.{#SNMPINDEX}'
+ key: 'truenas.zpool.write.ops[{#POOLNAME}]'
+ history: 7d
+ value_type: FLOAT
+ units: IOPS
+ description: |
+ MIB: FREENAS-MIB
+ The number of write I/O operations sent to the pool or device (averaged since system booted).
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: pool
+ value: '{#POOLNAME}'
+ trigger_prototypes:
+ -
+ uuid: 18eef491c14b4f768400b4acca5c7e80
+ expression: 'min(/TrueNAS SNMP/truenas.zpool.pused[{#POOLNAME}],5m) > {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"} and last(/TrueNAS SNMP/truenas.zpool.avail[{#POOLNAME}]) < {$ZPOOL.FREE.MIN.WARN:"{#POOLNAME}"}'
+ name: 'TrueNAS: Pool [{#POOLNAME}]: High space usage (more than {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"}% used)'
+ opdata: 'Current usage: {ITEM.LASTVALUE1}'
+ priority: WARNING
+ description: |
+ Two conditions should match: First, space utilization should be above {$ZPOOL.PUSED.MAX.WARN:"{#POOLNAME}"}%.
+ Second condition: The pool free space is less than {$ZPOOL.FREE.MIN.WARN:"{#POOLNAME}"}.
+ dependencies:
+ -
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Very high space usage (more than {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}% used)'
+ expression: 'min(/TrueNAS SNMP/truenas.zpool.pused[{#POOLNAME}],5m) > {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"} and last(/TrueNAS SNMP/truenas.zpool.avail[{#POOLNAME}]) < {$ZPOOL.FREE.MIN.CRIT:"{#POOLNAME}"}'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: ab01140b8a724c1cbb79be032de8c8b5
+ expression: 'min(/TrueNAS SNMP/truenas.zpool.pused[{#POOLNAME}],5m) > {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"} and last(/TrueNAS SNMP/truenas.zpool.avail[{#POOLNAME}]) < {$ZPOOL.FREE.MIN.CRIT:"{#POOLNAME}"}'
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Very high space usage (more than {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}% used)'
+ opdata: 'Current usage: {ITEM.LASTVALUE1}'
+ priority: AVERAGE
+ description: |
+ Two conditions should match: First, space utilization should be above {$ZPOOL.PUSED.MAX.CRIT:"{#POOLNAME}"}%.
+ Second condition: The pool free space is less than {$ZPOOL.FREE.MIN.CRIT:"{#POOLNAME}"}.
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ graph_prototypes:
+ -
+ uuid: 8c2ed6ea842941b3b306efe87df844be
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Read/write rates'
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zpool.read.bytes[{#POOLNAME}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zpool.write.bytes[{#POOLNAME}]'
+ -
+ uuid: 497e60420e314ec3a3de904042ae4756
+ name: 'TrueNAS: Pool [{#POOLNAME}]: Space usage'
+ width: '600'
+ height: '340'
+ type: PIE
+ show_3d: 'YES'
+ graph_items:
+ -
+ color: '969696'
+ calc_fnc: LAST
+ type: GRAPH_SUM
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zpool.size.total[{#POOLNAME}]'
+ -
+ sortorder: '1'
+ color: C80000
+ calc_fnc: LAST
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zpool.used[{#POOLNAME}]'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ -
+ uuid: dfeb1df58c024b27a0a65206d896975c
+ name: 'ZFS volumes discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#ZVOL_NAME},.1.3.6.1.4.1.50536.1.3.1.1.2,{#ZVOL_ALLOC_UNITS},.1.3.6.1.4.1.50536.1.3.1.1.3]'
+ key: truenas.zfs.zvols.discovery
+ delay: 1h
+ description: 'ZFS volumes discovery from FREENAS-MIB.'
+ item_prototypes:
+ -
+ uuid: 26967102b3a946c997fbbdcc5c2d78bc
+ name: 'TrueNAS: ZFS volume [{#ZVOL_NAME}]: Available space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.3.1.1.6.{#SNMPINDEX}'
+ key: 'truenas.zvol.avail[{#ZVOL_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The available of the ZFS volume in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#ZVOL_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: volume
+ value: '{#ZVOL_NAME}'
+ -
+ uuid: cc01786aff804d6998b039525214ddbd
+ name: 'TrueNAS: ZFS volume [{#ZVOL_NAME}]: Total space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.3.1.1.4.{#SNMPINDEX}'
+ key: 'truenas.zvol.size.total[{#ZVOL_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The size of the ZFS volume in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#ZVOL_ALLOC_UNITS}'
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 1h
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: volume
+ value: '{#ZVOL_NAME}'
+ -
+ uuid: a722d904125d46729c29ad4283d0b1b0
+ name: 'TrueNAS: ZFS volume [{#ZVOL_NAME}]: Used space'
+ type: SNMP_AGENT
+ snmp_oid: '.1.3.6.1.4.1.50536.1.3.1.1.5.{#SNMPINDEX}'
+ key: 'truenas.zvol.used[{#ZVOL_NAME}]'
+ history: 7d
+ units: B
+ description: |
+ MIB: FREENAS-MIB
+ The used size of the ZFS volume in bytes.
+ preprocessing:
+ -
+ type: MULTIPLIER
+ parameters:
+ - '{#ZVOL_ALLOC_UNITS}'
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: volume
+ value: '{#ZVOL_NAME}'
+ graph_prototypes:
+ -
+ uuid: 18746b4b3cfb4d1baf06df7b05a047f9
+ name: 'TrueNAS: ZFS volume [{#ZVOL_NAME}]: Space usage'
+ width: '600'
+ height: '340'
+ type: PIE
+ show_3d: 'YES'
+ graph_items:
+ -
+ color: '969696'
+ calc_fnc: LAST
+ type: GRAPH_SUM
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zvol.size.total[{#ZVOL_NAME}]'
+ -
+ sortorder: '1'
+ color: C80000
+ calc_fnc: LAST
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'truenas.zvol.used[{#ZVOL_NAME}]'
+ preprocessing:
+ -
+ type: DISCARD_UNCHANGED_HEARTBEAT
+ parameters:
+ - 6h
+ -
+ uuid: 1f992aa87f9e4074a8cba928b2017a03
+ name: 'Block devices discovery'
+ type: SNMP_AGENT
+ snmp_oid: 'discovery[{#DEVNAME},1.3.6.1.4.1.2021.13.15.1.1.2]'
+ key: vfs.dev.discovery
+ delay: 1h
+ filter:
+ evaltype: AND
+ conditions:
+ -
+ macro: '{#DEVNAME}'
+ value: '{$VFS.DEV.DEVNAME.MATCHES}'
+ formulaid: A
+ -
+ macro: '{#DEVNAME}'
+ value: '{$VFS.DEV.DEVNAME.NOT_MATCHES}'
+ operator: NOT_MATCHES_REGEX
+ formulaid: B
+ description: 'Block devices are discovered from UCD-DISKIO-MIB::diskIOTable (http://net-snmp.sourceforge.net/docs/mibs/ucdDiskIOMIB.html#diskIOTable).'
+ item_prototypes:
+ -
+ uuid: ba220c4106cb4bff9dd60c92aee7919a
+ name: 'TrueNAS: [{#DEVNAME}]: Disk read rate'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.13.15.1.1.5.{#SNMPINDEX}'
+ key: 'vfs.dev.read.rate[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '!r/s'
+ description: |
+ MIB: UCD-DISKIO-MIB
+ The number of read accesses from this device since boot.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: disk
+ value: '{#DEVNAME}'
+ -
+ uuid: 0dd2f25f1d2a45f2ae265d8550fe7d45
+ name: 'TrueNAS: [{#DEVNAME}]: Disk utilization'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.13.15.1.1.9.{#SNMPINDEX}'
+ key: 'vfs.dev.util[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '%'
+ description: |
+ MIB: UCD-DISKIO-MIB
+ The 1 minute average load of disk (%).
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: disk
+ value: '{#DEVNAME}'
+ -
+ uuid: 1549def5cf23434b8d0a19ac951eb2ff
+ name: 'TrueNAS: [{#DEVNAME}]: Disk write rate'
+ type: SNMP_AGENT
+ snmp_oid: '1.3.6.1.4.1.2021.13.15.1.1.6.{#SNMPINDEX}'
+ key: 'vfs.dev.write.rate[{#SNMPINDEX}]'
+ history: 7d
+ value_type: FLOAT
+ units: '!w/s'
+ description: |
+ MIB: UCD-DISKIO-MIB
+ The number of write accesses from this device since boot.
+ preprocessing:
+ -
+ type: CHANGE_PER_SECOND
+ parameters:
+ - ''
+ tags:
+ -
+ tag: component
+ value: storage
+ -
+ tag: disk
+ value: '{#DEVNAME}'
+ graph_prototypes:
+ -
+ uuid: c6e277b4a9e949df9e7bfd6adefc65b5
+ name: 'TrueNAS: [{#DEVNAME}]: Read/write rates'
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'vfs.dev.read.rate[{#SNMPINDEX}]'
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: 'vfs.dev.write.rate[{#SNMPINDEX}]'
+ tags:
+ -
+ tag: class
+ value: hardware
+ -
+ tag: target
+ value: truenas
+ macros:
+ -
+ macro: '{$CPU.UTIL.CRIT}'
+ value: '90'
+ description: 'Threshold of CPU utilization for warning trigger in %.'
+ -
+ macro: '{$DATASET.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$DATASET.FREE.MIN.WARN}'
+ value: 5G
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$DATASET.NAME.MATCHES}'
+ value: .+
+ description: 'This macro is used in datasets discovery. Can be overridden on the host or linked template level'
+ -
+ macro: '{$DATASET.NAME.NOT_MATCHES}'
+ value: '^(boot|.+\.system(.+)?$)'
+ description: 'This macro is used in datasets discovery. Can be overridden on the host or linked template level'
+ -
+ macro: '{$DATASET.PUSED.MAX.CRIT}'
+ value: '90'
+ description: 'Threshold of used dataset space for average severity trigger in %.'
+ -
+ macro: '{$DATASET.PUSED.MAX.WARN}'
+ value: '80'
+ description: 'Threshold of used dataset space for warning trigger in %.'
+ -
+ macro: '{$ICMP_LOSS_WARN}'
+ value: '20'
+ description: 'Threshold of ICMP packets loss for warning trigger in %.'
+ -
+ macro: '{$ICMP_RESPONSE_TIME_WARN}'
+ value: '0.15'
+ description: 'Threshold of average ICMP response time for warning trigger in seconds.'
+ -
+ macro: '{$IF.ERRORS.WARN}'
+ value: '2'
+ description: 'Threshold of error packets rate for warning trigger. Can be used with interface name as context.'
+ -
+ macro: '{$IF.UTIL.MAX}'
+ value: '90'
+ description: 'Threshold of interface bandwidth utilization for warning trigger in %. Can be used with interface name as context.'
+ -
+ macro: '{$IFCONTROL}'
+ value: '1'
+ description: 'Macro for operational state of the interface for link down trigger. Can be used with interface name as context.'
+ -
+ macro: '{$LOAD_AVG_PER_CPU.MAX.WARN}'
+ value: '1.5'
+ description: 'Load per CPU considered sustainable. Tune if needed.'
+ -
+ macro: '{$MEMORY.AVAILABLE.MIN}'
+ value: 20M
+ description: 'Threshold of available memory for trigger in bytes.'
+ -
+ macro: '{$MEMORY.UTIL.MAX}'
+ value: '90'
+ description: 'Threshold of memory utilization for trigger in %'
+ -
+ macro: '{$NET.IF.IFADMINSTATUS.MATCHES}'
+ value: '^.*'
+ description: 'This macro is used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFADMINSTATUS.NOT_MATCHES}'
+ value: ^2$
+ description: 'Ignore down(2) administrative status'
+ -
+ macro: '{$NET.IF.IFALIAS.MATCHES}'
+ value: '.*'
+ description: 'This macro is used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFALIAS.NOT_MATCHES}'
+ value: CHANGE_IF_NEEDED
+ description: 'This macro is used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFDESCR.MATCHES}'
+ value: '.*'
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFDESCR.NOT_MATCHES}'
+ value: CHANGE_IF_NEEDED
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFNAME.MATCHES}'
+ value: '^em[0-9]+$'
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFNAME.NOT_MATCHES}'
+ value: ^$
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFOPERSTATUS.MATCHES}'
+ value: '^.*$'
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFOPERSTATUS.NOT_MATCHES}'
+ value: ^6$
+ description: 'Ignore notPresent(6)'
+ -
+ macro: '{$NET.IF.IFTYPE.MATCHES}'
+ value: '.*'
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$NET.IF.IFTYPE.NOT_MATCHES}'
+ value: CHANGE_IF_NEEDED
+ description: 'This macro used in filters of network interfaces discovery rule.'
+ -
+ macro: '{$SNMP.TIMEOUT}'
+ value: 5m
+ description: 'The time interval for SNMP availability trigger.'
+ -
+ macro: '{$SWAP.PFREE.MIN.WARN}'
+ value: '50'
+ description: 'Threshold of free swap space for warning trigger in %.'
+ -
+ macro: '{$TEMPERATURE.MAX.CRIT}'
+ value: '65'
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$TEMPERATURE.MAX.WARN}'
+ value: '50'
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$VFS.DEV.DEVNAME.MATCHES}'
+ value: .+
+ description: 'This macro is used in block devices discovery. Can be overridden on the host or linked template level'
+ -
+ macro: '{$VFS.DEV.DEVNAME.NOT_MATCHES}'
+ value: '^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|cd[0-9]*|pass[0-9]*|zram[0-9]*)'
+ description: 'This macro is used in block devices discovery. Can be overridden on the host or linked template level'
+ -
+ macro: '{$ZPOOL.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$ZPOOL.FREE.MIN.WARN}'
+ value: 5G
+ description: 'This macro is used for trigger expression. It can be overridden on the host or linked on the template level.'
+ -
+ macro: '{$ZPOOL.PUSED.MAX.CRIT}'
+ value: '90'
+ description: 'Threshold of used pool space for average severity trigger in %.'
+ -
+ macro: '{$ZPOOL.PUSED.MAX.WARN}'
+ value: '80'
+ description: 'Threshold of used pool space for warning trigger in %.'
+ valuemaps:
+ -
+ uuid: 1ce70fc8edf2449ea6a0c687f359441a
+ name: 'FREENAS-MIB::ZPoolHealthType'
+ mappings:
+ -
+ value: '0'
+ newvalue: online
+ -
+ value: '1'
+ newvalue: degraded
+ -
+ value: '2'
+ newvalue: faulted
+ -
+ value: '3'
+ newvalue: offline
+ -
+ value: '4'
+ newvalue: unavail
+ -
+ value: '5'
+ newvalue: removed
+ -
+ uuid: 4f6e0ca65b9e49ddbf8888120a0e904c
+ name: 'IF-MIB::ifOperStatus'
+ mappings:
+ -
+ value: '1'
+ newvalue: up
+ -
+ value: '2'
+ newvalue: down
+ -
+ value: '3'
+ newvalue: testing
+ -
+ value: '4'
+ newvalue: unknown
+ -
+ value: '5'
+ newvalue: dormant
+ -
+ value: '6'
+ newvalue: notPresent
+ -
+ value: '7'
+ newvalue: lowerLayerDown
+ -
+ uuid: bc968f23f59943c3b7213b3dd937cf16
+ name: 'IF-MIB::ifType'
+ mappings:
+ -
+ value: '1'
+ newvalue: other
+ -
+ value: '2'
+ newvalue: regular1822
+ -
+ value: '3'
+ newvalue: hdh1822
+ -
+ value: '4'
+ newvalue: ddnX25
+ -
+ value: '5'
+ newvalue: rfc877x25
+ -
+ value: '6'
+ newvalue: ethernetCsmacd
+ -
+ value: '7'
+ newvalue: iso88023Csmacd
+ -
+ value: '8'
+ newvalue: iso88024TokenBus
+ -
+ value: '9'
+ newvalue: iso88025TokenRing
+ -
+ value: '10'
+ newvalue: iso88026Man
+ -
+ value: '11'
+ newvalue: starLan
+ -
+ value: '12'
+ newvalue: proteon10Mbit
+ -
+ value: '13'
+ newvalue: proteon80Mbit
+ -
+ value: '14'
+ newvalue: hyperchannel
+ -
+ value: '15'
+ newvalue: fddi
+ -
+ value: '16'
+ newvalue: lapb
+ -
+ value: '17'
+ newvalue: sdlc
+ -
+ value: '18'
+ newvalue: ds1
+ -
+ value: '19'
+ newvalue: e1
+ -
+ value: '20'
+ newvalue: basicISDN
+ -
+ value: '21'
+ newvalue: primaryISDN
+ -
+ value: '22'
+ newvalue: propPointToPointSerial
+ -
+ value: '23'
+ newvalue: ppp
+ -
+ value: '24'
+ newvalue: softwareLoopback
+ -
+ value: '25'
+ newvalue: eon
+ -
+ value: '26'
+ newvalue: ethernet3Mbit
+ -
+ value: '27'
+ newvalue: nsip
+ -
+ value: '28'
+ newvalue: slip
+ -
+ value: '29'
+ newvalue: ultra
+ -
+ value: '30'
+ newvalue: ds3
+ -
+ value: '31'
+ newvalue: sip
+ -
+ value: '32'
+ newvalue: frameRelay
+ -
+ value: '33'
+ newvalue: rs232
+ -
+ value: '34'
+ newvalue: para
+ -
+ value: '35'
+ newvalue: arcnet
+ -
+ value: '36'
+ newvalue: arcnetPlus
+ -
+ value: '37'
+ newvalue: atm
+ -
+ value: '38'
+ newvalue: miox25
+ -
+ value: '39'
+ newvalue: sonet
+ -
+ value: '40'
+ newvalue: x25ple
+ -
+ value: '41'
+ newvalue: iso88022llc
+ -
+ value: '42'
+ newvalue: localTalk
+ -
+ value: '43'
+ newvalue: smdsDxi
+ -
+ value: '44'
+ newvalue: frameRelayService
+ -
+ value: '45'
+ newvalue: v35
+ -
+ value: '46'
+ newvalue: hssi
+ -
+ value: '47'
+ newvalue: hippi
+ -
+ value: '48'
+ newvalue: modem
+ -
+ value: '49'
+ newvalue: aal5
+ -
+ value: '50'
+ newvalue: sonetPath
+ -
+ value: '51'
+ newvalue: sonetVT
+ -
+ value: '52'
+ newvalue: smdsIcip
+ -
+ value: '53'
+ newvalue: propVirtual
+ -
+ value: '54'
+ newvalue: propMultiplexor
+ -
+ value: '55'
+ newvalue: ieee80212
+ -
+ value: '56'
+ newvalue: fibreChannel
+ -
+ value: '57'
+ newvalue: hippiInterface
+ -
+ value: '58'
+ newvalue: frameRelayInterconnect
+ -
+ value: '59'
+ newvalue: aflane8023
+ -
+ value: '60'
+ newvalue: aflane8025
+ -
+ value: '61'
+ newvalue: cctEmul
+ -
+ value: '62'
+ newvalue: fastEther
+ -
+ value: '63'
+ newvalue: isdn
+ -
+ value: '64'
+ newvalue: v11
+ -
+ value: '65'
+ newvalue: v36
+ -
+ value: '66'
+ newvalue: g703at64k
+ -
+ value: '67'
+ newvalue: g703at2mb
+ -
+ value: '68'
+ newvalue: qllc
+ -
+ value: '69'
+ newvalue: fastEtherFX
+ -
+ value: '70'
+ newvalue: channel
+ -
+ value: '71'
+ newvalue: ieee80211
+ -
+ value: '72'
+ newvalue: ibm370parChan
+ -
+ value: '73'
+ newvalue: escon
+ -
+ value: '74'
+ newvalue: dlsw
+ -
+ value: '75'
+ newvalue: isdns
+ -
+ value: '76'
+ newvalue: isdnu
+ -
+ value: '77'
+ newvalue: lapd
+ -
+ value: '78'
+ newvalue: ipSwitch
+ -
+ value: '79'
+ newvalue: rsrb
+ -
+ value: '80'
+ newvalue: atmLogical
+ -
+ value: '81'
+ newvalue: ds0
+ -
+ value: '82'
+ newvalue: ds0Bundle
+ -
+ value: '83'
+ newvalue: bsc
+ -
+ value: '84'
+ newvalue: async
+ -
+ value: '85'
+ newvalue: cnr
+ -
+ value: '86'
+ newvalue: iso88025Dtr
+ -
+ value: '87'
+ newvalue: eplrs
+ -
+ value: '88'
+ newvalue: arap
+ -
+ value: '89'
+ newvalue: propCnls
+ -
+ value: '90'
+ newvalue: hostPad
+ -
+ value: '91'
+ newvalue: termPad
+ -
+ value: '92'
+ newvalue: frameRelayMPI
+ -
+ value: '93'
+ newvalue: x213
+ -
+ value: '94'
+ newvalue: adsl
+ -
+ value: '95'
+ newvalue: radsl
+ -
+ value: '96'
+ newvalue: sdsl
+ -
+ value: '97'
+ newvalue: vdsl
+ -
+ value: '98'
+ newvalue: iso88025CRFPInt
+ -
+ value: '99'
+ newvalue: myrinet
+ -
+ value: '100'
+ newvalue: voiceEM
+ -
+ value: '101'
+ newvalue: voiceFXO
+ -
+ value: '102'
+ newvalue: voiceFXS
+ -
+ value: '103'
+ newvalue: voiceEncap
+ -
+ value: '104'
+ newvalue: voiceOverIp
+ -
+ value: '105'
+ newvalue: atmDxi
+ -
+ value: '106'
+ newvalue: atmFuni
+ -
+ value: '107'
+ newvalue: atmIma
+ -
+ value: '108'
+ newvalue: pppMultilinkBundle
+ -
+ value: '109'
+ newvalue: ipOverCdlc
+ -
+ value: '110'
+ newvalue: ipOverClaw
+ -
+ value: '111'
+ newvalue: stackToStack
+ -
+ value: '112'
+ newvalue: virtualIpAddress
+ -
+ value: '113'
+ newvalue: mpc
+ -
+ value: '114'
+ newvalue: ipOverAtm
+ -
+ value: '115'
+ newvalue: iso88025Fiber
+ -
+ value: '116'
+ newvalue: tdlc
+ -
+ value: '117'
+ newvalue: gigabitEthernet
+ -
+ value: '118'
+ newvalue: hdlc
+ -
+ value: '119'
+ newvalue: lapf
+ -
+ value: '120'
+ newvalue: v37
+ -
+ value: '121'
+ newvalue: x25mlp
+ -
+ value: '122'
+ newvalue: x25huntGroup
+ -
+ value: '123'
+ newvalue: trasnpHdlc
+ -
+ value: '124'
+ newvalue: interleave
+ -
+ value: '125'
+ newvalue: fast
+ -
+ value: '126'
+ newvalue: ip
+ -
+ value: '127'
+ newvalue: docsCableMaclayer
+ -
+ value: '128'
+ newvalue: docsCableDownstream
+ -
+ value: '129'
+ newvalue: docsCableUpstream
+ -
+ value: '130'
+ newvalue: a12MppSwitch
+ -
+ value: '131'
+ newvalue: tunnel
+ -
+ value: '132'
+ newvalue: coffee
+ -
+ value: '133'
+ newvalue: ces
+ -
+ value: '134'
+ newvalue: atmSubInterface
+ -
+ value: '135'
+ newvalue: l2vlan
+ -
+ value: '136'
+ newvalue: l3ipvlan
+ -
+ value: '137'
+ newvalue: l3ipxvlan
+ -
+ value: '138'
+ newvalue: digitalPowerline
+ -
+ value: '139'
+ newvalue: mediaMailOverIp
+ -
+ value: '140'
+ newvalue: dtm
+ -
+ value: '141'
+ newvalue: dcn
+ -
+ value: '142'
+ newvalue: ipForward
+ -
+ value: '143'
+ newvalue: msdsl
+ -
+ value: '144'
+ newvalue: ieee1394
+ -
+ value: '145'
+ newvalue: if-gsn
+ -
+ value: '146'
+ newvalue: dvbRccMacLayer
+ -
+ value: '147'
+ newvalue: dvbRccDownstream
+ -
+ value: '148'
+ newvalue: dvbRccUpstream
+ -
+ value: '149'
+ newvalue: atmVirtual
+ -
+ value: '150'
+ newvalue: mplsTunnel
+ -
+ value: '151'
+ newvalue: srp
+ -
+ value: '152'
+ newvalue: voiceOverAtm
+ -
+ value: '153'
+ newvalue: voiceOverFrameRelay
+ -
+ value: '154'
+ newvalue: idsl
+ -
+ value: '155'
+ newvalue: compositeLink
+ -
+ value: '156'
+ newvalue: ss7SigLink
+ -
+ value: '157'
+ newvalue: propWirelessP2P
+ -
+ value: '158'
+ newvalue: frForward
+ -
+ value: '159'
+ newvalue: rfc1483
+ -
+ value: '160'
+ newvalue: usb
+ -
+ value: '161'
+ newvalue: ieee8023adLag
+ -
+ value: '162'
+ newvalue: bgppolicyaccounting
+ -
+ value: '163'
+ newvalue: frf16MfrBundle
+ -
+ value: '164'
+ newvalue: h323Gatekeeper
+ -
+ value: '165'
+ newvalue: h323Proxy
+ -
+ value: '166'
+ newvalue: mpls
+ -
+ value: '167'
+ newvalue: mfSigLink
+ -
+ value: '168'
+ newvalue: hdsl2
+ -
+ value: '169'
+ newvalue: shdsl
+ -
+ value: '170'
+ newvalue: ds1FDL
+ -
+ value: '171'
+ newvalue: pos
+ -
+ value: '172'
+ newvalue: dvbAsiIn
+ -
+ value: '173'
+ newvalue: dvbAsiOut
+ -
+ value: '174'
+ newvalue: plc
+ -
+ value: '175'
+ newvalue: nfas
+ -
+ value: '176'
+ newvalue: tr008
+ -
+ value: '177'
+ newvalue: gr303RDT
+ -
+ value: '178'
+ newvalue: gr303IDT
+ -
+ value: '179'
+ newvalue: isup
+ -
+ value: '180'
+ newvalue: propDocsWirelessMaclayer
+ -
+ value: '181'
+ newvalue: propDocsWirelessDownstream
+ -
+ value: '182'
+ newvalue: propDocsWirelessUpstream
+ -
+ value: '183'
+ newvalue: hiperlan2
+ -
+ value: '184'
+ newvalue: propBWAp2Mp
+ -
+ value: '185'
+ newvalue: sonetOverheadChannel
+ -
+ value: '186'
+ newvalue: digitalWrapperOverheadChannel
+ -
+ value: '187'
+ newvalue: aal2
+ -
+ value: '188'
+ newvalue: radioMAC
+ -
+ value: '189'
+ newvalue: atmRadio
+ -
+ value: '190'
+ newvalue: imt
+ -
+ value: '191'
+ newvalue: mvl
+ -
+ value: '192'
+ newvalue: reachDSL
+ -
+ value: '193'
+ newvalue: frDlciEndPt
+ -
+ value: '194'
+ newvalue: atmVciEndPt
+ -
+ value: '195'
+ newvalue: opticalChannel
+ -
+ value: '196'
+ newvalue: opticalTransport
+ -
+ value: '197'
+ newvalue: propAtm
+ -
+ value: '198'
+ newvalue: voiceOverCable
+ -
+ value: '199'
+ newvalue: infiniband
+ -
+ value: '200'
+ newvalue: teLink
+ -
+ value: '201'
+ newvalue: q2931
+ -
+ value: '202'
+ newvalue: virtualTg
+ -
+ value: '203'
+ newvalue: sipTg
+ -
+ value: '204'
+ newvalue: sipSig
+ -
+ value: '205'
+ newvalue: docsCableUpstreamChannel
+ -
+ value: '206'
+ newvalue: econet
+ -
+ value: '207'
+ newvalue: pon155
+ -
+ value: '208'
+ newvalue: pon622
+ -
+ value: '209'
+ newvalue: bridge
+ -
+ value: '210'
+ newvalue: linegroup
+ -
+ value: '211'
+ newvalue: voiceEMFGD
+ -
+ value: '212'
+ newvalue: voiceFGDEANA
+ -
+ value: '213'
+ newvalue: voiceDID
+ -
+ value: '214'
+ newvalue: mpegTransport
+ -
+ value: '215'
+ newvalue: sixToFour
+ -
+ value: '216'
+ newvalue: gtp
+ -
+ value: '217'
+ newvalue: pdnEtherLoop1
+ -
+ value: '218'
+ newvalue: pdnEtherLoop2
+ -
+ value: '219'
+ newvalue: opticalChannelGroup
+ -
+ value: '220'
+ newvalue: homepna
+ -
+ value: '221'
+ newvalue: gfp
+ -
+ value: '222'
+ newvalue: ciscoISLvlan
+ -
+ value: '223'
+ newvalue: actelisMetaLOOP
+ -
+ value: '224'
+ newvalue: fcipLink
+ -
+ value: '225'
+ newvalue: rpr
+ -
+ value: '226'
+ newvalue: qam
+ -
+ value: '227'
+ newvalue: lmp
+ -
+ value: '228'
+ newvalue: cblVectaStar
+ -
+ value: '229'
+ newvalue: docsCableMCmtsDownstream
+ -
+ value: '230'
+ newvalue: adsl2
+ -
+ value: '231'
+ newvalue: macSecControlledIF
+ -
+ value: '232'
+ newvalue: macSecUncontrolledIF
+ -
+ value: '233'
+ newvalue: aviciOpticalEther
+ -
+ value: '234'
+ newvalue: atmbond
+ -
+ value: '235'
+ newvalue: voiceFGDOS
+ -
+ value: '236'
+ newvalue: mocaVersion1
+ -
+ value: '237'
+ newvalue: ieee80216WMAN
+ -
+ value: '238'
+ newvalue: adsl2plus
+ -
+ value: '239'
+ newvalue: dvbRcsMacLayer
+ -
+ value: '240'
+ newvalue: dvbTdm
+ -
+ value: '241'
+ newvalue: dvbRcsTdma
+ -
+ value: '242'
+ newvalue: x86Laps
+ -
+ value: '243'
+ newvalue: wwanPP
+ -
+ value: '244'
+ newvalue: wwanPP2
+ -
+ value: '245'
+ newvalue: voiceEBS
+ -
+ value: '246'
+ newvalue: ifPwType
+ -
+ value: '247'
+ newvalue: ilan
+ -
+ value: '248'
+ newvalue: pip
+ -
+ value: '249'
+ newvalue: aluELP
+ -
+ value: '250'
+ newvalue: gpon
+ -
+ value: '251'
+ newvalue: vdsl2
+ -
+ value: '252'
+ newvalue: capwapDot11Profile
+ -
+ value: '253'
+ newvalue: capwapDot11Bss
+ -
+ value: '254'
+ newvalue: capwapWtpVirtualRadio
+ -
+ value: '255'
+ newvalue: bits
+ -
+ value: '256'
+ newvalue: docsCableUpstreamRfPort
+ -
+ value: '257'
+ newvalue: cableDownstreamRfPort
+ -
+ value: '258'
+ newvalue: vmwareVirtualNic
+ -
+ value: '259'
+ newvalue: ieee802154
+ -
+ value: '260'
+ newvalue: otnOdu
+ -
+ value: '261'
+ newvalue: otnOtu
+ -
+ value: '262'
+ newvalue: ifVfiType
+ -
+ value: '263'
+ newvalue: g9981
+ -
+ value: '264'
+ newvalue: g9982
+ -
+ value: '265'
+ newvalue: g9983
+ -
+ value: '266'
+ newvalue: aluEpon
+ -
+ value: '267'
+ newvalue: aluEponOnu
+ -
+ value: '268'
+ newvalue: aluEponPhysicalUni
+ -
+ value: '269'
+ newvalue: aluEponLogicalLink
+ -
+ value: '270'
+ newvalue: aluGponOnu
+ -
+ value: '271'
+ newvalue: aluGponPhysicalUni
+ -
+ value: '272'
+ newvalue: vmwareNicTeam
+ -
+ value: '277'
+ newvalue: docsOfdmDownstream
+ -
+ value: '278'
+ newvalue: docsOfdmaUpstream
+ -
+ value: '279'
+ newvalue: gfast
+ -
+ value: '280'
+ newvalue: sdci
+ -
+ value: '281'
+ newvalue: xboxWireless
+ -
+ value: '282'
+ newvalue: fastdsl
+ -
+ value: '283'
+ newvalue: docsCableScte55d1FwdOob
+ -
+ value: '284'
+ newvalue: docsCableScte55d1RetOob
+ -
+ value: '285'
+ newvalue: docsCableScte55d2DsOob
+ -
+ value: '286'
+ newvalue: docsCableScte55d2UsOob
+ -
+ value: '287'
+ newvalue: docsCableNdf
+ -
+ value: '288'
+ newvalue: docsCableNdr
+ -
+ value: '289'
+ newvalue: ptm
+ -
+ value: '290'
+ newvalue: ghn
+ -
+ uuid: dd1bf7f8b7b642d584528240a25df254
+ name: 'Service state'
+ mappings:
+ -
+ value: '0'
+ newvalue: Down
+ -
+ value: '1'
+ newvalue: Up
+ -
+ uuid: 6b810f3744284881b60277cc0d96dfa9
+ name: zabbix.host.available
+ mappings:
+ -
+ value: '0'
+ newvalue: 'not available'
+ -
+ value: '1'
+ newvalue: available
+ -
+ value: '2'
+ newvalue: unknown
+ triggers:
+ -
+ uuid: 6c1708d53693435c87cd27f1568345c1
+ expression: 'min(/TrueNAS SNMP/system.swap.pfree,5m)<{$SWAP.PFREE.MIN.WARN} and last(/TrueNAS SNMP/system.swap.total)>0'
+ name: 'TrueNAS: High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
+ opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
+ priority: WARNING
+ description: 'This trigger is ignored, if there is no swap configured.'
+ dependencies:
+ -
+ name: 'TrueNAS: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)'
+ expression: 'min(/TrueNAS SNMP/vm.memory.util,5m)>{$MEMORY.UTIL.MAX}'
+ -
+ name: 'TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})'
+ expression: 'min(/TrueNAS SNMP/vm.memory.available,5m)<{$MEMORY.AVAILABLE.MIN} and last(/TrueNAS SNMP/vm.memory.total)>0'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: 0a04cc4789a14f1090232fce196c0e4d
+ expression: 'min(/TrueNAS SNMP/vm.memory.available,5m)<{$MEMORY.AVAILABLE.MIN} and last(/TrueNAS SNMP/vm.memory.total)>0'
+ name: 'TrueNAS: Lack of available memory (<{$MEMORY.AVAILABLE.MIN} of {ITEM.VALUE2})'
+ opdata: 'Available: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
+ priority: AVERAGE
+ description: 'The system is running out of memory.'
+ tags:
+ -
+ tag: scope
+ value: capacity
+ -
+ tag: scope
+ value: performance
+ -
+ uuid: c923ea2cc04848de911ad9a41defaff6
+ expression: |
+ min(/TrueNAS SNMP/system.cpu.load.avg1,5m)/last(/TrueNAS SNMP/system.cpu.num)>{$LOAD_AVG_PER_CPU.MAX.WARN}
+ and last(/TrueNAS SNMP/system.cpu.load.avg5)>0
+ and last(/TrueNAS SNMP/system.cpu.load.avg15)>0
+ name: 'TrueNAS: Load average is too high (per CPU load over {$LOAD_AVG_PER_CPU.MAX.WARN} for 5m)'
+ opdata: 'Load averages(1m 5m 15m): ({ITEM.LASTVALUE1} {ITEM.LASTVALUE3} {ITEM.LASTVALUE4}), # of CPUs: {ITEM.LASTVALUE2}'
+ priority: AVERAGE
+ description: 'Per CPU load average is too high. Your system may be slow to respond.'
+ tags:
+ -
+ tag: scope
+ value: performance
+ graphs:
+ -
+ uuid: 621f703356cb4522bef8f1c89732c9cb
+ name: 'TrueNAS: ARC hit ratio'
+ type: STACKED
+ ymin_type_1: FIXED
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: truenas.zfs.arc.hit.ratio
+ -
+ sortorder: '1'
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: truenas.zfs.arc.miss.ratio
+ -
+ uuid: 977c98430b1241988206b56b3fc40091
+ name: 'TrueNAS: CPU jumps'
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.switches
+ -
+ sortorder: '1'
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.intr
+ -
+ uuid: 5c95f63eaaf049cab4884b2785c5d382
+ name: 'TrueNAS: Memory usage'
+ ymin_type_1: FIXED
+ graph_items:
+ -
+ drawtype: BOLD_LINE
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: vm.memory.total
+ -
+ sortorder: '1'
+ drawtype: GRADIENT_LINE
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: vm.memory.available
+ -
+ uuid: a36f52864942457894638adef660a775
+ name: 'TrueNAS: Memory utilization'
+ ymin_type_1: FIXED
+ ymax_type_1: FIXED
+ graph_items:
+ -
+ drawtype: GRADIENT_LINE
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: vm.memory.util
+ -
+ uuid: bd67954025d145c8a0eb2f21d53a52f5
+ name: 'TrueNAS: Swap usage'
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.swap.free
+ -
+ sortorder: '1'
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.swap.total
+ -
+ uuid: f7a0b78f1f814e2b94cec941168eafaa
+ name: 'TrueNAS: System load'
+ ymin_type_1: FIXED
+ graph_items:
+ -
+ color: 1A7C11
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.load.avg1
+ -
+ sortorder: '1'
+ color: 2774A4
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.load.avg5
+ -
+ sortorder: '2'
+ color: F63100
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.load.avg15
+ -
+ sortorder: '3'
+ color: A54F10
+ yaxisside: RIGHT
+ item:
+ host: 'TrueNAS SNMP'
+ key: system.cpu.num
diff --git a/templates/media/glpi/README.md b/templates/media/glpi/README.md
new file mode 100644
index 00000000000..f450fb99f0b
--- /dev/null
+++ b/templates/media/glpi/README.md
@@ -0,0 +1,67 @@
+
+# GLPi webhook
+
+## About webhook
+
+This webhook creates problems in GLPi Assistance section. Created problems have the next severity mapping:
+
+|Severity In zabbix|Urgency in GLPi|
+|-|-|
+0 - Not classified| Medium (default)|
+1 - Information| Very low|
+2 - Warning| Low|
+3 - Average| Medium|
+4 - High| High|
+5 - Disaster| Very High|
+
+On Update action in zabbix, webhook updates created problem's title, severity and creates followup with update comment.
+
+On resolve action, webhook updates created problem title and creates followup with resolve information.
+
+Created problems have "New" status, and resolved - "Solved" status.
+
+Due to the specifics of the webhook, the number of retries is set to 1 by default. We recommend that you do not change this setting, because in case of a transaction error, additional duplicate objects (problems, followups) may be created during the retry.
+
+## Installation guide
+
+This guide describes how to integrate your Zabbix installation with GLPi problems using the Zabbix webhook feature. This guide provides instructions on setting up a media type, a user and an action in Zabbix.
+<br/><br/>
+## In GLPi
+
+1\. Create or use existing user in GLPi with permission to create problems and followups.
+[![](images/1.thumb.png?raw=true)](images/1.png)
+[![](images/2.thumb.png?raw=true)](images/2.png)
+
+2\. Please create an **API token**. For that you should go into user profile and set tick in "Regenerate" field against "API token" and hit save.
+[![](images/3.thumb.png?raw=true)](images/3.png)
+
+
+3\. Copy the **API token** of your new integration to use it in Zabbix.
+<br/><br/>
+## In Zabbix
+
+The configuration consists of a _media type_ in Zabbix, which will invoke the webhook to send alerts to GLPi problems through the GLPi Rest API.
+
+
+1\. [Import](https://www.zabbix.com/documentation/6.0/manual/web_interface/frontend_sections/administration/mediatypes) the GLPi media type from file [media_glpi.yaml](media_glpi.yaml).
+
+2\. Change in the imported media the values of the variable *glpi_token* and *glpi_url*.
+
+
+For more information about the Zabbix Webhook configuration, please see the [documentation](https://www.zabbix.com/documentation/6.0/manual/config/notifications/media/webhook).
+
+3\. Create a **Zabbix user** and add **Media** with the **GLPi** media type.
+Though a "Send to" field is not used in GLPi webhook, it cannot be empty. To comply with frontend requirements, you can put any symbol there.
+Make sure this user has access to all hosts for which you would like problem notifications to be converted into GLPi problems.
+
+4\. Set up a global macro {$ZABBIX.URL} with URL of current zabbix. Please notice that HTTPS will be used by default if HTTP/HTTPS schema is not present in the URL.
+
+For more information, please see [Zabbix](https://www.zabbix.com/documentation/6.0/manual/config/notifications) and [GLPi](https://glpi-project.org/DOC/EN/) documentation.
+<br/><br/>
+
+## Tested on
+GLPI 9.5.7
+<br/><br/>
+## Supported Versions
+
+Zabbix 6.0
diff --git a/templates/media/glpi/images/1.png b/templates/media/glpi/images/1.png
new file mode 100644
index 00000000000..608a8295e3b
--- /dev/null
+++ b/templates/media/glpi/images/1.png
Binary files differ
diff --git a/templates/media/glpi/images/1.thumb.png b/templates/media/glpi/images/1.thumb.png
new file mode 100644
index 00000000000..886b48a7a8c
--- /dev/null
+++ b/templates/media/glpi/images/1.thumb.png
Binary files differ
diff --git a/templates/media/glpi/images/2.png b/templates/media/glpi/images/2.png
new file mode 100644
index 00000000000..7f0371e40d3
--- /dev/null
+++ b/templates/media/glpi/images/2.png
Binary files differ
diff --git a/templates/media/glpi/images/2.thumb.png b/templates/media/glpi/images/2.thumb.png
new file mode 100644
index 00000000000..b8cf38d3d88
--- /dev/null
+++ b/templates/media/glpi/images/2.thumb.png
Binary files differ
diff --git a/templates/media/glpi/images/3.png b/templates/media/glpi/images/3.png
new file mode 100644
index 00000000000..f0375146973
--- /dev/null
+++ b/templates/media/glpi/images/3.png
Binary files differ
diff --git a/templates/media/glpi/images/3.thumb.png b/templates/media/glpi/images/3.thumb.png
new file mode 100644
index 00000000000..95d96a9838a
--- /dev/null
+++ b/templates/media/glpi/images/3.thumb.png
Binary files differ
diff --git a/templates/media/glpi/media_glpi.yaml b/templates/media/glpi/media_glpi.yaml
new file mode 100644
index 00000000000..b96ecbaefb9
--- /dev/null
+++ b/templates/media/glpi/media_glpi.yaml
@@ -0,0 +1,375 @@
+zabbix_export:
+ version: '6.0'
+ date: '2022-03-24T18:54:55Z'
+ media_types:
+ -
+ name: GLPi
+ type: WEBHOOK
+ parameters:
+ -
+ name: alert_message
+ value: '{ALERT.MESSAGE}'
+ -
+ name: alert_subject
+ value: '{ALERT.SUBJECT}'
+ -
+ name: event_id
+ value: '{EVENT.ID}'
+ -
+ name: event_nseverity
+ value: '{EVENT.NSEVERITY}'
+ -
+ name: event_recovery_value
+ value: '{EVENT.RECOVERY.VALUE}'
+ -
+ name: event_source
+ value: '{EVENT.SOURCE}'
+ -
+ name: event_update_status
+ value: '{EVENT.UPDATE.STATUS}'
+ -
+ name: event_value
+ value: '{EVENT.VALUE}'
+ -
+ name: glpi_problem_id
+ value: '{EVENT.TAGS.__zbx_glpi_problem_id}'
+ -
+ name: glpi_token
+ value: '<PLACE GLPI TOKEN>'
+ -
+ name: glpi_url
+ value: '<PLACE GLPI URL>'
+ -
+ name: trigger_id
+ value: '{TRIGGER.ID}'
+ -
+ name: zabbix_url
+ value: '{$ZABBIX.URL}'
+ attempts: '1'
+ script: |
+ var GLPi = {
+ params: {},
+
+ setParams: function (params) {
+ if (typeof params !== 'object') {
+ return;
+ }
+ GLPi.params = params;
+ },
+
+ setProxy: function (HTTPProxy) {
+ GLPi.HTTPProxy = HTTPProxy;
+ },
+
+ urlCheckFormat: function (url) {
+ if (typeof url === 'string' && !url.endsWith('/')) {
+ url += '/';
+ }
+
+ if (url.indexOf('http://') === -1 && url.indexOf('https://') === -1) {
+ url = 'https://' + url;
+ }
+
+ return url;
+ },
+
+ getAuthToken: function (url, token) {
+ var response,
+ request = new HttpRequest();
+
+ request.addHeader('Content-Type: application/json');
+ request.addHeader('Authorization: user_token ' + token);
+
+ response = request.get(url + "apirest.php/initSession");
+
+ if (response !== null) {
+ try {
+ response = JSON.parse(response);
+ }
+ catch (error) {
+ Zabbix.log(4, '[ GLPi Webhook ] Failed to receive authentication token from GLPi.');
+ response = null;
+ }
+ }
+
+ if (Array.isArray(response)) {
+ if (response[1]) {
+ throw 'Error received from GLPi: ' + response[1];
+ } else {
+ throw 'Failed to receive authentication token from GLPi.';
+ }
+ }
+
+ if (typeof response !== 'object' || !response.session_token) {
+ throw 'Failed to process response received from getting GLPi authentication token. Check debug log for more information.';
+ }
+
+ return response.session_token;
+ },
+
+ getProblemUrl: function (zabbix_url, triggerid, eventid, event_source) {
+ var problem_url = zabbix_url;
+
+ if (event_source === '0') {
+ problem_url += 'tr_events.php?triggerid=' + triggerid + '&eventid=' + eventid;
+ }
+
+ return problem_url;
+ },
+
+ request: function (method, url, data) {
+ if (typeof GLPi.params !== 'object' || typeof GLPi.params.authToken === 'undefined' || GLPi.params.authToken === '') {
+ throw 'Required GLPi param authToken is not set.';
+ }
+
+ var response,
+ request = new HttpRequest();
+
+ request.addHeader('Content-Type: application/json');
+ request.addHeader('Session-Token:' + GLPi.params.authToken);
+
+ if (typeof GLPi.HTTPProxy !== 'undefined' && GLPi.HTTPProxy !== '') {
+ request.setProxy(GLPi.HTTPProxy);
+ }
+
+ if (typeof data !== 'undefined') {
+ data = JSON.stringify(data);
+ }
+
+ Zabbix.log(4, '[ GLPi Webhook ] Sending request: ' + url + ((typeof data === 'string')
+ ? ('\n' + data)
+ : ''));
+
+ switch (method) {
+ case 'post':
+ response = request.post(url, data);
+ break;
+
+ case 'put':
+ response = request.put(url, data);
+ break;
+
+ default:
+ throw 'Unsupported HTTP request method: ' + method;
+ }
+
+ Zabbix.log(4, '[ GLPi Webhook ] Received response with status code ' +
+ request.getStatus() + '\n' + response);
+
+ if (response !== null) {
+ try {
+ response = JSON.parse(response);
+ }
+ catch (error) {
+ Zabbix.log(4, '[ GLPi Webhook ] Failed to parse response received from GLPi');
+ response = null;
+ }
+ }
+
+ if (typeof response !== 'object' || typeof response === 'undefined' || response === null) {
+ throw 'Failed to process response received from GLPi. Check debug log for more information.';
+ }
+
+ if (request.getStatus() < 200 || request.getStatus() >= 300) {
+ var message = 'Request failed with status code ' + request.getStatus();
+
+ if (response.message) {
+ message += ': ' + response.message;
+ }
+
+ throw message + ' Check debug log for more information.';
+ }
+
+ return response;
+ }
+ };
+
+ try {
+ var params = JSON.parse(value),
+ glpi = {},
+ url = '',
+ data = {},
+ comment_data,
+ result = { tags: {} },
+ required_params = [
+ 'alert_subject', 'alert_message', 'event_source', 'event_value',
+ 'event_update_status', 'event_recovery_value',
+ 'event_id', 'trigger_id', 'zabbix_url',
+ 'glpi_token', 'glpi_url'
+ ],
+ method = 'post',
+ process_tags = true,
+ response;
+
+ Object.keys(params)
+ .forEach(function (key) {
+ if (key.startsWith('glpi_')) {
+ glpi[key.substring(5)] = params[key];
+ }
+ else if (required_params.indexOf(key) !== -1 && params[key] === '') {
+ throw 'Parameter "' + key + '" can\'t be empty.';
+ }
+ });
+
+ if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
+ throw 'Incorrect "event_source" parameter given: ' + params.event_source + '\nMust be 0-3.';
+ }
+
+ // Check {EVENT.VALUE} for trigger-based and internal events.
+ if (params.event_value !== '0' && params.event_value !== '1'
+ && (params.event_source === '0' || params.event_source === '3')) {
+ throw 'Incorrect "event_value" parameter given: ' + params.event_value + '\nMust be 0 or 1.';
+ }
+
+ // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
+ if (params.event_update_status !== '0' && params.event_update_status !== '1' && params.event_source === '0') {
+ throw 'Incorrect "event_update_status" parameter given: ' + params.event_update_status + '\nMust be 0 or 1.';
+ }
+
+ if (params.event_source !== '0' && params.event_recovery_value === '0') {
+ throw 'Recovery operations are supported only for trigger-based actions.';
+ }
+
+ if (typeof params.zabbix_url !== 'string' || params.zabbix_url.trim() === '' || params.zabbix_url === '{$ZABBIX.URL}') {
+ throw 'Field "zabbix_url" cannot be empty.';
+ }
+
+ // Check for backslash in the end of url and schema.
+ glpi.url = GLPi.urlCheckFormat(glpi.url);
+ params.zabbix_url = GLPi.urlCheckFormat(params.zabbix_url);
+
+ glpi.authToken = GLPi.getAuthToken(glpi.url, glpi.token);
+ GLPi.setParams(glpi);
+
+ data = {
+ 'input': {
+ 'name': params.alert_subject,
+ 'content': params.alert_message + '\n<a href=' + GLPi.getProblemUrl(params.zabbix_url, params.trigger_id, params.event_id, params.event_source) + '>Link to problem in Zabbix</a>',
+ 'status': 1, // Set status "New"
+ 'urgency': params.event_nseverity
+ }
+ };
+
+ // In case of resolve
+ if (params.event_source === '0' && params.event_value === '0') {
+ process_tags = false;
+ dataFollowup = {
+ 'input': {
+ 'items_id': glpi.problem_id,
+ 'itemtype': 'Problem',
+ 'content': params.alert_message + '\n<a href=' + GLPi.getProblemUrl(params.zabbix_url, params.trigger_id, params.event_id, params.event_source) + '>Link to problem in Zabbix</a>'
+ }
+ };
+ dataProblem = {
+ 'id': glpi.problem_id,
+ 'input': {
+ 'name': params.alert_subject,
+ 'status': 5, // Set status "Solved"
+ 'urgency': params.event_nseverity
+ }
+ };
+
+ GLPi.request('put', glpi.url + 'apirest.php/Problem/' + glpi.problem_id, dataProblem);
+ GLPi.request('post', glpi.url + 'apirest.php/Problem/' + glpi.problem_id + '/ITILFollowup', dataFollowup);
+ }
+
+ // In case of update
+ else if (params.event_source === '0' && params.event_update_status === '1') {
+ process_tags = false;
+ dataFollowup = {
+ 'input': {
+ 'items_id': glpi.problem_id,
+ 'itemtype': 'Problem',
+ 'content': params.alert_message + '\n<a href=' + GLPi.getProblemUrl(params.zabbix_url, params.trigger_id, params.event_id, params.event_source) + '>Link to problem in Zabbix</a>'
+ }
+ };
+ dataProblem = {
+ 'id': glpi.problem_id,
+ 'input': {
+ 'name': params.alert_subject,
+ 'urgency': params.event_nseverity
+ }
+ };
+
+ GLPi.request('put', glpi.url + 'apirest.php/Problem/' + glpi.problem_id, dataProblem);
+ GLPi.request('post', glpi.url + 'apirest.php/Problem/' + glpi.problem_id + '/ITILFollowup', dataFollowup);
+ }
+
+ // In case of problem
+ else {
+ response = GLPi.request('post', glpi.url + 'apirest.php/Problem/', data);
+ }
+
+ if (process_tags) {
+ result.tags.__zbx_glpi_problem_id = response.id;
+ result.tags.__zbx_glpi_link = glpi.url + 'front/problem.form.php?id=' + response.id;
+ }
+
+ Zabbix.log(4, '[ GLPi Webhook ] Result: ' + JSON.stringify(result));
+ return JSON.stringify(result);
+ }
+ catch (error) {
+ Zabbix.log(4, '[ GLPi Webhook ] ERROR: ' + error);
+ throw 'Sending failed: ' + error;
+ }
+ process_tags: 'YES'
+ show_event_menu: 'YES'
+ event_menu_url: '{EVENT.TAGS.__zbx_glpi_link}'
+ event_menu_name: 'GLPi: Problem {EVENT.TAGS.__zbx_glpi_problem_id}'
+ message_templates:
+ -
+ event_source: TRIGGERS
+ operation_mode: PROBLEM
+ subject: '[{EVENT.STATUS}] {EVENT.NAME}'
+ message: |
+ Problem started at {EVENT.TIME} on {EVENT.DATE}
+ Problem name: {EVENT.NAME}
+ Host: {HOST.NAME}
+ Severity: {EVENT.SEVERITY}
+ Operational data: {EVENT.OPDATA}
+ Original problem ID: {EVENT.ID}
+ {TRIGGER.URL}
+ -
+ event_source: TRIGGERS
+ operation_mode: RECOVERY
+ subject: '[{EVENT.STATUS}] {EVENT.NAME}'
+ message: |
+ Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
+ Problem name: {EVENT.NAME}
+ Host: {HOST.NAME}
+ Severity: {EVENT.SEVERITY}
+ Original problem ID: {EVENT.ID}
+ {TRIGGER.URL}
+ -
+ event_source: TRIGGERS
+ operation_mode: UPDATE
+ subject: '[{EVENT.STATUS}] {EVENT.NAME}'
+ message: |
+ {USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
+ {EVENT.UPDATE.MESSAGE}
+
+ Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.
+ -
+ event_source: DISCOVERY
+ operation_mode: PROBLEM
+ subject: 'Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}'
+ message: |
+ Discovery rule: {DISCOVERY.RULE.NAME}
+
+ Device IP: {DISCOVERY.DEVICE.IPADDRESS}
+ Device DNS: {DISCOVERY.DEVICE.DNS}
+ Device status: {DISCOVERY.DEVICE.STATUS}
+ Device uptime: {DISCOVERY.DEVICE.UPTIME}
+
+ Device service name: {DISCOVERY.SERVICE.NAME}
+ Device service port: {DISCOVERY.SERVICE.PORT}
+ Device service status: {DISCOVERY.SERVICE.STATUS}
+ Device service uptime: {DISCOVERY.SERVICE.UPTIME}
+ -
+ event_source: AUTOREGISTRATION
+ operation_mode: PROBLEM
+ subject: 'Autoregistration: {HOST.HOST}'
+ message: |
+ Host name: {HOST.HOST}
+ Host IP: {HOST.IP}
+ Agent port: {HOST.PORT}
diff --git a/templates/module/host_resources_snmp/README.md b/templates/module/host_resources_snmp/README.md
index d940b42f58e..1c4ccf15b5c 100644
--- a/templates/module/host_resources_snmp/README.md
+++ b/templates/module/host_resources_snmp/README.md
@@ -17,6 +17,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -93,7 +95,7 @@ There are no template links in this template.
|-----|----|-----------|----|---------------------|
|Memory |{#MEMNAME}: Used memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vm.memory.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Memory |{#MEMNAME}: Total memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.</p> |SNMP |vm.memory.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
-|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
+|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
## Triggers
@@ -172,6 +174,8 @@ No specific Zabbix configuration is required.
|{$MEMORY.TYPE.MATCHES} |<p>This macro is used in memory discovery. Can be overridden on the host or linked template level.</p> |`.*(\.2|hrStorageRam)$` |
|{$MEMORY.TYPE.NOT_MATCHES} |<p>This macro is used in memory discovery. Can be overridden on the host or linked template level if you need to filter out results.</p> |`CHANGE_IF_NEEDED` |
|{$MEMORY.UTIL.MAX} |<p>The warning threshold of the "Physical memory: Memory utilization" item.</p> |`90` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -197,7 +201,7 @@ There are no template links in this template.
|CPU |CPU utilization |<p>MIB: HOST-RESOURCES-MIB</p><p>The average, over the last minute, of the percentage of time that processors was not idle.</p><p>Implementations may approximate this one minute smoothing period if necessary.</p> |SNMP |system.cpu.util<p>**Preprocessing**:</p><p>- JSONPATH: `$..['{#CPU.UTIL}'].avg()`</p> |
|Memory |{#MEMNAME}: Used memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vm.memory.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Memory |{#MEMNAME}: Total memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.</p> |SNMP |vm.memory.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
-|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
+|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
|Storage |{#FSNAME}: Used space |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Storage |{#FSNAME}: Total space |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main storage allocated to a buffer pool might be modified or the amount of disk space allocated to virtual storage might be modified.</p> |SNMP |vfs.fs.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Storage |{#FSNAME}: Space utilization |<p>Space utilization in % for {#FSNAME}</p> |CALCULATED |vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`(last(//vfs.fs.used[hrStorageUsed.{#SNMPINDEX}])/last(//vfs.fs.total[hrStorageSize.{#SNMPINDEX}]))*100` |
diff --git a/templates/module/host_resources_snmp/template_module_host_resources_snmp.yaml b/templates/module/host_resources_snmp/template_module_host_resources_snmp.yaml
index 193cbf289bd..7be847712c0 100644
--- a/templates/module/host_resources_snmp/template_module_host_resources_snmp.yaml
+++ b/templates/module/host_resources_snmp/template_module_host_resources_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:33:52Z'
+ date: '2022-04-11T11:25:13Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -154,7 +154,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -359,7 +359,7 @@ zabbix_export:
uuid: 8283f8b8663f444aad85633010615c15
expression: |
last(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -367,7 +367,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -381,7 +381,7 @@ zabbix_export:
uuid: 2d9c475d718b4c2ba14b129f66014f75
expression: |
last(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -389,7 +389,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -397,7 +397,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -509,7 +509,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -567,6 +567,14 @@ zabbix_export:
value: '90'
description: 'The warning threshold of the "Physical memory: Memory utilization" item.'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
@@ -771,7 +779,7 @@ zabbix_export:
uuid: 9fbb4a0ceeba4c9e935f54610d5f1afb
expression: |
last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -779,7 +787,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -793,7 +801,7 @@ zabbix_export:
uuid: 5db5f43d1c3b4b1f91bef16ec1090945
expression: |
last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -801,7 +809,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -809,7 +817,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/HOST-RESOURCES-MIB storage SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -842,6 +850,14 @@ zabbix_export:
key: 'vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
diff --git a/templates/module/linux/README.md b/templates/module/linux/README.md
index 9159dd2bdfc..76072f49192 100644
--- a/templates/module/linux/README.md
+++ b/templates/module/linux/README.md
@@ -35,7 +35,7 @@ There are no template links in this template.
|CPU |Load average (1m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg1] |
|CPU |Load average (5m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg5] |
|CPU |Load average (15m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg15] |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
|CPU |CPU idle time |<p>The time the CPU has spent doing nothing.</p> |ZABBIX_PASSIVE |system.cpu.util[,idle] |
|CPU |CPU system time |<p>The time the CPU has spent running the kernel and its processes.</p> |ZABBIX_PASSIVE |system.cpu.util[,system] |
|CPU |CPU user time |<p>The time the CPU has spent running users' processes that are not niced.</p> |ZABBIX_PASSIVE |system.cpu.util[,user] |
@@ -44,8 +44,8 @@ There are no template links in this template.
|CPU |CPU steal time |<p>The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).</p> |ZABBIX_PASSIVE |system.cpu.util[,steal] |
|CPU |CPU interrupt time |<p>The amount of time the CPU has been servicing hardware interrupts.</p> |ZABBIX_PASSIVE |system.cpu.util[,interrupt] |
|CPU |CPU softirq time |<p>The amount of time the CPU has been servicing software interrupts.</p> |ZABBIX_PASSIVE |system.cpu.util[,softirq] |
-|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |ZABBIX_PASSIVE |system.cpu.util[,guest] |
-|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |ZABBIX_PASSIVE |system.cpu.util[,guest_nice] |
+|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |ZABBIX_PASSIVE |system.cpu.util[,guest] |
+|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |ZABBIX_PASSIVE |system.cpu.util[,guest_nice] |
|CPU |Context switches per second |<p>-</p> |ZABBIX_PASSIVE |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|CPU |Interrupts per second |<p>-</p> |ZABBIX_PASSIVE |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
@@ -78,6 +78,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$` |
@@ -154,7 +156,7 @@ There are no template links in this template.
|-----|----|-----------|----|---------------------|
|Memory |Memory utilization |<p>Memory used percentage is calculated as (100-pavailable)</p> |DEPENDENT |vm.memory.utilization<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100-value);`</p> |
|Memory |Available memory in % |<p>Available memory as percentage of total. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_PASSIVE |vm.memory.size[pavailable] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
|Memory |Available memory |<p>Available memory, in Linux, available = free + buffers + cache. On other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_PASSIVE |vm.memory.size[available] |
|Memory |Total swap space |<p>The total space of swap volume/file in bytes.</p> |ZABBIX_PASSIVE |system.swap.size[,total] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |ZABBIX_PASSIVE |system.swap.size[,free] |
diff --git a/templates/module/linux/template_module_linux.yaml b/templates/module/linux/template_module_linux.yaml
index 90ef86284a1..8e6c4b29c7c 100644
--- a/templates/module/linux/template_module_linux.yaml
+++ b/templates/module/linux/template_module_linux.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:33:58Z'
+ date: '2022-04-10T20:20:08Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -446,7 +446,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -487,7 +487,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Guest time (time spent running a virtual CPU for a guest operating system)'
+ description: 'Guest time (time spent running a virtual CPU for a guest operating system).'
tags:
-
tag: component
@@ -499,7 +499,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)'
+ description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).'
tags:
-
tag: component
@@ -746,7 +746,7 @@ zabbix_export:
uuid: fb410c10bd59476dbe58e1ee179cd25f
expression: |
last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -754,7 +754,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -768,7 +768,7 @@ zabbix_export:
uuid: d66583735eb04973ac30d923533c4b0f
expression: |
last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -776,7 +776,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -784,7 +784,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -817,6 +817,14 @@ zabbix_export:
key: 'vfs.fs.size[{#FSNAME},used]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -1256,7 +1264,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -1994,7 +2002,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/module/linux_active/README.md b/templates/module/linux_active/README.md
index 822c264f45a..8da0a160237 100644
--- a/templates/module/linux_active/README.md
+++ b/templates/module/linux_active/README.md
@@ -35,7 +35,7 @@ There are no template links in this template.
|CPU |Load average (1m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg1] |
|CPU |Load average (5m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg5] |
|CPU |Load average (15m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg15] |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
|CPU |CPU idle time |<p>The time the CPU has spent doing nothing.</p> |ZABBIX_ACTIVE |system.cpu.util[,idle] |
|CPU |CPU system time |<p>The time the CPU has spent running the kernel and its processes.</p> |ZABBIX_ACTIVE |system.cpu.util[,system] |
|CPU |CPU user time |<p>The time the CPU has spent running users' processes that are not niced.</p> |ZABBIX_ACTIVE |system.cpu.util[,user] |
@@ -44,8 +44,8 @@ There are no template links in this template.
|CPU |CPU steal time |<p>The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).</p> |ZABBIX_ACTIVE |system.cpu.util[,steal] |
|CPU |CPU interrupt time |<p>The amount of time the CPU has been servicing hardware interrupts.</p> |ZABBIX_ACTIVE |system.cpu.util[,interrupt] |
|CPU |CPU softirq time |<p>The amount of time the CPU has been servicing software interrupts.</p> |ZABBIX_ACTIVE |system.cpu.util[,softirq] |
-|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |ZABBIX_ACTIVE |system.cpu.util[,guest] |
-|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |ZABBIX_ACTIVE |system.cpu.util[,guest_nice] |
+|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |ZABBIX_ACTIVE |system.cpu.util[,guest] |
+|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |ZABBIX_ACTIVE |system.cpu.util[,guest_nice] |
|CPU |Context switches per second |<p>-</p> |ZABBIX_ACTIVE |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|CPU |Interrupts per second |<p>-</p> |ZABBIX_ACTIVE |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
@@ -78,6 +78,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$` |
@@ -154,7 +156,7 @@ There are no template links in this template.
|-----|----|-----------|----|---------------------|
|Memory |Memory utilization |<p>Memory used percentage is calculated as (100-pavailable)</p> |DEPENDENT |vm.memory.utilization<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100-value);`</p> |
|Memory |Available memory in % |<p>Available memory as percentage of total. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_ACTIVE |vm.memory.size[pavailable] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
|Memory |Available memory |<p>Available memory, in Linux, available = free + buffers + cache. On other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_ACTIVE |vm.memory.size[available] |
|Memory |Total swap space |<p>The total space of swap volume/file in bytes.</p> |ZABBIX_ACTIVE |system.swap.size[,total] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |ZABBIX_ACTIVE |system.swap.size[,free] |
diff --git a/templates/module/linux_active/template_module_linux_active.yaml b/templates/module/linux_active/template_module_linux_active.yaml
index 7e5def3c7fd..55bce27849a 100644
--- a/templates/module/linux_active/template_module_linux_active.yaml
+++ b/templates/module/linux_active/template_module_linux_active.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:33:59Z'
+ date: '2022-04-10T20:19:55Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -454,7 +454,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -496,7 +496,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Guest time (time spent running a virtual CPU for a guest operating system)'
+ description: 'Guest time (time spent running a virtual CPU for a guest operating system).'
tags:
-
tag: component
@@ -509,7 +509,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)'
+ description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).'
tags:
-
tag: component
@@ -769,7 +769,7 @@ zabbix_export:
uuid: 6f3a431ce1774d7e9cec073197f088ca
expression: |
last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -777,7 +777,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -791,7 +791,7 @@ zabbix_export:
uuid: fd163fa0d1b0419797957d80222218bd
expression: |
last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -799,7 +799,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -807,7 +807,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -840,6 +840,14 @@ zabbix_export:
key: 'vfs.fs.size[{#FSNAME},used]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -1299,7 +1307,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -2048,7 +2056,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/module/linux_snmp_snmp/README.md b/templates/module/linux_snmp_snmp/README.md
index 36774cecd02..e7bd8e1c210 100644
--- a/templates/module/linux_snmp_snmp/README.md
+++ b/templates/module/linux_snmp_snmp/README.md
@@ -34,9 +34,9 @@ There are no template links in this template.
|-----|----|-----------|----|---------------------|
|Memory |Memory utilization |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.util[snmp]<p>**Expression**:</p>`(last(//vm.memory.total[memTotalReal.0])-(last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])))/last(//vm.memory.total[memTotalReal.0])*100` |
|Memory |Free memory |<p>MIB: UCD-SNMP-MIB</p> |SNMP |vm.memory.free[memAvailReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by kernel buffers (Buffers in /proc/meminfo)</p> |SNMP |vm.memory.buffers[memBuffer.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)</p> |SNMP |vm.memory.cached[memCached.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes</p> |SNMP |vm.memory.total[memTotalReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by kernel buffers (Buffers in /proc/meminfo).</p> |SNMP |vm.memory.buffers[memBuffer.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo).</p> |SNMP |vm.memory.cached[memCached.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes.</p> |SNMP |vm.memory.total[memTotalReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |Available memory |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.available[snmp]<p>**Expression**:</p>`last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])` |
|Memory |Total swap space |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of swap space configured for this host.</p> |SNMP |system.swap.total[memTotalSwap.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |Free swap space |<p>MIB: UCD-SNMP-MIB</p><p>The amount of swap space currently unused or available.</p> |SNMP |system.swap.free[memAvailSwap.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
@@ -155,9 +155,9 @@ There are no template links in this template.
|CPU |CPU nice time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that have been niced.</p> |SNMP |system.cpu.nice[ssCpuRawNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |CPU iowait time |<p>MIB: UCD-SNMP-MIB</p><p>Amount of time the CPU has been waiting for I/O to complete.</p> |SNMP |system.cpu.iowait[ssCpuRawWait.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |CPU interrupt time |<p>MIB: UCD-SNMP-MIB</p><p>The amount of time the CPU has been servicing hardware interrupts.</p> |SNMP |system.cpu.interrupt[ssCpuRawInterrupt.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU guest time |<p>MIB: UCD-SNMP-MIB</p><p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |SNMP |system.cpu.guest[ssCpuRawGuest.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU guest nice time |<p>MIB: UCD-SNMP-MIB</p><p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |SNMP |system.cpu.guest_nice[ssCpuRawGuestNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util[snmp,{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
+|CPU |CPU guest time |<p>MIB: UCD-SNMP-MIB</p><p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |SNMP |system.cpu.guest[ssCpuRawGuest.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |CPU guest nice time |<p>MIB: UCD-SNMP-MIB</p><p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |SNMP |system.cpu.guest_nice[ssCpuRawGuestNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util[snmp,{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
## Triggers
@@ -188,6 +188,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
diff --git a/templates/module/linux_snmp_snmp/template_module_linux_snmp_snmp.yaml b/templates/module/linux_snmp_snmp/template_module_linux_snmp_snmp.yaml
index 67753120bf7..21b6da9a0d9 100644
--- a/templates/module/linux_snmp_snmp/template_module_linux_snmp_snmp.yaml
+++ b/templates/module/linux_snmp_snmp/template_module_linux_snmp_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:34:00Z'
+ date: '2022-04-10T20:21:27Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -261,7 +261,7 @@ zabbix_export:
units: '%'
description: |
MIB: UCD-SNMP-MIB
- Guest time (time spent running a virtual CPU for a guest operating system)
+ Guest time (time spent running a virtual CPU for a guest operating system).
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -288,7 +288,7 @@ zabbix_export:
units: '%'
description: |
MIB: UCD-SNMP-MIB
- Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)
+ Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -529,7 +529,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -823,7 +823,7 @@ zabbix_export:
uuid: ae3535ef3f674dccb6c809dc7d01172c
expression: |
last(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -831,7 +831,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -845,7 +845,7 @@ zabbix_export:
uuid: 3bef4897bcd549288203241c5ca9f017
expression: |
last(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -853,7 +853,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -861,7 +861,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux filesystems SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux filesystems SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux filesystems SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -894,6 +894,14 @@ zabbix_export:
key: 'vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -1024,7 +1032,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Memory used by kernel buffers (Buffers in /proc/meminfo)
+ Memory used by kernel buffers (Buffers in /proc/meminfo).
preprocessing:
-
type: MULTIPLIER
@@ -1044,7 +1052,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
+ Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo).
preprocessing:
-
type: MULTIPLIER
@@ -1082,7 +1090,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Total memory in Bytes
+ Total memory in Bytes.
preprocessing:
-
type: MULTIPLIER
@@ -1143,7 +1151,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/module/windows_agent/README.md b/templates/module/windows_agent/README.md
index 5791939e254..fefd3a04ec2 100644
--- a/templates/module/windows_agent/README.md
+++ b/templates/module/windows_agent/README.md
@@ -33,7 +33,7 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|CPU |CPU utilization |<p>CPU utilization in %</p> |ZABBIX_PASSIVE |system.cpu.util |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |ZABBIX_PASSIVE |system.cpu.util |
|CPU |CPU interrupt time |<p>The Processor Information\% Interrupt Time is the time the processor spends receiving and servicing</p><p>hardware interrupts during sample intervals. This value is an indirect indicator of the activity of</p><p>devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication</p><p>lines, network interface cards and other peripheral devices. This is an easy way to identify a potential</p><p>hardware failure. This should never be higher than 20%.</p> |ZABBIX_PASSIVE |perf_counter_en["\Processor Information(_total)\% Interrupt Time"] |
|CPU |Context switches per second |<p>Context Switches/sec is the combined rate at which all processors on the computer are switched from one thread to another.</p><p>Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.</p><p>It is the sum of Thread\\Context Switches/sec for all threads running on all processors in the computer and is measured in numbers of switches.</p><p>There are context switch counters on the System and Thread objects. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.</p> |ZABBIX_PASSIVE |perf_counter_en["\System\Context Switches/sec"] |
|CPU |CPU privileged time |<p>The Processor Information\% Privileged Time counter shows the percent of time that the processor is spent</p><p>executing in Kernel (or Privileged) mode. Privileged mode includes services interrupts inside Interrupt</p><p>Service Routines (ISRs), executing Deferred Procedure Calls (DPCs), Device Driver calls and other kernel-mode</p><p>functions of the Windows® Operating System.</p> |ZABBIX_PASSIVE |perf_counter_en["\Processor Information(_total)\% Privileged Time"] |
@@ -89,9 +89,9 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|Memory |Used memory |<p>Used memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[used] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
-|Memory |Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
+|Memory |Used memory |<p>Used memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[used] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
+|Memory |Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
|Memory |Cache bytes |<p>Cache Bytes is the sum of the Memory\\System Cache Resident Bytes, Memory\\System Driver Resident Bytes,</p><p>Memory\\System Code Resident Bytes, and Memory\\Pool Paged Resident Bytes counters. This counter displays</p><p>the last observed value only; it is not an average.</p> |ZABBIX_PASSIVE |perf_counter_en["\Memory\Cache Bytes"] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |CALCULATED |system.swap.free<p>**Expression**:</p>`last(//system.swap.size[,total]) - last(//system.swap.size[,total]) / 100 * last(//perf_counter_en["\Paging file(_Total)\% Usage"])` |
|Memory |Free swap space in % |<p>The free space of swap volume/file in percent.</p> |DEPENDENT |system.swap.pfree<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100 - value)`</p> |
@@ -133,6 +133,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSDRIVETYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`fixed` |
|{$VFS.FS.FSDRIVETYPE.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^\s$` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*` |
diff --git a/templates/module/windows_agent/template_module_windows_agent.yaml b/templates/module/windows_agent/template_module_windows_agent.yaml
index 20160fb238c..235b566e118 100644
--- a/templates/module/windows_agent/template_module_windows_agent.yaml
+++ b/templates/module/windows_agent/template_module_windows_agent.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:34:03Z'
+ date: '2022-04-08T09:22:42Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -155,7 +155,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
tags:
-
tag: component
@@ -294,7 +294,7 @@ zabbix_export:
uuid: 68544e02e3cc4d389269448f34ca66e1
expression: |
last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -302,7 +302,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -313,7 +313,7 @@ zabbix_export:
uuid: ba0e859e58c34107a792098cfe9d31a4
expression: |
last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -321,7 +321,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -329,7 +329,7 @@ zabbix_export:
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
expression: |
last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -359,6 +359,14 @@ zabbix_export:
key: 'vfs.fs.size[{#FSNAME},used]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSDRIVETYPE.MATCHES}'
value: fixed
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
@@ -729,7 +737,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -740,7 +748,7 @@ zabbix_export:
key: 'vm.memory.size[used]'
history: 7d
units: B
- description: 'Used memory in Bytes'
+ description: 'Used memory in Bytes.'
tags:
-
tag: component
@@ -754,7 +762,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
diff --git a/templates/module/windows_agent_active/README.md b/templates/module/windows_agent_active/README.md
index e6db7ac41d2..11224f7bd73 100644
--- a/templates/module/windows_agent_active/README.md
+++ b/templates/module/windows_agent_active/README.md
@@ -33,7 +33,7 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|CPU |CPU utilization |<p>CPU utilization in %</p> |ZABBIX_ACTIVE |system.cpu.util |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |ZABBIX_ACTIVE |system.cpu.util |
|CPU |CPU interrupt time |<p>The Processor Information\% Interrupt Time is the time the processor spends receiving and servicing</p><p>hardware interrupts during sample intervals. This value is an indirect indicator of the activity of</p><p>devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication</p><p>lines, network interface cards and other peripheral devices. This is an easy way to identify a potential</p><p>hardware failure. This should never be higher than 20%.</p> |ZABBIX_ACTIVE |perf_counter_en["\Processor Information(_total)\% Interrupt Time"] |
|CPU |Context switches per second |<p>Context Switches/sec is the combined rate at which all processors on the computer are switched from one thread to another.</p><p>Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.</p><p>It is the sum of Thread\\Context Switches/sec for all threads running on all processors in the computer and is measured in numbers of switches.</p><p>There are context switch counters on the System and Thread objects. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.</p> |ZABBIX_ACTIVE |perf_counter_en["\System\Context Switches/sec"] |
|CPU |CPU privileged time |<p>The Processor Information\% Privileged Time counter shows the percent of time that the processor is spent</p><p>executing in Kernel (or Privileged) mode. Privileged mode includes services interrupts inside Interrupt</p><p>Service Routines (ISRs), executing Deferred Procedure Calls (DPCs), Device Driver calls and other kernel-mode</p><p>functions of the Windows® Operating System.</p> |ZABBIX_ACTIVE |perf_counter_en["\Processor Information(_total)\% Privileged Time"] |
@@ -89,9 +89,9 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|Memory |Used memory |<p>Used memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[used] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
-|Memory |Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
+|Memory |Used memory |<p>Used memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[used] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
+|Memory |Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
|Memory |Cache bytes |<p>Cache Bytes is the sum of the Memory\\System Cache Resident Bytes, Memory\\System Driver Resident Bytes,</p><p>Memory\\System Code Resident Bytes, and Memory\\Pool Paged Resident Bytes counters. This counter displays</p><p>the last observed value only; it is not an average.</p> |ZABBIX_ACTIVE |perf_counter_en["\Memory\Cache Bytes"] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |CALCULATED |system.swap.free<p>**Expression**:</p>`last(//system.swap.size[,total]) - last(//system.swap.size[,total]) / 100 * last(//perf_counter_en["\Paging file(_Total)\% Usage"])` |
|Memory |Free swap space in % |<p>The free space of swap volume/file in percent.</p> |DEPENDENT |system.swap.pfree<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100 - value)`</p> |
@@ -133,6 +133,8 @@ No specific Zabbix configuration is required.
|Name|Description|Default|
|----|-----------|-------|
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSDRIVETYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`fixed` |
|{$VFS.FS.FSDRIVETYPE.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^\s$` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*` |
diff --git a/templates/module/windows_agent_active/template_module_windows_agent_active.yaml b/templates/module/windows_agent_active/template_module_windows_agent_active.yaml
index 9ef80f060dc..e449de804ac 100644
--- a/templates/module/windows_agent_active/template_module_windows_agent_active.yaml
+++ b/templates/module/windows_agent_active/template_module_windows_agent_active.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:34:05Z'
+ date: '2022-04-08T09:22:28Z'
groups:
-
uuid: 57b7ae836ca64446ba2c296389c009b7
@@ -162,7 +162,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
tags:
-
tag: component
@@ -306,7 +306,7 @@ zabbix_export:
uuid: d09b152f2b53451b9daec16eadeaa0ee
expression: |
last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -314,7 +314,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -325,7 +325,7 @@ zabbix_export:
uuid: c3e9ee6d771d4047b4351e5870b8ca01
expression: |
last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -333,7 +333,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -341,7 +341,7 @@ zabbix_export:
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
expression: |
last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows filesystems by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -371,6 +371,14 @@ zabbix_export:
key: 'vfs.fs.size[{#FSNAME},used]'
macros:
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSDRIVETYPE.MATCHES}'
value: fixed
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
@@ -756,7 +764,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -768,7 +776,7 @@ zabbix_export:
key: 'vm.memory.size[used]'
history: 7d
units: B
- description: 'Used memory in Bytes'
+ description: 'Used memory in Bytes.'
tags:
-
tag: component
@@ -782,7 +790,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
diff --git a/templates/net/arista_snmp/README.md b/templates/net/arista_snmp/README.md
index dfd20ccd50d..a00a6557c8c 100644
--- a/templates/net/arista_snmp/README.md
+++ b/templates/net/arista_snmp/README.md
@@ -47,6 +47,8 @@ No specific Zabbix configuration is required.
|{$NET.IF.IFTYPE.NOT_MATCHES} |<p>-</p> |`CHANGE_IF_NEEDED` |
|{$PSU_CRIT_STATUS} |<p>-</p> |`2` |
|{$SNMP.TIMEOUT} |<p>-</p> |`5m` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -89,7 +91,7 @@ There are no template links in this template.
|Inventory |{#ENT_NAME}: Hardware serial number |<p>MIB: ENTITY-MIB</p> |SNMP |system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `6h`</p> |
|Memory |{#MEMNAME}: Used memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vm.memory.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Memory |{#MEMNAME}: Total memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.</p> |SNMP |vm.memory.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
-|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
+|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Duplex status |<p>MIB: EtherLike-MIB</p><p>The current mode of operation of the MAC</p><p>entity. 'unknown' indicates that the current</p><p>duplex mode could not be determined.</p><p>Management control of the duplex mode is</p><p>accomplished through the MAU MIB. When</p><p>an interface does not support autonegotiation,</p><p>or when autonegotiation is not enabled, the</p><p>duplex mode is controlled using</p><p>ifMauDefaultType. When autonegotiation is</p><p>supported and enabled, duplex mode is controlled</p><p>using ifMauAutoNegAdvertisedBits. In either</p><p>case, the currently operating duplex mode is</p><p>reflected both in this object and in ifMauType.</p><p>Note that this object provides redundant</p><p>information with ifMauType. Normally, redundant</p><p>objects are discouraged. However, in this</p><p>instance, it allows a management application to</p><p>determine the duplex status of an interface</p><p>without having to know every possible value of</p><p>ifMauType. This was felt to be sufficiently</p><p>valuable to justify the redundancy.</p><p>Reference: [IEEE 802.3 Std.], 30.3.1.1.32,aDuplexStatus.</p> |SNMP |net.if.duplex[dot3StatsDuplexStatus.{#SNMPINDEX}] |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Operational status |<p>MIB: IF-MIB</p><p>The current operational state of the interface.</p><p>- The testing(3) state indicates that no operational packet scan be passed</p><p>- If ifAdminStatus is down(2) then ifOperStatus should be down(2)</p><p>- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic</p><p>- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)</p><p>- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state</p><p>- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.</p> |SNMP |net.if.status[ifOperStatus.{#SNMPINDEX}] |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Bits received |<p>MIB: IF-MIB</p><p>The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in[ifHCInOctets.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
diff --git a/templates/net/arista_snmp/template_net_arista_snmp.yaml b/templates/net/arista_snmp/template_net_arista_snmp.yaml
index bbcd55c070b..e5c68deb2ea 100644
--- a/templates/net/arista_snmp/template_net_arista_snmp.yaml
+++ b/templates/net/arista_snmp/template_net_arista_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:34:13Z'
+ date: '2022-04-10T20:33:50Z'
groups:
-
uuid: 36bff6c29af64692839d077febfc7079
@@ -364,7 +364,7 @@ zabbix_export:
name: 'has been restarted'
event_name: '{HOST.NAME} has been restarted (uptime < 10m)'
priority: WARNING
- description: 'Uptime is less than 10 minutes'
+ description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
dependencies:
-
@@ -1589,7 +1589,7 @@ zabbix_export:
uuid: f4bfac8d247144b3bebac7245248553e
expression: |
last(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1597,7 +1597,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1611,7 +1611,7 @@ zabbix_export:
uuid: 9912ab9619ce46b88afe358ab50a2c4f
expression: |
last(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1619,7 +1619,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1627,7 +1627,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Arista SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Arista SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Arista SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -1739,7 +1739,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -2024,6 +2024,14 @@ zabbix_export:
macro: '{$SNMP.TIMEOUT}'
value: 5m
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
diff --git a/templates/net/mellanox_snmp/README.md b/templates/net/mellanox_snmp/README.md
index 56bc7dd413e..4a731cd7c47 100644
--- a/templates/net/mellanox_snmp/README.md
+++ b/templates/net/mellanox_snmp/README.md
@@ -52,6 +52,8 @@ The template uses context macros for the temperature trigger expression. By defa
|{$TEMP.MAX.WARN} |<p>The temperature maximum warning value for trigger expression.</p> |`50` |
|{$TEMP.MIN.CRIT} |<p>The temperature minimum critical value for trigger expression.</p> |`5` |
|{$TEMP.STATUS.WARN} |<p>The critical value of the TEMP sensor for trigger expression.</p> |`3` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host level.</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host level.</p> |`^(/dev|/sys|/$|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host level.</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -92,7 +94,7 @@ There are no template links in this template.
|Inventory |{#ENT_NAME}: Hardware serial number |<p>MIB: ENTITY-MIB</p> |SNMP |system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
|Memory |{#MEMNAME}: Used memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vm.memory.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Memory |{#MEMNAME}: Total memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.</p> |SNMP |vm.memory.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
-|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
+|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Operational status |<p>MIB: IF-MIB</p><p>The current operational state of the interface.</p><p>- The testing(3) state indicates that no operational packet scan be passed</p><p>- If ifAdminStatus is down(2) then ifOperStatus should be down(2)</p><p>- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic</p><p>- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)</p><p>- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state</p><p>- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.</p> |SNMP |net.if.status[ifOperStatus.{#SNMPINDEX}] |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Bits received |<p>MIB: IF-MIB</p><p>The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in[ifHCInOctets.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Bits sent |<p>MIB: IF-MIB</p><p>The total number of octets transmitted out of the interface, including framing characters. This object is a 64-bit version of ifOutOctets.Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.out[ifHCOutOctets.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
diff --git a/templates/net/mellanox_snmp/template_net_mellanox_snmp.yaml b/templates/net/mellanox_snmp/template_net_mellanox_snmp.yaml
index 9b7502f0eff..898ccf0529e 100644
--- a/templates/net/mellanox_snmp/template_net_mellanox_snmp.yaml
+++ b/templates/net/mellanox_snmp/template_net_mellanox_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:35:08Z'
+ date: '2022-04-10T20:41:37Z'
groups:
-
uuid: 36bff6c29af64692839d077febfc7079
@@ -330,7 +330,7 @@ zabbix_export:
name: 'has been restarted'
event_name: '{HOST.NAME} has been restarted (uptime < 10m)'
priority: WARNING
- description: 'Uptime is less than 10 minutes'
+ description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
dependencies:
-
@@ -1306,7 +1306,7 @@ zabbix_export:
uuid: f1eb2ddb27d24cd99d8aba4485dfeeb9
expression: |
last(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1314,7 +1314,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1328,7 +1328,7 @@ zabbix_export:
uuid: b2e084f280434a3a8291e5dc691dfd7b
expression: |
last(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1336,7 +1336,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1344,7 +1344,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Mellanox SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Mellanox SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Mellanox SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -1461,7 +1461,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -1620,6 +1620,14 @@ zabbix_export:
value: '3'
description: 'The critical value of the TEMP sensor for trigger expression.'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host level.'
diff --git a/templates/os/linux/README.md b/templates/os/linux/README.md
index 448bd978ece..d3c8ed828dd 100644
--- a/templates/os/linux/README.md
+++ b/templates/os/linux/README.md
@@ -36,6 +36,8 @@ No specific Zabbix configuration is required.
|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)` |
|{$VFS.DEV.READ.AWAIT.WARN} |<p>Disk read average response time (in ms) before the trigger would fire</p> |`20` |
|{$VFS.DEV.WRITE.AWAIT.WARN} |<p>Disk write average response time (in ms) before the trigger would fire</p> |`20` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$` |
@@ -65,7 +67,7 @@ There are no template links in this template.
|CPU |Load average (1m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg1] |
|CPU |Load average (5m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg5] |
|CPU |Load average (15m avg) |<p>-</p> |ZABBIX_PASSIVE |system.cpu.load[all,avg15] |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
|CPU |CPU idle time |<p>The time the CPU has spent doing nothing.</p> |ZABBIX_PASSIVE |system.cpu.util[,idle] |
|CPU |CPU system time |<p>The time the CPU has spent running the kernel and its processes.</p> |ZABBIX_PASSIVE |system.cpu.util[,system] |
|CPU |CPU user time |<p>The time the CPU has spent running users' processes that are not niced.</p> |ZABBIX_PASSIVE |system.cpu.util[,user] |
@@ -74,8 +76,8 @@ There are no template links in this template.
|CPU |CPU steal time |<p>The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).</p> |ZABBIX_PASSIVE |system.cpu.util[,steal] |
|CPU |CPU interrupt time |<p>The amount of time the CPU has been servicing hardware interrupts.</p> |ZABBIX_PASSIVE |system.cpu.util[,interrupt] |
|CPU |CPU softirq time |<p>The amount of time the CPU has been servicing software interrupts.</p> |ZABBIX_PASSIVE |system.cpu.util[,softirq] |
-|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |ZABBIX_PASSIVE |system.cpu.util[,guest] |
-|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |ZABBIX_PASSIVE |system.cpu.util[,guest_nice] |
+|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |ZABBIX_PASSIVE |system.cpu.util[,guest] |
+|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |ZABBIX_PASSIVE |system.cpu.util[,guest_nice] |
|CPU |Context switches per second |<p>-</p> |ZABBIX_PASSIVE |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|CPU |Interrupts per second |<p>-</p> |ZABBIX_PASSIVE |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|Filesystems |{#FSNAME}: Used space |<p>Used storage in Bytes</p> |ZABBIX_PASSIVE |vfs.fs.size[{#FSNAME},used] |
@@ -96,7 +98,7 @@ There are no template links in this template.
|Inventory |Software installed |<p>-</p> |ZABBIX_PASSIVE |system.sw.packages<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
|Memory |Memory utilization |<p>Memory used percentage is calculated as (100-pavailable)</p> |DEPENDENT |vm.memory.utilization<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100-value);`</p> |
|Memory |Available memory in % |<p>Available memory as percentage of total. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_PASSIVE |vm.memory.size[pavailable] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
|Memory |Available memory |<p>Available memory, in Linux, available = free + buffers + cache. On other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_PASSIVE |vm.memory.size[available] |
|Memory |Total swap space |<p>The total space of swap volume/file in bytes.</p> |ZABBIX_PASSIVE |system.swap.size[,total] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |ZABBIX_PASSIVE |system.swap.size[,free] |
diff --git a/templates/os/linux/template_os_linux.yaml b/templates/os/linux/template_os_linux.yaml
index 023fa798b73..96fef963db1 100644
--- a/templates/os/linux/template_os_linux.yaml
+++ b/templates/os/linux/template_os_linux.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:27:56Z'
+ date: '2022-04-10T20:20:48Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -245,7 +245,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -286,7 +286,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Guest time (time spent running a virtual CPU for a guest operating system)'
+ description: 'Guest time (time spent running a virtual CPU for a guest operating system).'
tags:
-
tag: component
@@ -298,7 +298,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)'
+ description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).'
tags:
-
tag: component
@@ -691,7 +691,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -1597,7 +1597,7 @@ zabbix_export:
uuid: 9abccdfff8be4e14967ac917ca09afe1
expression: |
last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1605,7 +1605,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1619,7 +1619,7 @@ zabbix_export:
uuid: d6d348ea500c428da6ba718816c4b048
expression: |
last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1627,7 +1627,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1635,7 +1635,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -1739,6 +1739,14 @@ zabbix_export:
value: '20'
description: 'Disk write average response time (in ms) before the trigger would fire'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -2247,7 +2255,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/os/linux_active/README.md b/templates/os/linux_active/README.md
index 2f46c75545b..7cd12dc774a 100644
--- a/templates/os/linux_active/README.md
+++ b/templates/os/linux_active/README.md
@@ -36,6 +36,8 @@ No specific Zabbix configuration is required.
|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)` |
|{$VFS.DEV.READ.AWAIT.WARN} |<p>Disk read average response time (in ms) before the trigger would fire</p> |`20` |
|{$VFS.DEV.WRITE.AWAIT.WARN} |<p>Disk write average response time (in ms) before the trigger would fire</p> |`20` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$` |
@@ -65,7 +67,7 @@ There are no template links in this template.
|CPU |Load average (1m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg1] |
|CPU |Load average (5m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg5] |
|CPU |Load average (15m avg) |<p>-</p> |ZABBIX_ACTIVE |system.cpu.load[all,avg15] |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value)`</p> |
|CPU |CPU idle time |<p>The time the CPU has spent doing nothing.</p> |ZABBIX_ACTIVE |system.cpu.util[,idle] |
|CPU |CPU system time |<p>The time the CPU has spent running the kernel and its processes.</p> |ZABBIX_ACTIVE |system.cpu.util[,system] |
|CPU |CPU user time |<p>The time the CPU has spent running users' processes that are not niced.</p> |ZABBIX_ACTIVE |system.cpu.util[,user] |
@@ -74,8 +76,8 @@ There are no template links in this template.
|CPU |CPU steal time |<p>The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).</p> |ZABBIX_ACTIVE |system.cpu.util[,steal] |
|CPU |CPU interrupt time |<p>The amount of time the CPU has been servicing hardware interrupts.</p> |ZABBIX_ACTIVE |system.cpu.util[,interrupt] |
|CPU |CPU softirq time |<p>The amount of time the CPU has been servicing software interrupts.</p> |ZABBIX_ACTIVE |system.cpu.util[,softirq] |
-|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |ZABBIX_ACTIVE |system.cpu.util[,guest] |
-|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |ZABBIX_ACTIVE |system.cpu.util[,guest_nice] |
+|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |ZABBIX_ACTIVE |system.cpu.util[,guest] |
+|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |ZABBIX_ACTIVE |system.cpu.util[,guest_nice] |
|CPU |Context switches per second |<p>-</p> |ZABBIX_ACTIVE |system.cpu.switches<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|CPU |Interrupts per second |<p>-</p> |ZABBIX_ACTIVE |system.cpu.intr<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p> |
|Filesystems |{#FSNAME}: Used space |<p>Used storage in Bytes</p> |ZABBIX_ACTIVE |vfs.fs.size[{#FSNAME},used] |
@@ -96,7 +98,7 @@ There are no template links in this template.
|Inventory |Software installed |<p>-</p> |ZABBIX_ACTIVE |system.sw.packages<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
|Memory |Memory utilization |<p>Memory used percentage is calculated as (100-pavailable)</p> |DEPENDENT |vm.memory.utilization<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100-value);`</p> |
|Memory |Available memory in % |<p>Available memory as percentage of total. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_ACTIVE |vm.memory.size[pavailable] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
|Memory |Available memory |<p>Available memory, in Linux, available = free + buffers + cache. On other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |ZABBIX_ACTIVE |vm.memory.size[available] |
|Memory |Total swap space |<p>The total space of swap volume/file in bytes.</p> |ZABBIX_ACTIVE |system.swap.size[,total] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |ZABBIX_ACTIVE |system.swap.size[,free] |
diff --git a/templates/os/linux_active/template_os_linux_active.yaml b/templates/os/linux_active/template_os_linux_active.yaml
index 5323a0bc86b..d325adf0c86 100644
--- a/templates/os/linux_active/template_os_linux_active.yaml
+++ b/templates/os/linux_active/template_os_linux_active.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:27:57Z'
+ date: '2022-04-10T20:20:35Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -272,7 +272,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -314,7 +314,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Guest time (time spent running a virtual CPU for a guest operating system)'
+ description: 'Guest time (time spent running a virtual CPU for a guest operating system).'
tags:
-
tag: component
@@ -327,7 +327,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)'
+ description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).'
tags:
-
tag: component
@@ -743,7 +743,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -1641,7 +1641,7 @@ zabbix_export:
uuid: cf4079132a9d4124aa5e29d6839ae35b
expression: |
last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1649,7 +1649,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1663,7 +1663,7 @@ zabbix_export:
uuid: b56b8cad3bb34fab8132e07a32c432d9
expression: |
last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1671,7 +1671,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1679,7 +1679,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -1783,6 +1783,14 @@ zabbix_export:
value: '20'
description: 'Disk write average response time (in ms) before the trigger would fire'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -2291,7 +2299,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/os/linux_prom/README.md b/templates/os/linux_prom/README.md
index 56feb681612..2af6b27a176 100644
--- a/templates/os/linux_prom/README.md
+++ b/templates/os/linux_prom/README.md
@@ -44,6 +44,8 @@ No specific Zabbix configuration is required.
|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level.</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)` |
|{$VFS.DEV.READ.AWAIT.WARN} |<p>Disk read average response time (in ms) before the trigger would fire.</p> |`20` |
|{$VFS.DEV.WRITE.AWAIT.WARN} |<p>Disk write average response time (in ms) before the trigger would fire.</p> |`20` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSDEVICE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^.+$` |
|{$VFS.FS.FSDEVICE.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^\s$` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.+` |
@@ -75,7 +77,7 @@ There are no template links in this template.
|CPU |Load average (5m avg) |<p>-</p> |DEPENDENT |system.cpu.load.avg5[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `node_load5`</p> |
|CPU |Load average (15m avg) |<p>-</p> |DEPENDENT |system.cpu.load.avg15[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `node_load15`</p> |
|CPU |Number of CPUs |<p>-</p> |DEPENDENT |system.cpu.num[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="idle"}`</p><p>- JAVASCRIPT: `//count the number of cores return JSON.parse(value).length `</p> |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util[node_exporter]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util[node_exporter]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
|CPU |CPU idle time |<p>The time the CPU has spent doing nothing.</p> |DEPENDENT |system.cpu.idle[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="idle"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
|CPU |CPU system time |<p>The time the CPU has spent running the kernel and its processes.</p> |DEPENDENT |system.cpu.system[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="system"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
|CPU |CPU user time |<p>The time the CPU has spent running users' processes that are not niced.</p> |DEPENDENT |system.cpu.user[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="user"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
@@ -84,8 +86,8 @@ There are no template links in this template.
|CPU |CPU nice time |<p>The time the CPU has spent running users' processes that have been niced.</p> |DEPENDENT |system.cpu.nice[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="nice"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
|CPU |CPU iowait time |<p>Amount of time the CPU has been waiting for I/O to complete.</p> |DEPENDENT |system.cpu.iowait[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="iowait"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
|CPU |CPU interrupt time |<p>The amount of time the CPU has been servicing hardware interrupts.</p> |DEPENDENT |system.cpu.interrupt[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_seconds_total)?$",cpu=~".+",mode="irq"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
-|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |DEPENDENT |system.cpu.guest[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_guest_seconds_total)?$",cpu=~".+",mode=~"^(?:user|guest)$"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
-|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |DEPENDENT |system.cpu.guest_nice[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_guest_seconds_total)?$",cpu=~".+",mode=~"^(?:nice|guest_nice)$"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
+|CPU |CPU guest time |<p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |DEPENDENT |system.cpu.guest[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_guest_seconds_total)?$",cpu=~".+",mode=~"^(?:user|guest)$"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
+|CPU |CPU guest nice time |<p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |DEPENDENT |system.cpu.guest_nice[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_TO_JSON: `{__name__=~"^node_cpu(?:_guest_seconds_total)?$",cpu=~".+",mode=~"^(?:nice|guest_nice)$"}`</p><p>- JAVASCRIPT: `The text is too long. Please see the template.`</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `100`</p> |
|CPU |Interrupts per second |<p>-</p> |DEPENDENT |system.cpu.intr[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_intr"}`</p><p>- CHANGE_PER_SECOND</p> |
|CPU |Context switches per second |<p>-</p> |DEPENDENT |system.cpu.switches[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_context_switches"}`</p><p>- CHANGE_PER_SECOND</p> |
|General |System boot time |<p>-</p> |DEPENDENT |system.boottime[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"^node_boot_time(?:_seconds)?$"}`</p> |
@@ -97,7 +99,7 @@ There are no template links in this template.
|Inventory |Operating system |<p>-</p> |DEPENDENT |system.sw.os[node_exporter]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
|Inventory |Operating system architecture |<p>Operating system architecture of the host.</p> |DEPENDENT |system.sw.arch[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `node_uname_info`: `label`: `machine`</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
|Memory |Memory utilization |<p>Memory used percentage is calculated as (total-available)/total*100.</p> |CALCULATED |vm.memory.util[node_exporter]<p>**Expression**:</p>`(last(//vm.memory.total[node_exporter])-last(//vm.memory.available[node_exporter]))/last(//vm.memory.total[node_exporter])*100` |
-|Memory |Total memory |<p>Total memory in Bytes</p> |DEPENDENT |vm.memory.total[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_memory_MemTotal"}`</p> |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |DEPENDENT |vm.memory.total[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_memory_MemTotal"}`</p> |
|Memory |Available memory |<p>Available memory, in Linux, available = free + buffers + cache. On other platforms calculation may vary. See also Appendixes in Zabbix Documentation about parameters of the vm.memory.size item.</p> |DEPENDENT |vm.memory.available[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_memory_MemAvailable"}`</p> |
|Memory |Total swap space |<p>The total space of swap volume/file in bytes.</p> |DEPENDENT |system.swap.total[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_memory_SwapTotal"}`</p> |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |DEPENDENT |system.swap.free[node_exporter]<p>**Preprocessing**:</p><p>- PROMETHEUS_PATTERN: `{__name__=~"node_memory_SwapFree"}`</p> |
diff --git a/templates/os/linux_prom/template_os_linux_prom.yaml b/templates/os/linux_prom/template_os_linux_prom.yaml
index 2b600772efb..b41b8455479 100644
--- a/templates/os/linux_prom/template_os_linux_prom.yaml
+++ b/templates/os/linux_prom/template_os_linux_prom.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:27:59Z'
+ date: '2022-04-10T20:20:22Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -174,7 +174,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Guest time (time spent running a virtual CPU for a guest operating system)'
+ description: 'Guest time (time spent running a virtual CPU for a guest operating system).'
preprocessing:
-
type: PROMETHEUS_TO_JSON
@@ -212,7 +212,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)'
+ description: 'Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).'
preprocessing:
-
type: PROMETHEUS_TO_JSON
@@ -691,7 +691,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -1046,7 +1046,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
preprocessing:
-
type: PROMETHEUS_PATTERN
@@ -2168,7 +2168,7 @@ zabbix_export:
uuid: d5687d7aa0484b389f0bd168d50ee1e6
expression: |
last(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<5G or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
+ ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -2176,7 +2176,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -2190,7 +2190,7 @@ zabbix_export:
uuid: 8f765148cfd64d5ebda93f39d0b20e36
expression: |
last(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<10G or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
+ ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -2198,7 +2198,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -2206,7 +2206,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<5G or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
+ ((last(/Linux by Prom/vfs.fs.total[node_exporter,"{#FSNAME}"])-last(/Linux by Prom/vfs.fs.used[node_exporter,"{#FSNAME}"]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux by Prom/vfs.fs.pused[node_exporter,"{#FSNAME}"],1h,100)<1d)
tags:
-
tag: scope
@@ -2337,6 +2337,14 @@ zabbix_export:
value: '20'
description: 'Disk write average response time (in ms) before the trigger would fire.'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSDEVICE.MATCHES}'
value: ^.+$
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
@@ -2822,7 +2830,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/os/linux_snmp_snmp/README.md b/templates/os/linux_snmp_snmp/README.md
index b220aed45ce..e54ccbf91dd 100644
--- a/templates/os/linux_snmp_snmp/README.md
+++ b/templates/os/linux_snmp_snmp/README.md
@@ -59,6 +59,8 @@ No specific Zabbix configuration is required.
|{$SWAP.PFREE.MIN.WARN} |<p>-</p> |`50` |
|{$VFS.DEV.DEVNAME.MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.DEV.DEVNAME.NOT_MATCHES} |<p>This macro is used in block devices discovery. Can be overridden on the host or linked template level</p> |`^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -100,9 +102,9 @@ There are no template links in this template.
|CPU |CPU nice time |<p>MIB: UCD-SNMP-MIB</p><p>The time the CPU has spent running users' processes that have been niced.</p> |SNMP |system.cpu.nice[ssCpuRawNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |CPU iowait time |<p>MIB: UCD-SNMP-MIB</p><p>Amount of time the CPU has been waiting for I/O to complete.</p> |SNMP |system.cpu.iowait[ssCpuRawWait.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
|CPU |CPU interrupt time |<p>MIB: UCD-SNMP-MIB</p><p>The amount of time the CPU has been servicing hardware interrupts.</p> |SNMP |system.cpu.interrupt[ssCpuRawInterrupt.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU guest time |<p>MIB: UCD-SNMP-MIB</p><p>Guest time (time spent running a virtual CPU for a guest operating system)</p> |SNMP |system.cpu.guest[ssCpuRawGuest.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU guest nice time |<p>MIB: UCD-SNMP-MIB</p><p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)</p> |SNMP |system.cpu.guest_nice[ssCpuRawGuestNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
-|CPU |CPU utilization |<p>CPU utilization in %</p> |DEPENDENT |system.cpu.util[snmp,{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
+|CPU |CPU guest time |<p>MIB: UCD-SNMP-MIB</p><p>Guest time (time spent running a virtual CPU for a guest operating system).</p> |SNMP |system.cpu.guest[ssCpuRawGuest.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |CPU guest nice time |<p>MIB: UCD-SNMP-MIB</p><p>Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).</p> |SNMP |system.cpu.guest_nice[ssCpuRawGuestNice.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- JAVASCRIPT: `//to get utilization in %, divide by N, where N is number of cores. return value/{#CPU.COUNT} `</p> |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |DEPENDENT |system.cpu.util[snmp,{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- JAVASCRIPT: `//Calculate utilization return (100 - value) `</p> |
|General |SNMP traps (fallback) |<p>The item is used to collect all SNMP traps unmatched by other snmptrap items</p> |SNMP_TRAP |snmptrap.fallback |
|General |System location |<p>MIB: SNMPv2-MIB</p><p>The physical location of this node (e.g., `telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.</p> |SNMP |system.location[sysLocation.0]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
|General |System contact details |<p>MIB: SNMPv2-MIB</p><p>The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.</p> |SNMP |system.contact[sysContact.0]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
@@ -111,9 +113,9 @@ There are no template links in this template.
|General |System description |<p>MIB: SNMPv2-MIB</p><p>A textual description of the entity. This value should</p><p>include the full name and version identification of the system's hardware type, software operating-system, and</p><p>networking software.</p> |SNMP |system.descr[sysDescr.0]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
|Memory |Memory utilization |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.util[snmp]<p>**Expression**:</p>`(last(//vm.memory.total[memTotalReal.0])-(last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])))/last(//vm.memory.total[memTotalReal.0])*100` |
|Memory |Free memory |<p>MIB: UCD-SNMP-MIB</p> |SNMP |vm.memory.free[memAvailReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by kernel buffers (Buffers in /proc/meminfo)</p> |SNMP |vm.memory.buffers[memBuffer.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)</p> |SNMP |vm.memory.cached[memCached.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
-|Memory |Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes</p> |SNMP |vm.memory.total[memTotalReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Memory (buffers) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by kernel buffers (Buffers in /proc/meminfo).</p> |SNMP |vm.memory.buffers[memBuffer.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Memory (cached) |<p>MIB: UCD-SNMP-MIB</p><p>Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo).</p> |SNMP |vm.memory.cached[memCached.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
+|Memory |Total memory |<p>MIB: UCD-SNMP-MIB</p><p>Total memory in Bytes.</p> |SNMP |vm.memory.total[memTotalReal.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |Available memory |<p>Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.</p> |CALCULATED |vm.memory.available[snmp]<p>**Expression**:</p>`last(//vm.memory.free[memAvailReal.0])+last(//vm.memory.buffers[memBuffer.0])+last(//vm.memory.cached[memCached.0])` |
|Memory |Total swap space |<p>MIB: UCD-SNMP-MIB</p><p>The total amount of swap space configured for this host.</p> |SNMP |system.swap.total[memTotalSwap.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
|Memory |Free swap space |<p>MIB: UCD-SNMP-MIB</p><p>The amount of swap space currently unused or available.</p> |SNMP |system.swap.free[memAvailSwap.0]<p>**Preprocessing**:</p><p>- MULTIPLIER: `1024`</p> |
diff --git a/templates/os/linux_snmp_snmp/template_os_linux_snmp_snmp.yaml b/templates/os/linux_snmp_snmp/template_os_linux_snmp_snmp.yaml
index 17b92418c17..a66377e6486 100644
--- a/templates/os/linux_snmp_snmp/template_os_linux_snmp_snmp.yaml
+++ b/templates/os/linux_snmp_snmp/template_os_linux_snmp_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:28:04Z'
+ date: '2022-04-10T20:21:14Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -454,7 +454,7 @@ zabbix_export:
name: 'has been restarted'
event_name: '{HOST.NAME} has been restarted (uptime < 10m)'
priority: WARNING
- description: 'Uptime is less than 10 minutes'
+ description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
dependencies:
-
@@ -487,7 +487,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Memory used by kernel buffers (Buffers in /proc/meminfo)
+ Memory used by kernel buffers (Buffers in /proc/meminfo).
preprocessing:
-
type: MULTIPLIER
@@ -507,7 +507,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
+ Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo).
preprocessing:
-
type: MULTIPLIER
@@ -545,7 +545,7 @@ zabbix_export:
units: B
description: |
MIB: UCD-SNMP-MIB
- Total memory in Bytes
+ Total memory in Bytes.
preprocessing:
-
type: MULTIPLIER
@@ -645,7 +645,7 @@ zabbix_export:
units: '%'
description: |
MIB: UCD-SNMP-MIB
- Guest time (time spent running a virtual CPU for a guest operating system)
+ Guest time (time spent running a virtual CPU for a guest operating system).
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -672,7 +672,7 @@ zabbix_export:
units: '%'
description: |
MIB: UCD-SNMP-MIB
- Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel)
+ Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).
preprocessing:
-
type: CHANGE_PER_SECOND
@@ -913,7 +913,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
preprocessing:
-
type: JAVASCRIPT
@@ -1869,7 +1869,7 @@ zabbix_export:
uuid: 4e84d5b0e3bb4729a6eabd5882d2d603
expression: |
last(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1877,7 +1877,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1891,7 +1891,7 @@ zabbix_export:
uuid: 210ae86feef14fa0a82c97331e522937
expression: |
last(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1899,7 +1899,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1907,7 +1907,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Linux SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Linux SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Linux SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -2029,6 +2029,14 @@ zabbix_export:
value: '^(loop[0-9]*|sd[a-z][0-9]+|nbd[0-9]+|sr[0-9]+|fd[0-9]+|dm-[0-9]+|ram[0-9]+|ploop[a-z0-9]+|md[0-9]*|hcp[0-9]*|zram[0-9]*)'
description: 'This macro is used in block devices discovery. Can be overridden on the host or linked template level'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level'
@@ -3189,7 +3197,7 @@ zabbix_export:
event_name: 'High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
priority: WARNING
- description: 'This trigger is ignored, if there is no swap configured'
+ description: 'This trigger is ignored, if there is no swap configured.'
dependencies:
-
name: 'High memory utilization'
diff --git a/templates/os/windows_agent/README.md b/templates/os/windows_agent/README.md
index 9565c428e96..a1fd50b0ac3 100644
--- a/templates/os/windows_agent/README.md
+++ b/templates/os/windows_agent/README.md
@@ -53,6 +53,8 @@ No specific Zabbix configuration is required.
|{$VFS.DEV.READ.AWAIT.WARN} |<p>Disk read average response time (in s) before the trigger would fire.</p> |`0.02` |
|{$VFS.DEV.UTIL.MAX.WARN} |<p>The warning threshold of disk time utilization in percent.</p> |`95` |
|{$VFS.DEV.WRITE.AWAIT.WARN} |<p>Disk write average response time (in s) before the trigger would fire.</p> |`0.02` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSDRIVETYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`fixed` |
|{$VFS.FS.FSDRIVETYPE.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^\s$` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*` |
@@ -79,7 +81,7 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|CPU |CPU utilization |<p>CPU utilization in %</p> |ZABBIX_PASSIVE |system.cpu.util |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |ZABBIX_PASSIVE |system.cpu.util |
|CPU |CPU interrupt time |<p>The Processor Information\% Interrupt Time is the time the processor spends receiving and servicing</p><p>hardware interrupts during sample intervals. This value is an indirect indicator of the activity of</p><p>devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication</p><p>lines, network interface cards and other peripheral devices. This is an easy way to identify a potential</p><p>hardware failure. This should never be higher than 20%.</p> |ZABBIX_PASSIVE |perf_counter_en["\Processor Information(_total)\% Interrupt Time"] |
|CPU |Context switches per second |<p>Context Switches/sec is the combined rate at which all processors on the computer are switched from one thread to another.</p><p>Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.</p><p>It is the sum of Thread\\Context Switches/sec for all threads running on all processors in the computer and is measured in numbers of switches.</p><p>There are context switch counters on the System and Thread objects. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.</p> |ZABBIX_PASSIVE |perf_counter_en["\System\Context Switches/sec"] |
|CPU |CPU privileged time |<p>The Processor Information\% Privileged Time counter shows the percent of time that the processor is spent</p><p>executing in Kernel (or Privileged) mode. Privileged mode includes services interrupts inside Interrupt</p><p>Service Routines (ISRs), executing Deferred Procedure Calls (DPCs), Device Driver calls and other kernel-mode</p><p>functions of the Windows® Operating System.</p> |ZABBIX_PASSIVE |perf_counter_en["\Processor Information(_total)\% Privileged Time"] |
@@ -96,9 +98,9 @@ There are no template links in this template.
|General |Number of processes |<p>The number of processes.</p> |ZABBIX_PASSIVE |proc.num[] |
|General |Number of threads |<p>The number of threads used by all running processes.</p> |ZABBIX_PASSIVE |perf_counter_en["\System\Threads"] |
|Inventory |Operating system architecture |<p>Operating system architecture of the host.</p> |ZABBIX_PASSIVE |system.sw.arch<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
-|Memory |Used memory |<p>Used memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[used] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
-|Memory |Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
+|Memory |Used memory |<p>Used memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[used] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_PASSIVE |vm.memory.size[total] |
+|Memory |Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
|Memory |Cache bytes |<p>Cache Bytes is the sum of the Memory\\System Cache Resident Bytes, Memory\\System Driver Resident Bytes,</p><p>Memory\\System Code Resident Bytes, and Memory\\Pool Paged Resident Bytes counters. This counter displays</p><p>the last observed value only; it is not an average.</p> |ZABBIX_PASSIVE |perf_counter_en["\Memory\Cache Bytes"] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |CALCULATED |system.swap.free<p>**Expression**:</p>`last(//system.swap.size[,total]) - last(//system.swap.size[,total]) / 100 * last(//perf_counter_en["\Paging file(_Total)\% Usage"])` |
|Memory |Free swap space in % |<p>The free space of swap volume/file in percent.</p> |DEPENDENT |system.swap.pfree<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100 - value)`</p> |
diff --git a/templates/os/windows_agent/template_os_windows_agent.yaml b/templates/os/windows_agent/template_os_windows_agent.yaml
index a40515e1f8e..35deea5e9b3 100644
--- a/templates/os/windows_agent/template_os_windows_agent.yaml
+++ b/templates/os/windows_agent/template_os_windows_agent.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:35:56Z'
+ date: '2022-04-08T09:23:20Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -345,7 +345,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
tags:
-
tag: component
@@ -541,7 +541,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -552,7 +552,7 @@ zabbix_export:
key: 'vm.memory.size[used]'
history: 7d
units: B
- description: 'Used memory in Bytes'
+ description: 'Used memory in Bytes.'
tags:
-
tag: component
@@ -566,7 +566,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -1478,7 +1478,7 @@ zabbix_export:
uuid: d3e99134a1d04894918f2c92ff38cb92
expression: |
last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1486,7 +1486,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1497,7 +1497,7 @@ zabbix_export:
uuid: 97115bbe4f6b4a8cb2873b8fa01f95d3
expression: |
last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1505,7 +1505,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1513,7 +1513,7 @@ zabbix_export:
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
expression: |
last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -1659,6 +1659,14 @@ zabbix_export:
value: '0.02'
description: 'Disk write average response time (in s) before the trigger would fire.'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSDRIVETYPE.MATCHES}'
value: fixed
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
diff --git a/templates/os/windows_agent_active/README.md b/templates/os/windows_agent_active/README.md
index 2799495808e..782fa2d60db 100644
--- a/templates/os/windows_agent_active/README.md
+++ b/templates/os/windows_agent_active/README.md
@@ -53,6 +53,8 @@ No specific Zabbix configuration is required.
|{$VFS.DEV.READ.AWAIT.WARN} |<p>Disk read average response time (in s) before the trigger would fire.</p> |`0.02` |
|{$VFS.DEV.UTIL.MAX.WARN} |<p>The warning threshold of disk time utilization in percent.</p> |`95` |
|{$VFS.DEV.WRITE.AWAIT.WARN} |<p>Disk write average response time (in s) before the trigger would fire.</p> |`0.02` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSDRIVETYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`fixed` |
|{$VFS.FS.FSDRIVETYPE.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^\s$` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*` |
@@ -79,7 +81,7 @@ There are no template links in this template.
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
-|CPU |CPU utilization |<p>CPU utilization in %</p> |ZABBIX_ACTIVE |system.cpu.util |
+|CPU |CPU utilization |<p>CPU utilization in %.</p> |ZABBIX_ACTIVE |system.cpu.util |
|CPU |CPU interrupt time |<p>The Processor Information\% Interrupt Time is the time the processor spends receiving and servicing</p><p>hardware interrupts during sample intervals. This value is an indirect indicator of the activity of</p><p>devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication</p><p>lines, network interface cards and other peripheral devices. This is an easy way to identify a potential</p><p>hardware failure. This should never be higher than 20%.</p> |ZABBIX_ACTIVE |perf_counter_en["\Processor Information(_total)\% Interrupt Time"] |
|CPU |Context switches per second |<p>Context Switches/sec is the combined rate at which all processors on the computer are switched from one thread to another.</p><p>Context switches occur when a running thread voluntarily relinquishes the processor, is preempted by a higher priority ready thread, or switches between user-mode and privileged (kernel) mode to use an Executive or subsystem service.</p><p>It is the sum of Thread\\Context Switches/sec for all threads running on all processors in the computer and is measured in numbers of switches.</p><p>There are context switch counters on the System and Thread objects. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.</p> |ZABBIX_ACTIVE |perf_counter_en["\System\Context Switches/sec"] |
|CPU |CPU privileged time |<p>The Processor Information\% Privileged Time counter shows the percent of time that the processor is spent</p><p>executing in Kernel (or Privileged) mode. Privileged mode includes services interrupts inside Interrupt</p><p>Service Routines (ISRs), executing Deferred Procedure Calls (DPCs), Device Driver calls and other kernel-mode</p><p>functions of the Windows® Operating System.</p> |ZABBIX_ACTIVE |perf_counter_en["\Processor Information(_total)\% Privileged Time"] |
@@ -96,9 +98,9 @@ There are no template links in this template.
|General |Number of processes |<p>The number of processes.</p> |ZABBIX_ACTIVE |proc.num[] |
|General |Number of threads |<p>The number of threads used by all running processes.</p> |ZABBIX_ACTIVE |perf_counter_en["\System\Threads"] |
|Inventory |Operating system architecture |<p>Operating system architecture of the host.</p> |ZABBIX_ACTIVE |system.sw.arch<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1d`</p> |
-|Memory |Used memory |<p>Used memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[used] |
-|Memory |Total memory |<p>Total memory in Bytes</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
-|Memory |Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
+|Memory |Used memory |<p>Used memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[used] |
+|Memory |Total memory |<p>Total memory in Bytes.</p> |ZABBIX_ACTIVE |vm.memory.size[total] |
+|Memory |Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util<p>**Expression**:</p>`last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100` |
|Memory |Cache bytes |<p>Cache Bytes is the sum of the Memory\\System Cache Resident Bytes, Memory\\System Driver Resident Bytes,</p><p>Memory\\System Code Resident Bytes, and Memory\\Pool Paged Resident Bytes counters. This counter displays</p><p>the last observed value only; it is not an average.</p> |ZABBIX_ACTIVE |perf_counter_en["\Memory\Cache Bytes"] |
|Memory |Free swap space |<p>The free space of swap volume/file in bytes.</p> |CALCULATED |system.swap.free<p>**Expression**:</p>`last(//system.swap.size[,total]) - last(//system.swap.size[,total]) / 100 * last(//perf_counter_en["\Paging file(_Total)\% Usage"])` |
|Memory |Free swap space in % |<p>The free space of swap volume/file in percent.</p> |DEPENDENT |system.swap.pfree<p>**Preprocessing**:</p><p>- JAVASCRIPT: `return (100 - value)`</p> |
diff --git a/templates/os/windows_agent_active/template_os_windows_agent_active.yaml b/templates/os/windows_agent_active/template_os_windows_agent_active.yaml
index 3e6212b0244..05b5597f8b2 100644
--- a/templates/os/windows_agent_active/template_os_windows_agent_active.yaml
+++ b/templates/os/windows_agent_active/template_os_windows_agent_active.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:35:58Z'
+ date: '2022-04-08T09:23:07Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -376,7 +376,7 @@ zabbix_export:
history: 7d
value_type: FLOAT
units: '%'
- description: 'CPU utilization in %'
+ description: 'CPU utilization in %.'
tags:
-
tag: component
@@ -579,7 +579,7 @@ zabbix_export:
key: 'vm.memory.size[total]'
history: 7d
units: B
- description: 'Total memory in Bytes'
+ description: 'Total memory in Bytes.'
tags:
-
tag: component
@@ -591,7 +591,7 @@ zabbix_export:
key: 'vm.memory.size[used]'
history: 7d
units: B
- description: 'Used memory in Bytes'
+ description: 'Used memory in Bytes.'
tags:
-
tag: component
@@ -605,7 +605,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.size[used]) / last(//vm.memory.size[total]) * 100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -1514,7 +1514,7 @@ zabbix_export:
uuid: 5bed682545044584852888d96454df86
expression: |
last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1522,7 +1522,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -1533,7 +1533,7 @@ zabbix_export:
uuid: 1e5e9718c5a14099b9421ff7956b2f33
expression: |
last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<10G or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
name: '{#FSLABEL}({#FSNAME}): Disk space is low'
event_name: '{#FSLABEL}({#FSNAME}): Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1541,7 +1541,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1549,7 +1549,7 @@ zabbix_export:
name: '{#FSLABEL}({#FSNAME}): Disk space is critically low'
expression: |
last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<5G or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
+ ((last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},total])-last(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows by Zabbix agent active/vfs.fs.size[{#FSNAME},pused],1h,100)<1d)
tags:
-
tag: scope
@@ -1695,6 +1695,14 @@ zabbix_export:
value: '0.02'
description: 'Disk write average response time (in s) before the trigger would fire.'
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSDRIVETYPE.MATCHES}'
value: fixed
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
diff --git a/templates/os/windows_snmp/README.md b/templates/os/windows_snmp/README.md
index d3a2cee9901..846ac6ba9e6 100644
--- a/templates/os/windows_snmp/README.md
+++ b/templates/os/windows_snmp/README.md
@@ -41,6 +41,8 @@ No specific Zabbix configuration is required.
|{$NET.IF.IFTYPE.MATCHES} |<p>-</p> |`.*` |
|{$NET.IF.IFTYPE.NOT_MATCHES} |<p>-</p> |`CHANGE_IF_NEEDED` |
|{$SNMP.TIMEOUT} |<p>-</p> |`5m` |
+|{$VFS.FS.FREE.MIN.CRIT} |<p>The critical threshold of the filesystem utilization.</p> |`5G` |
+|{$VFS.FS.FREE.MIN.WARN} |<p>The warning threshold of the filesystem utilization.</p> |`10G` |
|{$VFS.FS.FSNAME.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.+` |
|{$VFS.FS.FSNAME.NOT_MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`^(/dev|/sys|/run|/proc|.+/shm$)` |
|{$VFS.FS.FSTYPE.MATCHES} |<p>This macro is used in filesystems discovery. Can be overridden on the host or linked template level.</p> |`.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$` |
@@ -73,7 +75,7 @@ There are no template links in this template.
|General |System description |<p>MIB: SNMPv2-MIB</p><p>A textual description of the entity. This value should</p><p>include the full name and version identification of the system's hardware type, software operating-system, and</p><p>networking software.</p> |SNMP |system.descr[sysDescr.0]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `12h`</p> |
|Memory |{#MEMNAME}: Used memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.</p> |SNMP |vm.memory.used[hrStorageUsed.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
|Memory |{#MEMNAME}: Total memory |<p>MIB: HOST-RESOURCES-MIB</p><p>The size of the storage represented by this entry, in units of hrStorageAllocationUnits.</p><p>This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.</p><p>For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.</p> |SNMP |vm.memory.total[hrStorageSize.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- MULTIPLIER: `{#ALLOC_UNITS}`</p> |
-|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
+|Memory |{#MEMNAME}: Memory utilization |<p>Memory utilization in %.</p> |CALCULATED |vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]<p>**Expression**:</p>`last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100` |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Operational status |<p>MIB: IF-MIB</p><p>The current operational state of the interface.</p><p>- The testing(3) state indicates that no operational packet scan be passed</p><p>- If ifAdminStatus is down(2) then ifOperStatus should be down(2)</p><p>- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic</p><p>- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)</p><p>- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state</p><p>- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.</p> |SNMP |net.if.status[ifOperStatus.{#SNMPINDEX}] |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Bits received |<p>MIB: IF-MIB</p><p>The total number of octets received on the interface,including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and atother times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.in[ifInOctets.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
|Network interfaces |Interface {#IFNAME}({#IFALIAS}): Bits sent |<p>MIB: IF-MIB</p><p>The total number of octets transmitted out of the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</p> |SNMP |net.if.out[ifOutOctets.{#SNMPINDEX}]<p>**Preprocessing**:</p><p>- CHANGE_PER_SECOND</p><p>- MULTIPLIER: `8`</p> |
@@ -103,13 +105,13 @@ There are no template links in this template.
|Interface {#IFNAME}({#IFALIAS}): High bandwidth usage |<p>The network interface utilization is close to its estimated maximum bandwidth.</p> |`(avg(/Windows SNMP/net.if.in[ifInOctets.{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}]) or avg(/Windows SNMP/net.if.out[ifOutOctets.{#SNMPINDEX}],15m)>({$IF.UTIL.MAX:"{#IFNAME}"}/100)*last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])) and last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])>0`<p>Recovery expression:</p>`avg(/Windows SNMP/net.if.in[ifInOctets.{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}]) and avg(/Windows SNMP/net.if.out[ifOutOctets.{#SNMPINDEX}],15m)<(({$IF.UTIL.MAX:"{#IFNAME}"}-3)/100)*last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- Interface {#IFNAME}({#IFALIAS}): Link down</p> |
|Interface {#IFNAME}({#IFALIAS}): High error rate |<p>Recovers when below 80% of {$IF.ERRORS.WARN:"{#IFNAME}"} threshold</p> |`min(/Windows SNMP/net.if.in.errors[ifInErrors.{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"} or min(/Windows SNMP/net.if.out.errors[ifOutErrors.{#SNMPINDEX}],5m)>{$IF.ERRORS.WARN:"{#IFNAME}"}`<p>Recovery expression:</p>`max(/Windows SNMP/net.if.in.errors[ifInErrors.{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8 and max(/Windows SNMP/net.if.out.errors[ifOutErrors.{#SNMPINDEX}],5m)<{$IF.ERRORS.WARN:"{#IFNAME}"}*0.8` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- Interface {#IFNAME}({#IFALIAS}): Link down</p> |
|Interface {#IFNAME}({#IFALIAS}): Ethernet has changed to lower speed than it was before |<p>This Ethernet connection has transitioned down from its known maximum speed. This might be a sign of autonegotiation issues. Ack to close.</p> |`change(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])<0 and last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])>0 and ( last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=6 or last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=7 or last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=11 or last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=62 or last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=69 or last(/Windows SNMP/net.if.type[ifType.{#SNMPINDEX}])=117 ) and (last(/Windows SNMP/net.if.status[ifOperStatus.{#SNMPINDEX}])<>2) `<p>Recovery expression:</p>`(change(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}])>0 and last(/Windows SNMP/net.if.speed[ifHighSpeed.{#SNMPINDEX}],#2)>0) or (last(/Windows SNMP/net.if.status[ifOperStatus.{#SNMPINDEX}])=2) ` |INFO |<p>Manual close: YES</p><p>**Depends on**:</p><p>- Interface {#IFNAME}({#IFALIAS}): Link down</p> |
-|has been restarted |<p>Uptime is less than 10 minutes</p> |`last(/Windows SNMP/system.uptime[sysUpTime.0])<10m` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- No SNMP data collection</p> |
+|{HOST.NAME} has been restarted (uptime < 10m) |<p>Uptime is less than 10 minutes.</p> |`last(/Windows SNMP/system.uptime[sysUpTime.0])<10m` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- No SNMP data collection</p> |
|No SNMP data collection |<p>SNMP is not available for polling. Please check device connectivity and SNMP settings.</p> |`max(/Windows SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0` |WARNING |<p>**Depends on**:</p><p>- Unavailable by ICMP ping</p> |
|Unavailable by ICMP ping |<p>Last three attempts returned timeout. Please check device connectivity.</p> |`max(/Windows SNMP/icmpping,#3)=0` |HIGH | |
|High ICMP ping loss |<p>-</p> |`min(/Windows SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/Windows SNMP/icmppingloss,5m)<100` |WARNING |<p>**Depends on**:</p><p>- Unavailable by ICMP ping</p> |
|High ICMP ping response time |<p>-</p> |`avg(/Windows SNMP/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}` |WARNING |<p>**Depends on**:</p><p>- High ICMP ping loss</p><p>- Unavailable by ICMP ping</p> |
-|{#FSNAME}: Disk space is critically low |<p>Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.</p><p> Second condition should be one of the following:</p><p> - The disk free space is less than 5G.</p><p> - The disk will be full in less than 24 hours.</p> |`last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |AVERAGE |<p>Manual close: YES</p> |
-|{#FSNAME}: Disk space is low |<p>Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.</p><p> Second condition should be one of the following:</p><p> - The disk free space is less than 10G.</p><p> - The disk will be full in less than 24 hours.</p> |`last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- {#FSNAME}: Disk space is critically low</p> |
+|{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%) |<p>Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.</p><p> Second condition should be one of the following:</p><p> - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.</p><p> - The disk will be full in less than 24 hours.</p> |`last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |AVERAGE |<p>Manual close: YES</p> |
+|{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%) |<p>Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.</p><p> Second condition should be one of the following:</p><p> - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.</p><p> - The disk will be full in less than 24 hours.</p> |`last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d) ` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- {#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)</p> |
## Feedback
diff --git a/templates/os/windows_snmp/template_os_windows_snmp.yaml b/templates/os/windows_snmp/template_os_windows_snmp.yaml
index 3c85a95d4ca..12f54dfb569 100644
--- a/templates/os/windows_snmp/template_os_windows_snmp.yaml
+++ b/templates/os/windows_snmp/template_os_windows_snmp.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '6.0'
- date: '2022-04-06T19:35:55Z'
+ date: '2022-04-08T09:22:54Z'
groups:
-
uuid: 846977d1dfed4968bc5f8bdb363285bc
@@ -343,7 +343,7 @@ zabbix_export:
name: 'has been restarted'
event_name: '{HOST.NAME} has been restarted (uptime < 10m)'
priority: WARNING
- description: 'Uptime is less than 10 minutes'
+ description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
dependencies:
-
@@ -972,7 +972,7 @@ zabbix_export:
uuid: 597ea2f6059746c0b2e5b7312f764224
expression: |
last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is critically low'
event_name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -980,7 +980,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 5G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
tags:
@@ -994,7 +994,7 @@ zabbix_export:
uuid: 028b24edaf9c4640a2316845f50a4a7e
expression: |
last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
- ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<10G or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
name: '{#FSNAME}: Disk space is low'
event_name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
@@ -1002,7 +1002,7 @@ zabbix_export:
description: |
Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
Second condition should be one of the following:
- - The disk free space is less than 10G.
+ - The disk free space is less than {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}.
- The disk will be full in less than 24 hours.
manual_close: 'YES'
dependencies:
@@ -1010,7 +1010,7 @@ zabbix_export:
name: '{#FSNAME}: Disk space is critically low'
expression: |
last(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
- ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<5G or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
+ ((last(/Windows SNMP/vfs.fs.total[hrStorageSize.{#SNMPINDEX}])-last(/Windows SNMP/vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} or timeleft(/Windows SNMP/vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}],1h,100)<1d)
tags:
-
tag: scope
@@ -1122,7 +1122,7 @@ zabbix_export:
value_type: FLOAT
units: '%'
params: 'last(//vm.memory.used[hrStorageUsed.{#SNMPINDEX}])/last(//vm.memory.total[hrStorageSize.{#SNMPINDEX}])*100'
- description: 'Memory utilization in %'
+ description: 'Memory utilization in %.'
tags:
-
tag: component
@@ -1244,6 +1244,14 @@ zabbix_export:
macro: '{$SNMP.TIMEOUT}'
value: 5m
-
+ macro: '{$VFS.FS.FREE.MIN.CRIT}'
+ value: 5G
+ description: 'The critical threshold of the filesystem utilization.'
+ -
+ macro: '{$VFS.FS.FREE.MIN.WARN}'
+ value: 10G
+ description: 'The warning threshold of the filesystem utilization.'
+ -
macro: '{$VFS.FS.FSNAME.MATCHES}'
value: .+
description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
diff --git a/ui/app/controllers/CControllerActionOperationValidate.php b/ui/app/controllers/CControllerActionOperationValidate.php
index 6e76df33096..9f472922761 100644
--- a/ui/app/controllers/CControllerActionOperationValidate.php
+++ b/ui/app/controllers/CControllerActionOperationValidate.php
@@ -200,6 +200,6 @@ class CControllerActionOperationValidate extends CController {
}
protected function doAction() {
- return $this->setResponse(new CControllerResponseData(['main_block' => json_encode([])]));
+ $this->setResponse(new CControllerResponseData(['main_block' => json_encode([])]));
}
}
diff --git a/ui/app/controllers/CControllerDashboardWidgetEdit.php b/ui/app/controllers/CControllerDashboardWidgetEdit.php
index 1f49cc58228..e45de17423a 100644
--- a/ui/app/controllers/CControllerDashboardWidgetEdit.php
+++ b/ui/app/controllers/CControllerDashboardWidgetEdit.php
@@ -305,16 +305,19 @@ class CControllerDashboardWidgetEdit extends CController {
if ($ids['prototype_graph']) {
$db_graph_prototypes = API::GraphPrototype()->get([
'output' => ['graphid', 'name'],
- 'selectHosts' => ['name'],
+ 'selectHosts' => ['hostid', 'name'],
+ 'selectDiscoveryRule' => ['hostid'],
'graphids' => array_keys($ids['prototype_graph']),
'preservekeys' => true
]);
foreach ($db_graph_prototypes as $graphid => $graph) {
+ $host_names = array_column($graph['hosts'], 'name', 'hostid');
+
foreach ($ids['prototype_graph'][$graphid] as $field_name) {
$captions['ms']['graph_prototypes'][$field_name][$graphid] += [
'name' => $graph['name'],
- 'prefix' => $graph['hosts'][0]['name'].NAME_DELIMITER
+ 'prefix' => $host_names[$graph['discoveryRule']['hostid']].NAME_DELIMITER
];
}
}
diff --git a/ui/app/controllers/CControllerImageCreate.php b/ui/app/controllers/CControllerImageCreate.php
index d5cb211c9e5..50f676647f0 100644
--- a/ui/app/controllers/CControllerImageCreate.php
+++ b/ui/app/controllers/CControllerImageCreate.php
@@ -100,7 +100,8 @@ class CControllerImageCreate extends CController {
$response->setFormData($this->getInputAll());
CMessageHelper::setErrorTitle(_('Cannot add image'));
- return $this->setResponse($response);
+ $this->setResponse($response);
+ return;
}
$options = [
diff --git a/ui/app/controllers/CControllerImageUpdate.php b/ui/app/controllers/CControllerImageUpdate.php
index 1d93a12c37b..ae0485bccd4 100644
--- a/ui/app/controllers/CControllerImageUpdate.php
+++ b/ui/app/controllers/CControllerImageUpdate.php
@@ -110,7 +110,8 @@ class CControllerImageUpdate extends CController {
$response->setFormData($this->getInputAll());
CMessageHelper::setErrorTitle(_('Cannot update image'));
- return $this->setResponse($response);
+ $this->setResponse($response);
+ return;
}
if ($this->hasInput('imageid')) {
diff --git a/ui/app/controllers/CControllerNotificationsGet.php b/ui/app/controllers/CControllerNotificationsGet.php
index 1623c5474ab..a800a832466 100644
--- a/ui/app/controllers/CControllerNotificationsGet.php
+++ b/ui/app/controllers/CControllerNotificationsGet.php
@@ -51,11 +51,7 @@ class CControllerNotificationsGet extends CController {
$ret = $this->validateInput($fields);
if (!$ret) {
- return $this->setResponse(
- new CControllerResponseData([
- 'main_block' => json_encode(['error' => true])
- ])
- );
+ $this->setResponse(new CControllerResponseData(['main_block' => json_encode(['error' => true])]));
}
return $ret;
@@ -67,7 +63,8 @@ class CControllerNotificationsGet extends CController {
protected function doAction() {
if (!$this->settings['enabled']) {
- return $this->setResponse(new CControllerResponseData(['main_block' => $this->makeResponseData()]));
+ $this->setResponse(new CControllerResponseData(['main_block' => $this->makeResponseData()]));
+ return;
}
// Server returns only basic details for events already known by client-side.
diff --git a/ui/app/controllers/CControllerPopupAcknowledgeEdit.php b/ui/app/controllers/CControllerPopupAcknowledgeEdit.php
index 6ddfbd5d9e9..87ec13e9048 100644
--- a/ui/app/controllers/CControllerPopupAcknowledgeEdit.php
+++ b/ui/app/controllers/CControllerPopupAcknowledgeEdit.php
@@ -164,7 +164,7 @@ class CControllerPopupAcknowledgeEdit extends CController {
$data['has_unack_events'] = ($ack_count != count($events));
// Severity can be changed only for editable triggers.
- $data['problem_severity_can_be_changed'] = !!$editable_triggers;
+ $data['problem_severity_can_be_changed'] = (bool) $editable_triggers;
// Add number of selected and related problem events to count of selected resolved events.
$data['related_problems_count'] += API::Problem()->get([
diff --git a/ui/app/controllers/CControllerPopupConditionCommon.php b/ui/app/controllers/CControllerPopupConditionCommon.php
index 4e9c3cddaf4..bb92a7c4cdb 100644
--- a/ui/app/controllers/CControllerPopupConditionCommon.php
+++ b/ui/app/controllers/CControllerPopupConditionCommon.php
@@ -57,14 +57,15 @@ abstract class CControllerPopupConditionCommon extends CController {
protected function doAction() {
if ($this->hasInput('validate')) {
- return $this->setResponse(
+ $this->setResponse(
(new CControllerResponseData(
['main_block' => json_encode($this->getManuallyValidatedFields())]
))->disableView()
);
}
-
- return $this->setResponse(new CControllerResponseData($this->getControllerResponseData()));
+ else {
+ $this->setResponse(new CControllerResponseData($this->getControllerResponseData()));
+ }
}
/**
diff --git a/ui/app/controllers/CControllerPopupDiscoveryCheck.php b/ui/app/controllers/CControllerPopupDiscoveryCheck.php
index d1d6797a0d6..240ca83f767 100644
--- a/ui/app/controllers/CControllerPopupDiscoveryCheck.php
+++ b/ui/app/controllers/CControllerPopupDiscoveryCheck.php
@@ -100,9 +100,10 @@ class CControllerPopupDiscoveryCheck extends CController {
$params['key_'] = $data['snmp_oid'];
}
- return $this->setResponse(
+ $this->setResponse(
(new CControllerResponseData(['main_block' => json_encode(['params' => $params])]))->disableView()
);
+ return;
}
$output = [
diff --git a/ui/app/controllers/CControllerPopupGeneric.php b/ui/app/controllers/CControllerPopupGeneric.php
index 4f8472520ad..d6a83cbfdae 100644
--- a/ui/app/controllers/CControllerPopupGeneric.php
+++ b/ui/app/controllers/CControllerPopupGeneric.php
@@ -1183,11 +1183,13 @@ class CControllerPopupGeneric extends CController {
case 'graph_prototypes':
$options += [
'output' => API_OUTPUT_EXTEND,
- 'selectHosts' => ['name'],
+ 'selectHosts' => ['hostid', 'name'],
'hostids' => $this->hostids ? $this->hostids : null
];
if ($this->source_table === 'graph_prototypes') {
+ $options['selectDiscoveryRule'] = ['hostid'];
+
$records = (!$this->host_preselect_required || $this->hostids)
? API::GraphPrototype()->get($options)
: [];
diff --git a/ui/app/controllers/CControllerPopupMassupdateHost.php b/ui/app/controllers/CControllerPopupMassupdateHost.php
index 26b8c9081f3..2114ccb39a5 100644
--- a/ui/app/controllers/CControllerPopupMassupdateHost.php
+++ b/ui/app/controllers/CControllerPopupMassupdateHost.php
@@ -25,7 +25,7 @@ class CControllerPopupMassupdateHost extends CControllerPopupMassupdateAbstract
protected function checkInput(): bool {
$fields = [
- 'ids' => 'required|array',
+ 'hostids' => 'required|array',
'update' => 'in 1',
'visible' => 'array',
'tags' => 'array',
@@ -87,7 +87,7 @@ class CControllerPopupMassupdateHost extends CControllerPopupMassupdateAbstract
protected function checkPermissions(): bool {
$hosts = API::Host()->get([
'output' => [],
- 'hostids' => $this->getInput('ids'),
+ 'hostids' => $this->getInput('hostids'),
'editable' => true
]);
@@ -97,7 +97,7 @@ class CControllerPopupMassupdateHost extends CControllerPopupMassupdateAbstract
protected function doAction(): void {
if ($this->hasInput('update')) {
$output = [];
- $hostids = $this->getInput('ids');
+ $hostids = $this->getInput('hostids');
$visible = $this->getInput('visible', []);
$macros = array_filter(cleanInheritedMacros($this->getInput('macros', [])),
function (array $macro): bool {
@@ -476,7 +476,7 @@ class CControllerPopupMassupdateHost extends CControllerPopupMassupdateAbstract
'user' => [
'debug_mode' => $this->getDebugMode()
],
- 'ids' => $this->getInput('ids'),
+ 'ids' => $this->getInput('hostids'),
'inventories' => zbx_toHash(getHostInventories(), 'db_field'),
'location_url' => (new CUrl('zabbix.php'))
->setArgument('action', 'host.list')
diff --git a/ui/app/controllers/CControllerProfileUpdate.php b/ui/app/controllers/CControllerProfileUpdate.php
index 60e1212be30..ad04b95ec96 100644
--- a/ui/app/controllers/CControllerProfileUpdate.php
+++ b/ui/app/controllers/CControllerProfileUpdate.php
@@ -91,7 +91,7 @@ class CControllerProfileUpdate extends CController {
case 'web.dashboard.widget.geomap.default_view':
case 'web.dashboard.widget.geomap.severity_filter':
- case !!preg_match('/web.dashboard.widget.navtree.item-\d+.toggle/', $this->getInput('idx')):
+ case (bool) preg_match('/web.dashboard.widget.navtree.item-\d+.toggle/', $this->getInput('idx')):
case 'web.dashboard.widget.navtree.item.selected':
$ret = $this->hasInput('idx2');
break;
@@ -145,7 +145,7 @@ class CControllerProfileUpdate extends CController {
break;
// PROFILE_TYPE_INT
- case !!preg_match('/web.dashboard.widget.navtree.item-\d+.toggle/', $this->getInput('idx')):
+ case (bool) preg_match('/web.dashboard.widget.navtree.item-\d+.toggle/', $this->getInput('idx')):
$value_int = $this->getInput('value_int');
if ($value_int == 1) { // default value
CProfile::delete($idx, $this->getInput('idx2'));
diff --git a/ui/app/controllers/CControllerWidgetIteratorGraphPrototypeView.php b/ui/app/controllers/CControllerWidgetIteratorGraphPrototypeView.php
index fd129d8fb66..143f506a6ca 100644
--- a/ui/app/controllers/CControllerWidgetIteratorGraphPrototypeView.php
+++ b/ui/app/controllers/CControllerWidgetIteratorGraphPrototypeView.php
@@ -63,7 +63,7 @@ class CControllerWidgetIteratorGraphPrototypeView extends CControllerWidgetItera
protected function doGraphPrototype(array $fields) {
$options = [
'output' => ['graphid', 'name'],
- 'selectHosts' => ['name'],
+ 'selectHosts' => ['hostid', 'name'],
'selectDiscoveryRule' => ['hostid']
];
@@ -161,9 +161,12 @@ class CControllerWidgetIteratorGraphPrototypeView extends CControllerWidgetItera
$widget_name = $this->getInput('name');
}
else {
+ $host_names = array_column($graph_prototype['hosts'], 'name', 'hostid');
+ $host_name = $host_names[$graph_prototype['discoveryRule']['hostid']];
+
$widget_name = $is_template_dashboard
? $graph_prototype['name']
- : $graph_prototype['hosts'][0]['name'].NAME_DELIMITER.$graph_prototype['name'];
+ : $host_name.NAME_DELIMITER.$graph_prototype['name'];
}
return [
diff --git a/ui/app/controllers/CControllerWidgetTopHostsView.php b/ui/app/controllers/CControllerWidgetTopHostsView.php
index 45bae944758..8d6368609bf 100644
--- a/ui/app/controllers/CControllerWidgetTopHostsView.php
+++ b/ui/app/controllers/CControllerWidgetTopHostsView.php
@@ -76,8 +76,11 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
$time_now = time();
- $master_items = self::getItems($configuration[$fields['column']]['item'], $groupids, $hostids);
- $master_item_values = self::getItemValues($master_items, $configuration[$fields['column']], $time_now);
+ $master_column = $configuration[$fields['column']];
+ $master_items_only_numeric_allowed = self::isNumericOnlyColumn($master_column);
+
+ $master_items = self::getItems($master_column['item'], $master_items_only_numeric_allowed, $groupids, $hostids);
+ $master_item_values = self::getItemValues($master_items, $master_column, $time_now);
if (!$master_item_values) {
return [
@@ -86,17 +89,33 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
];
}
+ $master_items_only_numeric_present = $master_items_only_numeric_allowed && !array_filter($master_items,
+ static function(array $item): bool {
+ return !in_array($item['value_type'], [ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64]);
+ }
+ );
+
if ($fields['order'] == CWidgetFormTopHosts::ORDER_TOPN) {
- arsort($master_item_values, SORT_NUMERIC);
+ if ($master_items_only_numeric_present) {
+ arsort($master_item_values, SORT_NUMERIC);
- $master_items_min = end($master_item_values);
- $master_items_max = reset($master_item_values);
+ $master_items_min = end($master_item_values);
+ $master_items_max = reset($master_item_values);
+ }
+ else {
+ asort($master_item_values, SORT_NATURAL);
+ }
}
else {
- asort($master_item_values, SORT_NUMERIC);
+ if ($master_items_only_numeric_present) {
+ asort($master_item_values, SORT_NUMERIC);
- $master_items_min = reset($master_item_values);
- $master_items_max = end($master_item_values);
+ $master_items_min = reset($master_item_values);
+ $master_items_max = end($master_item_values);
+ }
+ else {
+ arsort($master_item_values, SORT_NATURAL);
+ }
}
$master_item_values = array_slice($master_item_values, 0, $fields['count'], true);
@@ -154,9 +173,10 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
}
}
else {
+ $numeric_only = self::isNumericOnlyColumn($column);
$column_items = !$calc_extremes || $column['min'] !== '' && $column['max'] !== ''
- ? self::getItems($column['item'], $groupids, array_keys($master_hostids))
- : self::getItems($column['item'], $groupids, $hostids);
+ ? self::getItems($column['item'], $numeric_only, $groupids, array_keys($master_hostids))
+ : self::getItems($column['item'], $numeric_only, $groupids, $hostids);
$column_item_values = self::getItemValues($column_items, $column, $time_now);
@@ -250,13 +270,25 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
}
/**
+ * @param array $column
+ *
+ * @return bool
+ */
+ private static function isNumericOnlyColumn(array $column): bool {
+ return $column['aggregate_function'] != AGGREGATE_NONE
+ || $column['display'] != CWidgetFieldColumnsList::DISPLAY_AS_IS
+ || array_key_exists('thresholds', $column);
+ }
+
+ /**
* @param string $name
+ * @param bool $numeric_only
* @param array|null $groupids
* @param array|null $hostids
*
* @return array
*/
- private static function getItems(string $name, ?array $groupids, ?array $hostids): array {
+ private static function getItems(string $name, bool $numeric_only, ?array $groupids, ?array $hostids): array {
$items = API::Item()->get([
'output' => ['itemid', 'hostid', 'key_', 'history', 'trends', 'value_type', 'units'],
'selectValueMap' => ['mappings'],
@@ -267,7 +299,7 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
'filter' => [
'name' => $name,
'status' => ITEM_STATUS_ACTIVE,
- 'value_type' => [ITEM_VALUE_TYPE_UINT64, ITEM_VALUE_TYPE_FLOAT]
+ 'value_type' => $numeric_only ? [ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64] : null
],
'sortfield' => 'key_',
'preservekeys' => true
@@ -318,18 +350,30 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
$result = [];
- if ($timeshift == 0 && $column['aggregate_function'] == AGGREGATE_NONE) {
+ if ($column['aggregate_function'] == AGGREGATE_NONE) {
$items_by_source = ['history' => [], 'trends' => []];
foreach ($items as $itemid => $item) {
$items_by_source[$item['source']][$itemid] = $item;
}
- $values = Manager::History()->getLastValues($items_by_source['history'], 1, $history_period);
- $values = array_column(array_column($values, 0), 'value', 'itemid');
+ if ($timeshift != 0) {
+ $values = [];
- $result += $values;
+ foreach ($items_by_source['history'] as $itemid => $item) {
+ $history = Manager::History()->getValueAt($item, $time_to, 0);
+
+ if (is_array($history)) {
+ $values[$itemid] = $history['value'];
+ }
+ }
+ }
+ else {
+ $values = Manager::History()->getLastValues($items_by_source['history'], 1, $history_period);
+ $values = array_column(array_column($values, 0), 'value', 'itemid');
+ }
+ $result += $values;
$items = $items_by_source['trends'];
}
@@ -355,7 +399,10 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
if ($data_source == CWidgetFieldColumnsList::HISTORY_DATA_HISTORY
|| $data_source == CWidgetFieldColumnsList::HISTORY_DATA_TRENDS) {
foreach ($items as &$item) {
- $item['source'] = $data_source == CWidgetFieldColumnsList::HISTORY_DATA_HISTORY ? 'history' : 'trends';
+ $item['source'] = $data_source == CWidgetFieldColumnsList::HISTORY_DATA_TRENDS
+ && ($item['value_type'] == ITEM_VALUE_TYPE_FLOAT || $item['value_type'] == ITEM_VALUE_TYPE_UINT64)
+ ? 'trends'
+ : 'history';
}
unset($item);
@@ -401,7 +448,7 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
$processed_items = [];
- foreach ($items as $item) {
+ foreach ($items as $itemid => $item) {
if (!$global_trends_time) {
$item['history'] = timeUnitToSeconds($item['history']);
@@ -426,7 +473,7 @@ class CControllerWidgetTopHostsView extends CControllerWidget {
}
}
- $processed_items[] = $item;
+ $processed_items[$itemid] = $item;
}
$items = $processed_items;
diff --git a/ui/app/partials/layout.htmlpage.header.php b/ui/app/partials/layout.htmlpage.header.php
index b6c891ec210..621bd06563e 100644
--- a/ui/app/partials/layout.htmlpage.header.php
+++ b/ui/app/partials/layout.htmlpage.header.php
@@ -34,7 +34,7 @@ if (isset($ZBX_SERVER_NAME) && $ZBX_SERVER_NAME !== '') {
$page_title = $ZBX_SERVER_NAME.NAME_DELIMITER.$page_title;
}
-$pageHeader = new CPageHeader($page_title);
+$pageHeader = new CPageHeader($page_title, CWebUser::getLang());
if (!empty($DB['DB'])) {
$theme = getUserTheme($data['user']);
@@ -83,4 +83,4 @@ if ($scripts) {
$pageHeader->display();
-echo '<body lang="'.CWebUser::getLang().'">';
+echo '<body>';
diff --git a/ui/app/views/configuration.host.list.php b/ui/app/views/configuration.host.list.php
index 8218f339f26..7effd7c68ba 100644
--- a/ui/app/views/configuration.host.list.php
+++ b/ui/app/views/configuration.host.list.php
@@ -54,7 +54,7 @@ $filter = (new CFilter())
->setResetUrl($action_url)
->setProfile($data['profileIdx'])
->setActiveTab($data['active_tab'])
- ->addVar('action', $data['action'])
+ ->addVar('action', $data['action'], 'filter_action')
->addFilterTab(_('Filter'), [
(new CFormGrid())
->addClass(CFormGrid::ZBX_STYLE_FORM_GRID_LABEL_WIDTH_TRUE)
@@ -169,7 +169,7 @@ $widget->addItem($filter);
// table hosts
$form = (new CForm())->setName('hosts');
-$header_checkbox = (new CCheckBox('all_hosts'))->onClick("checkAll('".$form->getName()."', 'all_hosts', 'ids');");
+$header_checkbox = (new CCheckBox('all_hosts'))->onClick("checkAll('".$form->getName()."', 'all_hosts', 'hostids');");
$show_monitored_by = ($data['filter']['monitored_by'] == ZBX_MONITORED_BY_PROXY
|| $data['filter']['monitored_by'] == ZBX_MONITORED_BY_ANY);
$header_sortable_name = make_sorting_header(_('Name'), 'name', $data['sortField'], $data['sortOrder'],
@@ -420,7 +420,7 @@ foreach ($data['hosts'] as $host) {
}
$table->addRow([
- new CCheckBox('ids['.$host['hostid'].']', $host['hostid']),
+ new CCheckBox('hostids['.$host['hostid'].']', $host['hostid']),
(new CCol($description))->addClass(ZBX_STYLE_NOWRAP),
[
new CLink(_('Items'),
@@ -492,7 +492,7 @@ $status_toggle_url = (new CUrl('zabbix.php'))
$form->addItem([
$table,
$data['paging'],
- new CActionButtonList('action', 'ids', [
+ new CActionButtonList('action', 'hostids', [
'enable-hosts' => [
'name' => _('Enable'),
'confirm' => _('Enable selected hosts?'),
diff --git a/ui/app/views/js/popup.massupdate.js.php b/ui/app/views/js/popup.massupdate.js.php
index ec1cb547f4c..393148ad94e 100644
--- a/ui/app/views/js/popup.massupdate.js.php
+++ b/ui/app/views/js/popup.massupdate.js.php
@@ -357,36 +357,6 @@ $('#tabs').on('tabsactivate', (event, ui) => {
toggleVisible(obj, obj.querySelector('[name=valuemap_massupdate]:checked').value);
})();
-function visibility_status_changeds(value, obj_id, replace_to) {
- const obj = document.getElementById(obj_id);
- if (obj === null) {
- throw `Cannot find objects with name [${obj_id}]`;
- }
-
- if (replace_to && replace_to != '') {
- if (obj.originalObject) {
- const old_obj = obj.originalObject;
- old_obj.originalObject = obj;
- obj.parentNode.replaceChild(old_obj, obj);
- }
- else if (!value) {
- const new_obj = document.createElement('span');
- new_obj.setAttribute('name', obj.name);
- new_obj.setAttribute('id', obj.id);
-
- new_obj.innerHTML = replace_to;
- new_obj.originalObject = obj;
- obj.parentNode.replaceChild(new_obj, obj);
- }
- else {
- throw 'Missing originalObject for restoring';
- }
- }
- else {
- obj.style.visibility = value ? 'visible' : 'hidden';
- }
-}
-
if (!CR && !GK) {
$("textarea[maxlength]").bind("paste contextmenu change keydown keypress keyup", function() {
var elem = $(this);
diff --git a/ui/app/views/js/popup.tophosts.column.edit.js.php b/ui/app/views/js/popup.tophosts.column.edit.js.php
index 1c53fae1f11..fbdf8bef6c3 100644
--- a/ui/app/views/js/popup.tophosts.column.edit.js.php
+++ b/ui/app/views/js/popup.tophosts.column.edit.js.php
@@ -26,8 +26,8 @@ window.tophosts_column_edit_form = new class {
this._$widget_form = $(`form[name="${form_name}"]`);
this._$thresholds_table = this._$widget_form.find('#thresholds_table');
- $('[name="display"],[name="data"],[name="aggregate_function"]', this._$widget_form).on('change', () => {
- this.updateAccessibility();
+ $('[name="data"], [name="aggregate_function"], [name="display"]', this._$widget_form).on('change', () => {
+ this._update();
});
colorPalette.setThemeColors(thresholds_colors);
@@ -46,21 +46,28 @@ window.tophosts_column_edit_form = new class {
$(colorpicker).colorpicker({appendTo: $(colorpicker).closest('.input-color-picker')});
});
- this._$thresholds_table.on('afteradd.dynamicRows', e => {
- const $colorpicker = $('tr.form_row:last input[name$="[color]"]', e.target);
+ this._$thresholds_table
+ .on('afteradd.dynamicRows', e => {
+ const $colorpicker = $('tr.form_row:last input[name$="[color]"]', e.target);
- $colorpicker.colorpicker({appendTo: $colorpicker.closest('.input-color-picker')});
- });
+ $colorpicker.colorpicker({appendTo: $colorpicker.closest('.input-color-picker')});
+
+ this._update();
+ })
+ .on('afterremove.dynamicRows', () => this._update());
this._$widget_form.on('process.form', (e, overlay) => {
this.handleFormSubmit(e, overlay);
});
// Initialize form elements accessibility.
- this.updateAccessibility();
+ this._update();
+
+ this._$widget_form[0].style.display = '';
+ this._$widget_form[0].querySelector('[name="name"]').focus();
}
- updateAccessibility() {
+ _update() {
const display_as_is = ($('[name="display"]:checked').val() == <?= CWidgetFieldColumnsList::DISPLAY_AS_IS ?>);
const data_item_value = ($('[name="data"]').val() == <?= CWidgetFieldColumnsList::DATA_ITEM_VALUE ?>);
const data_text = ($('[name="data"]').val() == <?= CWidgetFieldColumnsList::DATA_TEXT ?>);
@@ -75,6 +82,16 @@ window.tophosts_column_edit_form = new class {
this._$thresholds_table.toggleClass('disabled', !data_item_value);
$('[name$="[color]"],[name$="[threshold]"],button', this._$thresholds_table).attr('disabled', !data_item_value);
+ // Toggle warning icons for non-numeric items settings.
+ if (data_item_value) {
+ document.getElementById('tophosts-column-aggregate-function-warning').style.display = no_aggregate_function
+ ? 'none'
+ : '';
+ document.getElementById('tophosts-column-display-warning').style.display = display_as_is ? 'none' : '';
+ document.getElementById('tophosts-column-thresholds-warning').style.display =
+ this._$thresholds_table[0].rows.length > 2 ? '' : 'none';
+ }
+
// Toggle visibility of disabled form elements.
$('.form-grid > label', this._$widget_form).each((i, elm) => {
const form_field = $(elm).next();
diff --git a/ui/app/views/popup.generic.php b/ui/app/views/popup.generic.php
index b5c37b4b056..017049ba943 100644
--- a/ui/app/views/popup.generic.php
+++ b/ui/app/views/popup.generic.php
@@ -526,12 +526,25 @@ switch ($data['popup_type']) {
$graphtype
]);
+ if ($options['patternselect']) {
+ $graph_name = $graph['name'];
+ }
+ else {
+ if ($data['popup_type'] === 'graphs') {
+ $host_name = $graph['hosts'][0]['name'];
+ }
+ else {
+ $host_names = array_column($graph['hosts'], 'name', 'hostid');
+ $host_name = $host_names[$graph['discoveryRule']['hostid']];
+ }
+
+ $graph_name = $host_name.NAME_DELIMITER.$graph['name'];
+ }
+
// For returned data array.
$graph = [
'id' => $graph['graphid'],
- 'name' => $options['patternselect']
- ? $graph['name']
- : reset($graph['hosts'])['name'].NAME_DELIMITER.$graph['name']
+ 'name' => $graph_name
];
}
unset($graph);
diff --git a/ui/app/views/popup.lldoperation.php b/ui/app/views/popup.lldoperation.php
index 054a3769adb..312cbe42439 100644
--- a/ui/app/views/popup.lldoperation.php
+++ b/ui/app/views/popup.lldoperation.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added in main page. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
$output = [
'header' => $data['title']
];
diff --git a/ui/app/views/popup.massupdate.host.php b/ui/app/views/popup.massupdate.host.php
index 321ad09e26b..0a7fe333594 100644
--- a/ui/app/views/popup.massupdate.host.php
+++ b/ui/app/views/popup.massupdate.host.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
// create form
$form = (new CForm())
->setId('massupdate-form')
diff --git a/ui/app/views/popup.massupdate.item.php b/ui/app/views/popup.massupdate.item.php
index 60dab355873..e850ed410dc 100644
--- a/ui/app/views/popup.massupdate.item.php
+++ b/ui/app/views/popup.massupdate.item.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
// Create form.
$form = (new CForm())
->setId('massupdate-form')
diff --git a/ui/app/views/popup.massupdate.service.php b/ui/app/views/popup.massupdate.service.php
index e67314bec37..c2b4a30d270 100644
--- a/ui/app/views/popup.massupdate.service.php
+++ b/ui/app/views/popup.massupdate.service.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
// create form
$form = (new CForm())
->setId('massupdate-form')
diff --git a/ui/app/views/popup.massupdate.template.php b/ui/app/views/popup.massupdate.template.php
index c03c4262d07..9f426a725c3 100644
--- a/ui/app/views/popup.massupdate.template.php
+++ b/ui/app/views/popup.massupdate.template.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
// Create form.
$form = (new CForm())
->setId('massupdate-form')
diff --git a/ui/app/views/popup.massupdate.trigger.php b/ui/app/views/popup.massupdate.trigger.php
index 4bed8a3afaf..e320f350496 100644
--- a/ui/app/views/popup.massupdate.trigger.php
+++ b/ui/app/views/popup.massupdate.trigger.php
@@ -23,9 +23,6 @@
* @var CView $this
*/
-// Visibility box javascript is already added. It should not be added in popup response.
-define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
// Create form.
$form = (new CForm())
->setId('massupdate-form')
diff --git a/ui/app/views/popup.tophosts.column.edit.php b/ui/app/views/popup.tophosts.column.edit.php
index 649638f728a..a0af02d5aac 100644
--- a/ui/app/views/popup.tophosts.column.edit.php
+++ b/ui/app/views/popup.tophosts.column.edit.php
@@ -26,6 +26,7 @@
$form = (new CForm())
->setName('tophosts_column')
+ ->addStyle('display: none;')
->addVar('action', $data['action'])
->addVar('update', 1)
->addItem(
@@ -88,9 +89,7 @@ $item_select = (new CPatternSelect([
'srctbl' => 'items',
'srcfld1' => 'itemid',
'real_hosts' => 1,
- 'numeric' => 1,
'webitems' => 1,
- 'orig_names' => 1,
'dstfrm' => $form->getName(),
'dstfld1' => 'item'
]
@@ -115,9 +114,17 @@ $form_grid->addItem([
)
]);
+$numeric_only_warning = new CSpan([
+ '&nbsp;',
+ makeWarningIcon(_('With this setting only numeric items will be displayed in this column.'))
+]);
+
// Aggregation function.
$form_grid->addItem([
- new CLabel(_('Aggregation function'), 'aggregate_function'),
+ new CLabel([
+ _('Aggregation function'),
+ $numeric_only_warning->setId('tophosts-column-aggregate-function-warning')
+ ], 'aggregate_function'),
new CFormField(
(new CSelect('aggregate_function'))
->setValue($data['aggregate_function'])
@@ -144,7 +151,10 @@ $form_grid->addItem([
// Display.
$form_grid->addItem([
- new CLabel(_('Display'), 'display'),
+ new CLabel([
+ _('Display'),
+ $numeric_only_warning->setId('tophosts-column-display-warning')
+ ], 'display'),
new CFormField(
(new CRadioButtonList('display', (int) $data['display']))
->addValue(_('As is'), CWidgetFieldColumnsList::DISPLAY_AS_IS)
@@ -156,7 +166,12 @@ $form_grid->addItem([
// History data.
$form_grid->addItem([
- new CLabel(_('History data'), 'history'),
+ new CLabel([
+ _('History data'),
+ makeHelpIcon(
+ _('This setting applies only to numeric data. Non-numeric data will always be taken from history.')
+ )
+ ], 'history'),
new CFormField(
(new CRadioButtonList('history', (int) $data['history']))
->addValue(_('Auto'), CWidgetFieldColumnsList::HISTORY_DATA_AUTO)
@@ -229,7 +244,10 @@ $thresholds->addItem(
);
$form_grid->addItem([
- new CLabel(_('Thresholds'), 'thresholds_table'),
+ new CLabel([
+ _('Thresholds'),
+ $numeric_only_warning->setId('tophosts-column-thresholds-warning')
+ ], 'thresholds_table'),
new CFormField($thresholds)
]);
diff --git a/ui/app/views/system.warning.php b/ui/app/views/system.warning.php
index e25a79c69ed..69d7f4409ae 100644
--- a/ui/app/views/system.warning.php
+++ b/ui/app/views/system.warning.php
@@ -23,7 +23,7 @@
* @var CView $this
*/
-$pageHeader = (new CPageHeader(_('Fatal error, please report to the Zabbix team')))
+$pageHeader = (new CPageHeader(_('Fatal error, please report to the Zabbix team'), CWebUser::getLang()))
->addCssFile('assets/styles/'.CHtml::encode($data['theme']).'.css')
->display();
@@ -32,7 +32,7 @@ $buttons = [
->onClick('javascript: document.location = "'.CMenuHelper::getFirstUrl().'"'
)];
-echo '<body lang="'.CWebUser::getLang().'">';
+echo '<body';
(new CDiv((new CTag('main', true,
new CWarning(_('Fatal error, please report to the Zabbix team'), $data['messages'], $buttons)
diff --git a/ui/assets/styles/blue-theme.css b/ui/assets/styles/blue-theme.css
index 913043c8e32..cfbbcdc20f2 100644
--- a/ui/assets/styles/blue-theme.css
+++ b/ui/assets/styles/blue-theme.css
@@ -6381,7 +6381,7 @@ button.icon-action-command, button.icon-action-close, button.icon-action-msg, bu
/* Special styling for WebKit/Blink */ }
.range-control input[type=range]:focus {
outline: none; }
- .range-control input[type=range]::-webkit-slider-thumb {
+ .range-control input[type=range]::-webkit-slider-thumb, .range-control input[type=range]::-moz-range-thumb {
margin-top: 1px;
/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
height: 10px;
diff --git a/ui/assets/styles/dark-theme.css b/ui/assets/styles/dark-theme.css
index 814a3b29248..c10a02e0e61 100644
--- a/ui/assets/styles/dark-theme.css
+++ b/ui/assets/styles/dark-theme.css
@@ -6392,7 +6392,7 @@ button.icon-action-command, button.icon-action-close, button.icon-action-msg, bu
/* Special styling for WebKit/Blink */ }
.range-control input[type=range]:focus {
outline: none; }
- .range-control input[type=range]::-webkit-slider-thumb {
+ .range-control input[type=range]::-webkit-slider-thumb, .range-control input[type=range]::-moz-range-thumb {
margin-top: 1px;
/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
height: 10px;
diff --git a/ui/assets/styles/hc-dark.css b/ui/assets/styles/hc-dark.css
index 109097b67c0..e8c243e8f37 100644
--- a/ui/assets/styles/hc-dark.css
+++ b/ui/assets/styles/hc-dark.css
@@ -6338,7 +6338,7 @@ button.icon-action-command, button.icon-action-close, button.icon-action-msg, bu
/* Special styling for WebKit/Blink */ }
.range-control input[type=range]:focus {
outline: none; }
- .range-control input[type=range]::-webkit-slider-thumb {
+ .range-control input[type=range]::-webkit-slider-thumb, .range-control input[type=range]::-moz-range-thumb {
margin-top: 1px;
/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
height: 10px;
diff --git a/ui/assets/styles/hc-light.css b/ui/assets/styles/hc-light.css
index 91277e414ed..74d92a1d53e 100644
--- a/ui/assets/styles/hc-light.css
+++ b/ui/assets/styles/hc-light.css
@@ -6338,7 +6338,7 @@ button.icon-action-command, button.icon-action-close, button.icon-action-msg, bu
/* Special styling for WebKit/Blink */ }
.range-control input[type=range]:focus {
outline: none; }
- .range-control input[type=range]::-webkit-slider-thumb {
+ .range-control input[type=range]::-webkit-slider-thumb, .range-control input[type=range]::-moz-range-thumb {
margin-top: 1px;
/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
height: 10px;
diff --git a/ui/graphs.php b/ui/graphs.php
index 88549c6035f..82531e33913 100644
--- a/ui/graphs.php
+++ b/ui/graphs.php
@@ -555,7 +555,7 @@ elseif (isset($_REQUEST['form'])) {
// templates
$flag = ($data['parent_discoveryid'] === null) ? ZBX_FLAG_DISCOVERY_NORMAL : ZBX_FLAG_DISCOVERY_PROTOTYPE;
$data['templates'] = makeGraphTemplatesHtml($graph['graphid'], getGraphParentTemplates([$graph], $flag),
- $flag, CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES), $data['context']
+ $flag, CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES)
);
// items
@@ -593,7 +593,6 @@ elseif (isset($_REQUEST['form'])) {
$data['visible'] = getRequest('visible');
$data['percent_left'] = 0;
$data['percent_right'] = 0;
- $data['visible'] = getRequest('visible');
$data['items'] = $gitems;
$data['discover'] = getRequest('discover', DB::getDefault('graphs', 'discover'));
$data['templates'] = [];
diff --git a/ui/httpconf.php b/ui/httpconf.php
index 69dce50998d..90717e6acb6 100644
--- a/ui/httpconf.php
+++ b/ui/httpconf.php
@@ -499,8 +499,7 @@ if (isset($_REQUEST['form'])) {
$data['retries'] = $db_httptest['retries'];
$data['status'] = $db_httptest['status'];
$data['templates'] = makeHttpTestTemplatesHtml($db_httptest['httptestid'],
- getHttpTestParentTemplates($db_httptests), CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES),
- $data['context']
+ getHttpTestParentTemplates($db_httptests), CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES)
);
$data['agent'] = ZBX_AGENT_OTHER;
diff --git a/ui/include/classes/api/clients/CLocalApiClient.php b/ui/include/classes/api/clients/CLocalApiClient.php
index 9fb9cf1321e..ea3a4f3a19f 100644
--- a/ui/include/classes/api/clients/CLocalApiClient.php
+++ b/ui/include/classes/api/clients/CLocalApiClient.php
@@ -165,7 +165,8 @@ class CLocalApiClient extends CApiClient {
}
if (strlen($auth) == 64) {
- return $this->tokenAuthentication($auth);
+ $this->tokenAuthentication($auth);
+ return;
}
$user = $this->serviceFactory->getObject('user')->checkAuthentication(['sessionid' => $auth]);
diff --git a/ui/include/classes/api/services/CDiscoveryRule.php b/ui/include/classes/api/services/CDiscoveryRule.php
index 80053c264d4..7d906a2ebc8 100644
--- a/ui/include/classes/api/services/CDiscoveryRule.php
+++ b/ui/include/classes/api/services/CDiscoveryRule.php
@@ -1370,7 +1370,7 @@ class CDiscoveryRule extends CItemGeneral {
// If same "lld_macro" is found in DB, update only "path" if necessary.
if (array_key_exists('path', $lld_macro_path)
- && $lld_macro_path['path'] !== $lld_macro_path['path']) {
+ && $lld_macro_path['path'] !== $db_lld_macro_path['path']) {
$fields_to_update['path'] = $lld_macro_path['path'];
}
}
diff --git a/ui/include/classes/api/services/CItem.php b/ui/include/classes/api/services/CItem.php
index 16b2d830adc..1978de8374e 100644
--- a/ui/include/classes/api/services/CItem.php
+++ b/ui/include/classes/api/services/CItem.php
@@ -335,7 +335,7 @@ class CItem extends CItemGeneral {
$sqlParts['from']['hosts'] = 'hosts h';
$sqlParts['where']['hi'] = 'h.hostid=i.hostid';
- $sqlParts['where']['h'] = dbConditionString('h.host', $options['filter']['host'], false, true);
+ $sqlParts['where']['h'] = dbConditionString('h.host', $options['filter']['host']);
}
if (array_key_exists('flags', $options['filter'])
diff --git a/ui/include/classes/api/services/CMediatype.php b/ui/include/classes/api/services/CMediatype.php
index b1a0daecd24..a7ca68ebad5 100644
--- a/ui/include/classes/api/services/CMediatype.php
+++ b/ui/include/classes/api/services/CMediatype.php
@@ -623,7 +623,7 @@ class CMediatype extends CApiService {
'exec_params' => ['type' => API_STRING_UTF8, 'in' => DB::getDefault('media_type', 'exec_params')],
'content_type' => ['type' => API_INT32, 'in' => DB::getDefault('media_type', 'content_type')],
'script' => ['type' => API_STRING_UTF8, 'in' => DB::getDefault('media_type', 'script')],
- 'timeout' => ['type' => API_TIME_UNIT, 'in' => DB::getDefault('media_type', 'timeout')],
+ 'timeout' => ['type' => API_TIME_UNIT, 'in' => timeUnitToSeconds(DB::getDefault('media_type', 'timeout'))],
'process_tags' => ['type' => API_INT32, 'in' => DB::getDefault('media_type', 'process_tags')],
'show_event_menu' => ['type' => API_INT32, 'in' => DB::getDefault('media_type', 'show_event_menu')],
'event_menu_url' => ['type' => API_STRING_UTF8, 'in' => DB::getDefault('media_type', 'event_menu_url')],
diff --git a/ui/include/classes/api/services/CUser.php b/ui/include/classes/api/services/CUser.php
index ade7db03260..808f604d69e 100644
--- a/ui/include/classes/api/services/CUser.php
+++ b/ui/include/classes/api/services/CUser.php
@@ -1633,9 +1633,7 @@ class CUser extends CApiService {
public function loginByUsername($username, $case_sensitive = null, $default_auth = null) {
// Check whether the method is called via an API call or from a local php file.
if ($case_sensitive === null || $default_auth === null) {
- return self::exception(ZBX_API_ERROR_PARAMETERS,
- _s('Incorrect method "%1$s.%2$s".', 'user', 'loginByUsername')
- );
+ self::exception(ZBX_API_ERROR_PARAMETERS, _s('Incorrect method "%1$s.%2$s".', 'user', 'loginByUsername'));
}
$user_data = $this->findAccessibleUser($username, $case_sensitive, $default_auth, false);
diff --git a/ui/include/classes/core/APP.php b/ui/include/classes/core/APP.php
index ce69f68132f..2ed56c0a7b5 100644
--- a/ui/include/classes/core/APP.php
+++ b/ui/include/classes/core/APP.php
@@ -19,8 +19,8 @@
**/
-if (version_compare(PHP_VERSION, '7.2.0', '<')) {
- echo sprintf('Minimum required PHP version is %1$s.', '7.2.0');
+if (version_compare(PHP_VERSION, '7.2.5', '<')) {
+ echo sprintf('Minimum required PHP version is %1$s.', '7.2.5');
exit;
}
diff --git a/ui/include/classes/data/CItemData.php b/ui/include/classes/data/CItemData.php
index dda8493f576..7deb756d420 100644
--- a/ui/include/classes/data/CItemData.php
+++ b/ui/include/classes/data/CItemData.php
@@ -430,9 +430,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_DB_MONITOR => [
'js-item-delay-label',
@@ -448,19 +447,17 @@ final class CItemData {
'password',
'js-item-sql-query-label',
'js-item-sql-query-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
['id' => 'key', 'defaultValue' => $data['is_discovery_rule']
? ZBX_DEFAULT_KEY_DB_MONITOR_DISCOVERY
: ZBX_DEFAULT_KEY_DB_MONITOR
- ]
+ ],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_DEPENDENT => [
'js-item-master-item-label',
'js-item-master-item-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_EXTERNAL => [
'js-item-interface-label',
@@ -471,9 +468,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_HTTPAGENT => [
'js-item-url-label',
@@ -522,13 +518,12 @@ final class CItemData {
'js-item-interface-label',
'js-item-interface-field',
'interfaceid',
- 'js-item-trends-label',
- 'js-item-trends-field',
'js-item-allow-traps-label',
'js-item-allow-traps-field',
'allow_traps',
'trapper_hosts',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_INTERNAL => [
'js-item-delay-label',
@@ -536,9 +531,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_IPMI => [
'js-item-interface-label',
@@ -552,9 +546,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_JMX => [
'js-item-interface-label',
@@ -574,9 +567,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_SCRIPT => [
'js-item-parameters-label',
@@ -590,9 +582,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_SIMPLE => [
'js-item-delay-label',
@@ -609,9 +600,8 @@ final class CItemData {
'js-item-password-label',
'js-item-password-field',
'password',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_SNMP => [
'js-item-interface-label',
@@ -625,17 +615,15 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_SNMPTRAP => [
'js-item-interface-label',
'js-item-interface-field',
'interfaceid',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_SSH => [
'js-item-interface-label',
@@ -657,10 +645,9 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
'params_script',
- ['id' => 'key', 'defaultValue' => ZBX_DEFAULT_KEY_SSH]
+ ['id' => 'key', 'defaultValue' => ZBX_DEFAULT_KEY_SSH],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_TELNET => [
'js-item-interface-label',
@@ -679,18 +666,16 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
'params_script',
- ['id' => 'key', 'defaultValue' => ZBX_DEFAULT_KEY_TELNET]
+ ['id' => 'key', 'defaultValue' => ZBX_DEFAULT_KEY_TELNET],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_TRAPPER => [
'js-item-trapper-hosts-label',
'js-item-trapper-hosts-field',
'trapper_hosts',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_ZABBIX => [
'js-item-interface-label',
@@ -701,9 +686,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-label',
- 'js-item-trends-field',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
],
ITEM_TYPE_ZABBIX_ACTIVE => [
'js-item-delay-label',
@@ -711,9 +695,8 @@ final class CItemData {
'delay',
'js-item-flex-intervals-label',
'js-item-flex-intervals-field',
- 'js-item-trends-field',
- 'js-item-trends-label',
- ['id' => 'key', 'defaultValue' => '']
+ ['id' => 'key', 'defaultValue' => ''],
+ ['id' => 'value_type', 'defaultValue' => '']
]
],
// Ids to toggle when the field 'authtype' is changed.
diff --git a/ui/include/classes/db/MysqlDbBackend.php b/ui/include/classes/db/MysqlDbBackend.php
index 8f15f31d671..eabb00b80f0 100644
--- a/ui/include/classes/db/MysqlDbBackend.php
+++ b/ui/include/classes/db/MysqlDbBackend.php
@@ -156,34 +156,39 @@ class MysqlDbBackend extends DbBackend {
* @param string $dbname Database name.
* @param string $schema DB schema.
*
- * @param
- * @return resource|null
+ * @return mysqli|null
*/
- public function connect($host, $port, $user, $password, $dbname, $schema) {
+ public function connect($host, $port, $user, $password, $dbname, $schema): ?mysqli {
+ mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
+
$resource = mysqli_init();
- $tls_mode = null;
+
+ if ($resource === false) {
+ return null;
+ }
if ($this->tls_encryption) {
- $cipher_suit = ($this->tls_cipher_list === '') ? null : $this->tls_cipher_list;
+ $cipher_suit = $this->tls_cipher_list !== '' ? $this->tls_cipher_list : null;
$resource->ssl_set($this->tls_key_file, $this->tls_cert_file, $this->tls_ca_file, null, $cipher_suit);
$tls_mode = MYSQLI_CLIENT_SSL;
}
+ else {
+ $tls_mode = 0;
+ }
- @$resource->real_connect($host, $user, $password, $dbname, $port, null, $tls_mode);
-
- if ($resource->error) {
- $this->setError($resource->error);
- return null;
+ try {
+ @$resource->real_connect($host, $user, $password, $dbname, $port, null, $tls_mode);
}
+ catch (mysqli_sql_exception $e) {
+ $this->setError($e->getMessage());
- if ($resource->errno) {
- $this->setError('Database error code '.$resource->errno);
return null;
}
if ($resource->autocommit(true) === false) {
$this->setError('Error setting auto commit.');
+
return null;
}
diff --git a/ui/include/classes/db/PostgresqlDbBackend.php b/ui/include/classes/db/PostgresqlDbBackend.php
index f07e8a02fc8..c140dd620fb 100644
--- a/ui/include/classes/db/PostgresqlDbBackend.php
+++ b/ui/include/classes/db/PostgresqlDbBackend.php
@@ -239,7 +239,7 @@ class PostgresqlDbBackend extends DbBackend {
* @return bool
*/
public function init() {
- $schema_set = DBexecute('SET search_path='.zbx_dbstr($this->schema), true);
+ $schema_set = DBexecute('SET search_path='.zbx_dbstr($this->schema));
if(!$schema_set) {
$this->setError(pg_last_error());
diff --git a/ui/include/classes/graphdraw/CLineGraphDraw.php b/ui/include/classes/graphdraw/CLineGraphDraw.php
index a25fa753439..4b9df8f15b5 100644
--- a/ui/include/classes/graphdraw/CLineGraphDraw.php
+++ b/ui/include/classes/graphdraw/CLineGraphDraw.php
@@ -2112,24 +2112,13 @@ class CLineGraphDraw extends CGraphDraw {
$data = &$this->data[$this->items[$item]['itemid']];
- if ($this->type == GRAPH_TYPE_STACKED) {
- $drawtype = $this->items[$item]['drawtype'];
- $max_color = $this->getColor('ValueMax', GRAPH_STACKED_ALFA);
- $avg_color = $this->getColor($this->items[$item]['color'], GRAPH_STACKED_ALFA);
- $min_color = $this->getColor('ValueMin', GRAPH_STACKED_ALFA);
- $minmax_color = $this->getColor('ValueMinMax', GRAPH_STACKED_ALFA);
+ $drawtype = $this->items[$item]['drawtype'];
+ $max_color = $this->getColor('ValueMax', GRAPH_STACKED_ALFA);
+ $avg_color = $this->getColor($this->items[$item]['color'], GRAPH_STACKED_ALFA);
+ $min_color = $this->getColor('ValueMin', GRAPH_STACKED_ALFA);
+ $minmax_color = $this->getColor('ValueMinMax', GRAPH_STACKED_ALFA);
- $calc_fnc = $this->items[$item]['calc_fnc'];
- }
- else {
- $drawtype = $this->items[$item]['drawtype'];
- $max_color = $this->getColor('ValueMax', GRAPH_STACKED_ALFA);
- $avg_color = $this->getColor($this->items[$item]['color'], GRAPH_STACKED_ALFA);
- $min_color = $this->getColor('ValueMin', GRAPH_STACKED_ALFA);
- $minmax_color = $this->getColor('ValueMinMax', GRAPH_STACKED_ALFA);
-
- $calc_fnc = $this->items[$item]['calc_fnc'];
- }
+ $calc_fnc = $this->items[$item]['calc_fnc'];
// for each X
$prevDraw = true;
diff --git a/ui/include/classes/html/CCol.php b/ui/include/classes/html/CCol.php
index 5b3c3b0b650..6696502a90c 100644
--- a/ui/include/classes/html/CCol.php
+++ b/ui/include/classes/html/CCol.php
@@ -34,6 +34,10 @@ class CCol extends CTag {
return $this;
}
+ public function getColSpan() {
+ return $this->getAttribute('colspan') ?? 1;
+ }
+
public function setColSpan($value) {
$this->setAttribute('colspan', $value);
diff --git a/ui/include/classes/html/CFilter.php b/ui/include/classes/html/CFilter.php
index c3588f8ac08..5bc1bdf2fd4 100644
--- a/ui/include/classes/html/CFilter.php
+++ b/ui/include/classes/html/CFilter.php
@@ -122,8 +122,8 @@ class CFilter extends CDiv {
*
* @return CFilter
*/
- public function addVar($name, $value) {
- $this->form->addVar($name, $value);
+ public function addVar($name, $value, $id = null) {
+ $this->form->addVar($name, $value, $id);
return $this;
}
diff --git a/ui/include/classes/html/CInput.php b/ui/include/classes/html/CInput.php
index cac4fa0ee62..006a53c3239 100644
--- a/ui/include/classes/html/CInput.php
+++ b/ui/include/classes/html/CInput.php
@@ -38,7 +38,6 @@ class CInput extends CTag {
}
$this->setAttribute('value', $value);
- return $this;
}
public function setType($type) {
diff --git a/ui/include/classes/html/CNavigationTree.php b/ui/include/classes/html/CNavigationTree.php
index ddcc3b40add..0dfaad22216 100644
--- a/ui/include/classes/html/CNavigationTree.php
+++ b/ui/include/classes/html/CNavigationTree.php
@@ -28,7 +28,6 @@ class CNavigationTree extends CDiv {
parent::__construct();
$this->data = $data;
- $this->error = null;
$this->setId(uniqid());
$this->addClass(ZBX_STYLE_NAVIGATIONTREE);
diff --git a/ui/include/classes/html/CPatternSelect.php b/ui/include/classes/html/CPatternSelect.php
index b6274a3a4c0..3595682abf6 100644
--- a/ui/include/classes/html/CPatternSelect.php
+++ b/ui/include/classes/html/CPatternSelect.php
@@ -20,6 +20,7 @@
class CPatternSelect extends CMultiSelect {
+
/**
* Search method used for auto-suggestions.
*/
@@ -41,9 +42,20 @@ class CPatternSelect extends CMultiSelect {
}
protected function mapOptions(array $options): array {
+ $wildcard_allowed = false;
+
+ if (array_key_exists('wildcard_allowed', $options) && $options['wildcard_allowed']) {
+ $wildcard_allowed = true;
+ unset($options['wildcard_allowed']);
+ }
+
$options = parent::mapOptions($options);
$options['popup']['parameters']['patternselect'] = '1';
+ if ($wildcard_allowed) {
+ $options['objectOptions']['wildcard_allowed'] = true;
+ }
+
return $options;
}
diff --git a/ui/include/classes/html/CRangeControl.php b/ui/include/classes/html/CRangeControl.php
index 7e37ccb1f2b..28b74fdda66 100644
--- a/ui/include/classes/html/CRangeControl.php
+++ b/ui/include/classes/html/CRangeControl.php
@@ -43,7 +43,6 @@ class CRangeControl extends CTextBox {
$this->setValue($value);
$this->addClass(static::ZBX_STYLE_CLASS);
- return $this;
}
public function setValue($value) {
diff --git a/ui/include/classes/html/CRow.php b/ui/include/classes/html/CRow.php
index 92a6441f7a0..6c3a0717676 100644
--- a/ui/include/classes/html/CRow.php
+++ b/ui/include/classes/html/CRow.php
@@ -22,6 +22,7 @@
class CRow extends CTag {
protected $heading_column;
+ protected $colspan = 0;
/**
* @param CTag|array|null $item
@@ -42,20 +43,26 @@ class CRow extends CTag {
*/
public function addItem($item) {
if ($item instanceof CCol) {
+ $this->colspan += $item->getColSpan();
parent::addItem($item);
}
elseif (is_array($item)) {
foreach ($item as $el) {
if ($el instanceof CCol) {
+ $this->colspan += $el->getColSpan();
parent::addItem($el);
}
elseif ($el !== null) {
- parent::addItem($this->createCell($el));
+ $col = $this->createCell($el);
+ $this->colspan += $col->getColSpan();
+ parent::addItem($col);
}
}
}
elseif ($item !== null) {
- parent::addItem($this->createCell($item));
+ $col = $this->createCell($item);
+ $this->colspan += $col->getColSpan();
+ parent::addItem($col);
}
return $this;
@@ -73,4 +80,13 @@ class CRow extends CTag {
? (new CColHeader($el))
: (new CCol($el));
}
+
+ /**
+ * Get total colspan count across all cells.
+ *
+ * @return int
+ */
+ public function getColSpan(): int {
+ return $this->colspan;
+ }
}
diff --git a/ui/include/classes/html/CSup.php b/ui/include/classes/html/CSup.php
index ebf94325e30..1b64372dfc4 100644
--- a/ui/include/classes/html/CSup.php
+++ b/ui/include/classes/html/CSup.php
@@ -24,7 +24,5 @@ class CSup extends CTag {
public function __construct($items = null) {
parent::__construct('sup', true);
$this->addItem($items);
-
- return $this;
}
}
diff --git a/ui/include/classes/html/CTable.php b/ui/include/classes/html/CTable.php
index c9ce1a32d9b..1ce1c2277e6 100644
--- a/ui/include/classes/html/CTable.php
+++ b/ui/include/classes/html/CTable.php
@@ -111,7 +111,7 @@ class CTable extends CTag {
$value = new CRowHeader($value);
}
- $this->colnum = $value->itemsCount();
+ $this->colnum = $value->getColSpan();
$value = new CTag('thead', true, $value);
$this->header = $value->toString();
diff --git a/ui/include/classes/html/CTextBox.php b/ui/include/classes/html/CTextBox.php
index 90091d5750a..0d0de653f16 100644
--- a/ui/include/classes/html/CTextBox.php
+++ b/ui/include/classes/html/CTextBox.php
@@ -26,7 +26,6 @@ class CTextBox extends CInput {
public function __construct($name = 'textbox', $value = '', $readonly = false, $maxlength = 255) {
parent::__construct('text', $name, $value);
$this->setReadonly($readonly);
- $this->caption = null;
$this->setAttribute('maxlength', $maxlength);
}
diff --git a/ui/include/classes/html/CVisibilityBox.php b/ui/include/classes/html/CVisibilityBox.php
index 9e1af6b7453..15ab93e5e90 100644
--- a/ui/include/classes/html/CVisibilityBox.php
+++ b/ui/include/classes/html/CVisibilityBox.php
@@ -26,9 +26,8 @@ class CVisibilityBox extends CCheckBox {
$this->replace_to = unpack_object($replace_to);
parent::__construct($name);
- $this->onClick('visibility_status_changeds(this.checked, '.zbx_jsvalue($this->object_id).', '.
+ $this->onClick('visibilityStatusChanges(this.checked, '.zbx_jsvalue($this->object_id).', '.
zbx_jsvalue($this->replace_to).');');
- insert_javascript_for_visibilitybox();
}
/**
@@ -47,7 +46,7 @@ class CVisibilityBox extends CCheckBox {
public function toString($destroy = true) {
if (!isset($this->attributes['checked'])) {
- zbx_add_post_js('visibility_status_changeds(false, '.zbx_jsvalue($this->object_id).', '.
+ zbx_add_post_js('visibilityStatusChanges(false, '.zbx_jsvalue($this->object_id).', '.
zbx_jsvalue($this->replace_to).');');
}
diff --git a/ui/include/classes/html/pageheader/CPageHeader.php b/ui/include/classes/html/pageheader/CPageHeader.php
index 0766aa70e4b..e272f094998 100644
--- a/ui/include/classes/html/pageheader/CPageHeader.php
+++ b/ui/include/classes/html/pageheader/CPageHeader.php
@@ -30,6 +30,11 @@ class CPageHeader {
protected $title;
/**
+ * @var string Language attribute.
+ */
+ protected $lang;
+
+ /**
* @var array of css file paths
*/
protected $cssFiles = [];
@@ -61,9 +66,11 @@ class CPageHeader {
/**
* @param string $title
+ * @param string $lang
*/
- public function __construct($title = '') {
+ public function __construct(string $title, string $lang) {
$this->title = CHtml::encode($title);
+ $this->lang = $lang;
$this->sid = substr(CSessionHelper::getId(), 16, 16);
}
@@ -121,9 +128,9 @@ class CPageHeader {
* Display page head html.
*/
public function display() {
+ echo '<!DOCTYPE html>'."\n";
+ echo '<html lang="'.$this->lang.'">'."\n";
echo <<<HTML
-<!DOCTYPE html>
-<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta charset="utf-8" />
diff --git a/ui/include/classes/html/svg/CSvg.php b/ui/include/classes/html/svg/CSvg.php
index 738b42936d1..77b87c3dbcf 100644
--- a/ui/include/classes/html/svg/CSvg.php
+++ b/ui/include/classes/html/svg/CSvg.php
@@ -22,7 +22,7 @@
class CSvg extends CSvgTag {
public function __construct() {
- parent::__construct('svg', true);
+ parent::__construct('svg');
$this
->setAttribute('id', str_replace('.', '', uniqid('svg_', true)))
diff --git a/ui/include/classes/html/svg/CSvgCircle.php b/ui/include/classes/html/svg/CSvgCircle.php
index c52f0a0364e..e45d39a988d 100644
--- a/ui/include/classes/html/svg/CSvgCircle.php
+++ b/ui/include/classes/html/svg/CSvgCircle.php
@@ -22,7 +22,7 @@
class CSvgCircle extends CSvgTag {
public function __construct($x, $y, $diameter) {
- parent::__construct('circle', true);
+ parent::__construct('circle');
$this->setAttribute('cx', round($x));
$this->setAttribute('cy', round($y));
diff --git a/ui/include/classes/html/svg/CSvgGraphAnnotation.php b/ui/include/classes/html/svg/CSvgGraphAnnotation.php
index e0ff72650af..e6607953141 100644
--- a/ui/include/classes/html/svg/CSvgGraphAnnotation.php
+++ b/ui/include/classes/html/svg/CSvgGraphAnnotation.php
@@ -50,7 +50,6 @@ class CSvgGraphAnnotation extends CSvgTag {
private $color;
public function __construct($type) {
- $this->data_info = null;
$this->color = '';
$this->type = $type;
}
diff --git a/ui/include/classes/html/svg/CSvgGraphGrid.php b/ui/include/classes/html/svg/CSvgGraphGrid.php
index ad1cb5a9f0f..4c4df1523e6 100644
--- a/ui/include/classes/html/svg/CSvgGraphGrid.php
+++ b/ui/include/classes/html/svg/CSvgGraphGrid.php
@@ -30,7 +30,7 @@ class CSvgGraphGrid extends CSvgTag {
protected $color;
public function __construct(array $points_value, array $points_time) {
- parent::__construct('g', true);
+ parent::__construct('g');
$this
->setAttribute('shape-rendering', 'crispEdges')
diff --git a/ui/include/classes/html/svg/CSvgGroup.php b/ui/include/classes/html/svg/CSvgGroup.php
index cb495df9031..3b79008a3ad 100644
--- a/ui/include/classes/html/svg/CSvgGroup.php
+++ b/ui/include/classes/html/svg/CSvgGroup.php
@@ -22,6 +22,6 @@
class CSvgGroup extends CSvgTag {
public function __construct() {
- parent::__construct('g', true);
+ parent::__construct('g');
}
}
diff --git a/ui/include/classes/html/svg/CSvgLine.php b/ui/include/classes/html/svg/CSvgLine.php
index 97d251aa9df..ff05a5fc18d 100644
--- a/ui/include/classes/html/svg/CSvgLine.php
+++ b/ui/include/classes/html/svg/CSvgLine.php
@@ -22,7 +22,7 @@
class CSvgLine extends CSvgTag {
public function __construct($x1, $y1, $x2, $y2) {
- parent::__construct('line', true);
+ parent::__construct('line');
$this->setAttribute('x1', $x1);
$this->setAttribute('y1', $y1);
diff --git a/ui/include/classes/html/svg/CSvgPolygon.php b/ui/include/classes/html/svg/CSvgPolygon.php
index 4af45f08154..c369b78e7da 100644
--- a/ui/include/classes/html/svg/CSvgPolygon.php
+++ b/ui/include/classes/html/svg/CSvgPolygon.php
@@ -22,7 +22,7 @@
class CSvgPolygon extends CSvgTag {
public function __construct($points) {
- parent::__construct('polygon', true);
+ parent::__construct('polygon');
$p = '';
diff --git a/ui/include/classes/html/svg/CSvgRect.php b/ui/include/classes/html/svg/CSvgRect.php
index 544fc54c710..3a0c876722d 100644
--- a/ui/include/classes/html/svg/CSvgRect.php
+++ b/ui/include/classes/html/svg/CSvgRect.php
@@ -22,7 +22,7 @@
class CSvgRect extends CSvgTag {
public function __construct($x, $y, $width, $height) {
- parent::__construct('rect', true);
+ parent::__construct('rect');
$this->setAttribute('x', $x);
$this->setAttribute('y', $y);
diff --git a/ui/include/classes/html/svg/CSvgText.php b/ui/include/classes/html/svg/CSvgText.php
index 531e06b5eae..5c66120a316 100644
--- a/ui/include/classes/html/svg/CSvgText.php
+++ b/ui/include/classes/html/svg/CSvgText.php
@@ -22,7 +22,7 @@
class CSvgText extends CSvgTag {
public function __construct($x, $y, $text) {
- parent::__construct('text', true);
+ parent::__construct('text');
$this->setAttribute('x', $x);
$this->setAttribute('y', $y);
diff --git a/ui/include/classes/ldap/CLdap.php b/ui/include/classes/ldap/CLdap.php
index bf310d5e59b..5161ada9b9f 100644
--- a/ui/include/classes/ldap/CLdap.php
+++ b/ui/include/classes/ldap/CLdap.php
@@ -171,8 +171,6 @@ class CLdap {
}
$this->bound = 1;
-
- return true;
}
else {
// see if we can find the user
@@ -193,11 +191,9 @@ class CLdap {
}
$this->bound = 1;
-
- return true;
}
- return false;
+ return true;
}
private function getUserData($user) {
diff --git a/ui/include/classes/mvc/CControllerResponse.php b/ui/include/classes/mvc/CControllerResponse.php
index 976d20d17c6..ddb418c6327 100644
--- a/ui/include/classes/mvc/CControllerResponse.php
+++ b/ui/include/classes/mvc/CControllerResponse.php
@@ -39,9 +39,9 @@ abstract class CControllerResponse {
CMessageHelper::restoreScheduleMessages();
}
- (new CPageHeader(_('Loading...')))->display();
+ (new CPageHeader(_('Loading...'), CWebUser::getLang()))->display();
- echo '<body lang="'.CWebUser::getLang().'">';
+ echo '<body>';
echo $this
->getForm()
diff --git a/ui/include/classes/setup/CFrontendSetup.php b/ui/include/classes/setup/CFrontendSetup.php
index e2954b42ba8..d05af108c6b 100644
--- a/ui/include/classes/setup/CFrontendSetup.php
+++ b/ui/include/classes/setup/CFrontendSetup.php
@@ -25,7 +25,7 @@
*/
class CFrontendSetup {
- const MIN_PHP_VERSION = '7.2.0';
+ const MIN_PHP_VERSION = '7.2.5';
const MIN_PHP_MEMORY_LIMIT = '134217728'; // 128 * ZBX_MEBIBYTE;
const MIN_PHP_POST_MAX_SIZE = '16777216'; // 16 * ZBX_MEBIBYTE;
const MIN_PHP_UPLOAD_MAX_FILESIZE = '2097152'; // 2 * ZBX_MEBIBYTE;
@@ -250,8 +250,8 @@ class CFrontendSetup {
public static function getSupportedDatabases() {
$allowed_db = [];
- if (zbx_is_callable(['mysqli_close', 'mysqli_connect', 'mysqli_connect_error', 'mysqli_error',
- 'mysqli_fetch_assoc', 'mysqli_free_result', 'mysqli_query', 'mysqli_real_escape_string'])) {
+ if (zbx_is_callable(['mysqli_close', 'mysqli_fetch_assoc', 'mysqli_free_result', 'mysqli_init', 'mysqli_query',
+ 'mysqli_real_escape_string', 'mysqli_report'])) {
$allowed_db[ZBX_DB_MYSQL] = 'MySQL';
}
diff --git a/ui/include/classes/validators/CHistFunctionValidator.php b/ui/include/classes/validators/CHistFunctionValidator.php
index f26ad9ddf96..3e0d0ca8588 100644
--- a/ui/include/classes/validators/CHistFunctionValidator.php
+++ b/ui/include/classes/validators/CHistFunctionValidator.php
@@ -379,7 +379,7 @@ class CHistFunctionValidator extends CValidator {
return ($matches['num'] > 0 && $matches['num'] <= ZBX_MAX_INT32);
}
- return false;
+ break;
case CHistFunctionData::PERIOD_MODE_SEC:
case CHistFunctionData::PERIOD_MODE_SEC_ONLY:
@@ -393,14 +393,14 @@ class CHistFunctionValidator extends CValidator {
return ($sec > 0 && $sec <= ZBX_MAX_INT32);
}
- return false;
+ break;
case CHistFunctionData::PERIOD_MODE_NUM_ONLY:
if (preg_match('/^#(?<num>\d+)$/', $sec_num, $matches) == 1) {
return ($matches['num'] > 0 && $matches['num'] <= ZBX_MAX_INT32);
}
- return false;
+ break;
case CHistFunctionData::PERIOD_MODE_TREND:
if ($time_shift === '') {
@@ -417,10 +417,7 @@ class CHistFunctionValidator extends CValidator {
return ($sec > 0 && $sec <= ZBX_MAX_INT32 && $sec % SEC_PER_HOUR == 0);
}
- return false;
-
- default:
- return false;
+ break;
}
return false;
diff --git a/ui/include/classes/widgets/CWidgetHelper.php b/ui/include/classes/widgets/CWidgetHelper.php
index ce011438949..cf5b10569b6 100644
--- a/ui/include/classes/widgets/CWidgetHelper.php
+++ b/ui/include/classes/widgets/CWidgetHelper.php
@@ -238,6 +238,7 @@ class CWidgetHelper {
'object_name' => 'hosts',
'data' => $field->getValue(),
'placeholder' => $field->getPlaceholder(),
+ 'wildcard_allowed' => 1,
'popup' => [
'parameters' => [
'srctbl' => 'hosts',
@@ -797,6 +798,7 @@ class CWidgetHelper {
'object_name' => 'hosts',
'data' => $value['hosts'],
'placeholder' => _('host pattern'),
+ 'wildcard_allowed' => 1,
'popup' => [
'parameters' => [
'srctbl' => 'hosts',
@@ -818,6 +820,7 @@ class CWidgetHelper {
'data' => $value['items'],
'placeholder' => _('item pattern'),
'multiple' => true,
+ 'wildcard_allowed' => 1,
'popup' => [
'parameters' => [
'srctbl' => 'items',
@@ -1156,6 +1159,7 @@ class CWidgetHelper {
'object_name' => 'hosts',
'data' => $value['hosts'],
'placeholder' => _('host pattern'),
+ 'wildcard_allowed' => 1,
'popup' => [
'parameters' => [
'srctbl' => 'hosts',
@@ -1173,6 +1177,7 @@ class CWidgetHelper {
'object_name' => 'items',
'data' => $value['items'],
'placeholder' => _('item pattern'),
+ 'wildcard_allowed' => 1,
'popup' => [
'parameters' => [
'srctbl' => 'items',
diff --git a/ui/include/classes/widgets/fields/CWidgetFieldHostPatternSelect.php b/ui/include/classes/widgets/fields/CWidgetFieldHostPatternSelect.php
index 83d380c6089..d988491be0d 100644
--- a/ui/include/classes/widgets/fields/CWidgetFieldHostPatternSelect.php
+++ b/ui/include/classes/widgets/fields/CWidgetFieldHostPatternSelect.php
@@ -33,7 +33,6 @@ class CWidgetFieldHostPatternSelect extends CWidgetField {
parent::__construct($name, $label);
$this->setDefault([]);
- $this->placeholder = null;
/*
* Set validation rules bypassing a parent::setSaveType to skip validation of length.
diff --git a/ui/include/classes/widgets/views/js/widget.tophosts.form.view.js.php b/ui/include/classes/widgets/views/js/widget.tophosts.form.view.js.php
index 58700367c3f..a518e1d1125 100644
--- a/ui/include/classes/widgets/views/js/widget.tophosts.form.view.js.php
+++ b/ui/include/classes/widgets/views/js/widget.tophosts.form.view.js.php
@@ -31,12 +31,15 @@ window.widget_tophosts_form = new class {
}
initSortable(element) {
+ const is_disabled = element.querySelectorAll('tr.sortable').length < 2;
+
$(element).sortable({
+ disabled: is_disabled,
items: 'tbody tr.sortable',
axis: 'y',
containment: 'parent',
cursor: 'grabbing',
- handle: 'div.drag-icon',
+ handle: 'div.<?= ZBX_STYLE_DRAG_ICON ?>',
tolerance: 'pointer',
opacity: 0.6,
helper: function(e, ui) {
@@ -61,6 +64,10 @@ window.widget_tophosts_form = new class {
$(ui.placeholder).height($(ui.helper).height());
}
});
+
+ for (const drag_icon of element.querySelectorAll('div.<?= ZBX_STYLE_DRAG_ICON ?>')) {
+ drag_icon.classList.toggle('<?= ZBX_STYLE_DISABLED ?>', is_disabled);
+ }
}
processColumnsAction(e) {
diff --git a/ui/include/classes/widgets/views/widget.tophosts.form.view.php b/ui/include/classes/widgets/views/widget.tophosts.form.view.php
index e132a09e1ef..113af012702 100644
--- a/ui/include/classes/widgets/views/widget.tophosts.form.view.php
+++ b/ui/include/classes/widgets/views/widget.tophosts.form.view.php
@@ -74,8 +74,9 @@ $column = CWidgetHelper::getSelect($fields['column']);
if (!$fields['column']->getValues()) {
$column = (new CDiv(_('Add item column')))->addClass(
($fields['column']->getFlags() & CWidgetField::FLAG_DISABLED)
- ? ZBX_STYLE_DISABLED
- : null);
+ ? ZBX_STYLE_DISABLED
+ : null
+ );
}
$form_list->addRow(CWidgetHelper::getLabel($fields['column']), $column);
diff --git a/ui/include/db.inc.php b/ui/include/db.inc.php
index c9b96e566f5..84a5e307a9f 100644
--- a/ui/include/db.inc.php
+++ b/ui/include/db.inc.php
@@ -40,7 +40,6 @@ function DBconnect(&$error) {
$DB['TRANSACTION_NO_FAILED_SQLS'] = true; // true - if no statements failed in transaction, false - there are failed statements
$DB['SELECT_COUNT'] = 0; // stats
$DB['EXECUTE_COUNT'] = 0;
- $DB['DB'] = null;
if (!isset($DB['TYPE'])) {
$error = 'Unknown database type.';
@@ -219,50 +218,64 @@ function DBrollback() {
* @param int $limit max number of record to return
* @param int $offset return starting from $offset record
*
- * @return resource or object, False if failed
+ * @return resource|false
*/
function DBselect($query, $limit = null, $offset = 0) {
global $DB;
- $result = false;
-
- if (!isset($DB['DB']) || empty($DB['DB'])) {
- return $result;
+ if (!array_key_exists('DB', $DB) || $DB['DB'] === null) {
+ return false;
}
- // add the LIMIT clause
- if(!$query = DBaddLimit($query, $limit, $offset)) {
+ $query = DBaddLimit($query, $limit, $offset);
+
+ if ($query === false) {
return false;
}
$time_start = microtime(true);
+
$DB['SELECT_COUNT']++;
+ $result = false;
+
switch ($DB['TYPE']) {
case ZBX_DB_MYSQL:
- if (!$result = mysqli_query($DB['DB'], $query)) {
- error('Error in query ['.$query.'] ['.mysqli_error($DB['DB']).']', 'sql');
+ try {
+ $result = mysqli_query($DB['DB'], $query);
+ }
+ catch (mysqli_sql_exception $e) {
+ error('Error in query ['.$query.'] ['.$e->getMessage().']', 'sql');
}
+
break;
+
case ZBX_DB_POSTGRESQL:
if (!$result = pg_query($DB['DB'], $query)) {
error('Error in query ['.$query.'] ['.pg_last_error().']', 'sql');
}
+
break;
+
case ZBX_DB_ORACLE:
- if (!$result = oci_parse($DB['DB'], $query)) {
- $e = @oci_error();
+ $result = oci_parse($DB['DB'], $query);
+
+ if ($result === false) {
+ $e = oci_error();
error('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']', 'sql');
+
+ break;
}
- elseif (!@oci_execute($result, ($DB['TRANSACTIONS'] ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS))) {
+
+ if (!@oci_execute($result, ($DB['TRANSACTIONS'] ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS))) {
$e = oci_error($result);
error('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']', 'sql');
}
+
break;
}
- // $result is false only if an error occurred
- if ($DB['TRANSACTION_NO_FAILED_SQLS'] && !$result) {
+ if (!$result) {
$DB['TRANSACTION_NO_FAILED_SQLS'] = false;
}
@@ -327,44 +340,63 @@ function DBaddLimit($query, $limit = 0, $offset = 0) {
return $query;
}
-function DBexecute($query) {
+/**
+ * @param $query
+ *
+ * @return bool
+ */
+function DBexecute($query): bool {
global $DB;
- if (!isset($DB['DB']) || empty($DB['DB'])) {
+ if (!array_key_exists('DB', $DB) || $DB['DB'] === null) {
return false;
}
- $result = false;
$time_start = microtime(true);
$DB['EXECUTE_COUNT']++;
+ $result = false;
+
switch ($DB['TYPE']) {
case ZBX_DB_MYSQL:
- if (!$result = mysqli_query($DB['DB'], $query)) {
- error('Error in query ['.$query.'] ['.mysqli_error($DB['DB']).']', 'sql');
+ try {
+ $result = mysqli_query($DB['DB'], $query);
+ }
+ catch (mysqli_sql_exception $e) {
+ error('Error in query ['.$query.'] ['.$e->getMessage().']', 'sql');
}
+
break;
+
case ZBX_DB_POSTGRESQL:
if (!$result = (bool) pg_query($DB['DB'], $query)) {
error('Error in query ['.$query.'] ['.pg_last_error().']', 'sql');
}
+
break;
+
case ZBX_DB_ORACLE:
- if (!$result = oci_parse($DB['DB'], $query)) {
- $e = @oci_error();
+ $result = oci_parse($DB['DB'], $query);
+
+ if ($result === false) {
+ $e = oci_error();
error('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']', 'sql');
+
+ break;
}
- elseif (!@oci_execute($result, ($DB['TRANSACTIONS'] ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS))) {
+
+ if (!@oci_execute($result, ($DB['TRANSACTIONS'] ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS))) {
$e = oci_error($result);
error('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']', 'sql');
}
- else {
- $result = true; // function must return boolean
- }
+
+ $result = true;
+
break;
}
- if ($DB['TRANSACTIONS'] != 0 && !$result) {
+
+ if (!$result) {
$DB['TRANSACTION_NO_FAILED_SQLS'] = false;
}
@@ -377,32 +409,36 @@ function DBexecute($query) {
}
/**
- * Returns the next data set from a DB resource or false if there are no more results.
+ * Return the next data set from a DB resource or false if there are no more results.
*
- * @param resource $cursor
- * @param bool $convertNulls Convert all null values to string zeros.
+ * @param mixed $cursor A DB-specific resource returned by DBselect or DBexecute.
+ * @param bool $convertNulls Convert all null values to string zeros.
*
* @return array|bool
*/
function DBfetch($cursor, $convertNulls = true) {
global $DB;
- $result = false;
-
- if (!isset($DB['DB']) || empty($DB['DB']) || is_bool($cursor)) {
- return $result;
+ if (!array_key_exists('DB', $DB) || $DB['DB'] === null || $cursor === false) {
+ return false;
}
+ $result = false;
+
switch ($DB['TYPE']) {
case ZBX_DB_MYSQL:
$result = mysqli_fetch_assoc($cursor);
+
if (!$result) {
mysqli_free_result($cursor);
}
+
break;
+
case ZBX_DB_POSTGRESQL:
if ($result = pg_fetch_assoc($cursor)) {
$i = 0;
+
foreach ($result as &$value) {
if (pg_field_type($cursor, $i++) === 'bytea') {
$value = pg_unescape_bytea($value);
@@ -413,22 +449,29 @@ function DBfetch($cursor, $convertNulls = true) {
else {
pg_free_result($cursor);
}
+
break;
+
case ZBX_DB_ORACLE:
if ($row = oci_fetch_assoc($cursor)) {
$result = [];
+
foreach ($row as $key => $value) {
$field_type = strtolower(oci_field_type($cursor, $key));
- // Oracle does not support NULL values for string fields, so if the string is empty, it will return NULL
- // convert it to an empty string to be consistent with other databases
- $value = (str_in_array($field_type, ['varchar', 'varchar2', 'blob', 'clob']) && is_null($value)) ? '' : $value;
+
+ // Since Oracle reports nulls for empty strings, convert those back to empty strings.
+ $value = (str_in_array($field_type, ['varchar', 'varchar2', 'blob', 'clob']) && is_null($value))
+ ? ''
+ : $value;
if (is_object($value) && (strpos($field_type, 'lob') !== false)) {
$value = $value->load();
}
+
$result[strtolower($key)] = $value;
}
}
+
break;
}
diff --git a/ui/include/defines.inc.php b/ui/include/defines.inc.php
index 3d4e94cb34f..f6c273f4772 100644
--- a/ui/include/defines.inc.php
+++ b/ui/include/defines.inc.php
@@ -18,8 +18,8 @@
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
-define('ZABBIX_VERSION', '6.0.3');
-define('ZABBIX_API_VERSION', '6.0.3');
+define('ZABBIX_VERSION', '6.0.4rc1');
+define('ZABBIX_API_VERSION', '6.0.4');
define('ZABBIX_EXPORT_VERSION', '6.0');
define('ZABBIX_DB_VERSION', 6000000);
diff --git a/ui/include/forms.inc.php b/ui/include/forms.inc.php
index 65fc7d2cf02..4f84b45278c 100644
--- a/ui/include/forms.inc.php
+++ b/ui/include/forms.inc.php
@@ -514,9 +514,7 @@ function makeItemSubfilter(array &$filter_data, array $items, string $context) {
// output
if (count($item_params['tags']) > 1) {
- $tags_output = prepareTagsSubfilterOutput($item_params['tags'], $filter_data['subfilter_tags'],
- 'subfilter_tags'
- );
+ $tags_output = prepareTagsSubfilterOutput($item_params['tags'], $filter_data['subfilter_tags']);
$table_subfilter->addRow([$tags_output]);
}
@@ -921,7 +919,7 @@ function getItemFormData(array $item = [], array $options = []) {
}
$data['templates'] = makeItemTemplatesHtml($item['itemid'], getItemParentTemplates([$item], $flag), $flag,
- CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES), $data['context']
+ CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES)
);
}
@@ -1744,7 +1742,7 @@ function getTriggerFormData(array $data) {
// Get templates.
$data['templates'] = makeTriggerTemplatesHtml($trigger['triggerid'],
getTriggerParentTemplates([$trigger], $flag), $flag,
- CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES), $data['context']
+ CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES)
);
if ($data['show_inherited_tags']) {
diff --git a/ui/include/js.inc.php b/ui/include/js.inc.php
index 76aa7cffc32..2ed91c094a2 100644
--- a/ui/include/js.inc.php
+++ b/ui/include/js.inc.php
@@ -75,49 +75,6 @@ function zbx_jsvalue($value, $as_object = false, $addQuotes = true) {
return $is_object ? '{'.implode(',', $value).'}' : '['.implode(',', $value).']';
}
-function insert_javascript_for_visibilitybox() {
- if (defined('CVISIBILITYBOX_JAVASCRIPT_INSERTED')) {
- return null;
- }
- define('CVISIBILITYBOX_JAVASCRIPT_INSERTED', 1);
-
- $js = '
- function visibility_status_changeds(value, obj_id, replace_to) {
- var obj = document.getElementById(obj_id);
- if (is_null(obj)) {
- throw "Cannot find objects with name [" + obj_id +"]";
- }
-
- if (replace_to && replace_to != "") {
- if (obj.originalObject) {
- var old_obj = obj.originalObject;
- old_obj.originalObject = obj;
- obj.parentNode.replaceChild(old_obj, obj);
- }
- else if (!value) {
- try {
- var new_obj = document.createElement("span");
- new_obj.setAttribute("name", obj.name);
- new_obj.setAttribute("id", obj.id);
- }
- catch(e) {
- throw "Cannot create new element";
- }
- new_obj.innerHTML = replace_to;
- new_obj.originalObject = obj;
- obj.parentNode.replaceChild(new_obj, obj);
- }
- else {
- throw "Missing originalObject for restoring";
- }
- }
- else {
- obj.style.visibility = value ? "visible" : "hidden";
- }
- }';
- insert_js($js);
-}
-
function insert_js($script, $jQueryDocumentReady = false) {
echo get_js($script, $jQueryDocumentReady);
}
diff --git a/ui/include/page_header.php b/ui/include/page_header.php
index f16bdbc962f..693c40e50f3 100644
--- a/ui/include/page_header.php
+++ b/ui/include/page_header.php
@@ -124,7 +124,7 @@ if ($page['type'] == PAGE_TYPE_HTML) {
$pageTitle .= ' ['._s('refreshed every %1$s sec.', CWebUser::getRefresh()).']';
}
- $pageHeader = new CPageHeader($pageTitle);
+ $pageHeader = new CPageHeader($pageTitle, CWebUser::getLang());
$is_standard_page = (!defined('ZBX_PAGE_NO_MENU') || $page['web_layout_mode'] == ZBX_LAYOUT_KIOSKMODE);
$theme = ZBX_DEFAULT_THEME;
@@ -177,7 +177,7 @@ if ($page['type'] == PAGE_TYPE_HTML) {
$pageHeader->display();
- echo '<body lang="'.CWebUser::getLang().'">';
+ echo '<body>';
}
define('PAGE_HEADER_LOADED', 1);
diff --git a/ui/include/views/configuration.item.list.php b/ui/include/views/configuration.item.list.php
index 3ae9193685b..7dcb5e8fddb 100644
--- a/ui/include/views/configuration.item.list.php
+++ b/ui/include/views/configuration.item.list.php
@@ -64,7 +64,7 @@ $url = (new CUrl('items.php'))
$itemForm = (new CForm('post', $url))
->setName('items')
->addVar('checkbox_hash', $data['checkbox_hash'])
- ->addVar('context', $data['context']);
+ ->addVar('context', $data['context'], 'form_context');
if (!empty($data['hostid'])) {
$itemForm->addVar('hostid', $data['hostid']);
diff --git a/ui/include/views/configuration.item.prototype.list.php b/ui/include/views/configuration.item.prototype.list.php
index 19e5d5aed0c..646b1afdef2 100644
--- a/ui/include/views/configuration.item.prototype.list.php
+++ b/ui/include/views/configuration.item.prototype.list.php
@@ -48,8 +48,8 @@ $url = (new CUrl('disc_prototypes.php'))
// create form
$itemForm = (new CForm('post', $url))
->setName('items')
- ->addVar('parent_discoveryid', $data['parent_discoveryid'])
- ->addVar('context', $data['context']);
+ ->addVar('parent_discoveryid', $data['parent_discoveryid'], 'form_parent_discoveryid')
+ ->addVar('context', $data['context'], 'form_context');
// create table
$itemTable = (new CTableInfo())
diff --git a/ui/include/views/configuration.trigger.prototype.list.php b/ui/include/views/configuration.trigger.prototype.list.php
index f3b3dc85ac6..bf6a0a4d66e 100644
--- a/ui/include/views/configuration.trigger.prototype.list.php
+++ b/ui/include/views/configuration.trigger.prototype.list.php
@@ -47,8 +47,8 @@ $url = (new CUrl('trigger_prototypes.php'))
// create form
$triggersForm = (new CForm('post', $url))
->setName('triggersForm')
- ->addVar('parent_discoveryid', $data['parent_discoveryid'])
- ->addVar('context', $data['context']);
+ ->addVar('parent_discoveryid', $data['parent_discoveryid'], 'form_parent_discoveryid')
+ ->addVar('context', $data['context'], 'form_context');
// create table
$triggersTable = (new CTableInfo())
diff --git a/ui/include/views/configuration.triggers.list.php b/ui/include/views/configuration.triggers.list.php
index cdcb9d5ba3d..012418bd45a 100644
--- a/ui/include/views/configuration.triggers.list.php
+++ b/ui/include/views/configuration.triggers.list.php
@@ -139,7 +139,7 @@ $filter = (new CFilter())
->setResetUrl((new CUrl('triggers.php'))->setArgument('context', $data['context']))
->setProfile($data['profileIdx'])
->setActiveTab($data['active_tab'])
- ->addvar('context', $data['context'])
+ ->addvar('context', $data['context'], 'filter_context')
->addFilterTab(_('Filter'), [$filter_column1, $filter_column2]);
$widget = (new CWidget())
@@ -174,7 +174,7 @@ $url = (new CUrl('triggers.php'))
$triggers_form = (new CForm('post', $url))
->setName('triggersForm')
->addVar('checkbox_hash', $data['checkbox_hash'])
- ->addVar('context', $data['context']);
+ ->addVar('context', $data['context'], 'form_context');
// create table
$triggers_table = (new CTableInfo())->setHeader([
diff --git a/ui/include/views/general.browserwarning.php b/ui/include/views/general.browserwarning.php
index 4b9135e2ac6..1d9a03bfb96 100644
--- a/ui/include/views/general.browserwarning.php
+++ b/ui/include/views/general.browserwarning.php
@@ -24,7 +24,7 @@
*/
?>
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta charset="utf-8" />
@@ -42,7 +42,7 @@
<meta name="msapplication-config" content="none"/>
<link rel="stylesheet" type="text/css" href="assets/styles/<?= ZBX_DEFAULT_THEME ?>.css" />
</head>
- <body lang="en">
+ <body>
<div class="<?= ZBX_STYLE_LAYOUT_WRAPPER ?>">
<main>
<div class="<?= ZBX_STYLE_BROWSER_WARNING_CONTAINER ?>">
diff --git a/ui/include/views/general.warning.php b/ui/include/views/general.warning.php
index c5a912ce5b3..b2f3f2ba3c9 100644
--- a/ui/include/views/general.warning.php
+++ b/ui/include/views/general.warning.php
@@ -23,7 +23,7 @@
* @var CView $this
*/
-$pageHeader = (new CPageHeader(_('Warning').' ['._s('refreshed every %1$s sec.', 30).']'))
+$pageHeader = (new CPageHeader(_('Warning').' ['._s('refreshed every %1$s sec.', 30).']', CWebUser::getLang()))
->addCssFile('assets/styles/'.CHtml::encode($data['theme']).'.css')
->display();
@@ -31,7 +31,7 @@ $buttons = array_key_exists('buttons', $data)
? $data['buttons']
: [(new CButton(null, _('Retry')))->onClick('document.location.reload();')];
-echo '<body lang="'.CWebUser::getLang().'">';
+echo '<body>';
(new CDiv((new CTag('main', true,
new CWarning($data['header'], $data['messages'], $buttons)
diff --git a/ui/include/views/js/configuration.host.discovery.edit.overr.js.php b/ui/include/views/js/configuration.host.discovery.edit.overr.js.php
index 0d37346ebaa..20b2d831a8f 100644
--- a/ui/include/views/js/configuration.host.discovery.edit.overr.js.php
+++ b/ui/include/views/js/configuration.host.discovery.edit.overr.js.php
@@ -22,7 +22,6 @@
/**
* @var CView $this
*/
-insert_javascript_for_visibilitybox();
?>
<script type="text/x-jquery-tmpl" id="lldoverride-row-templated">
<?= (new CRow([
diff --git a/ui/js/class.calendar.js b/ui/js/class.calendar.js
index 1f29460f8f6..61028c66f5f 100644
--- a/ui/js/class.calendar.js
+++ b/ui/js/class.calendar.js
@@ -287,7 +287,6 @@ calendar.prototype = {
}
return false;
- break;
case 32: // Prevent page scrolling when pressing Space.
return false;
diff --git a/ui/js/class.cmap.js b/ui/js/class.cmap.js
index 62cf7a7919c..1ea88b03721 100644
--- a/ui/js/class.cmap.js
+++ b/ui/js/class.cmap.js
@@ -1146,7 +1146,6 @@ ZABBIX.apps.map = (function($) {
default:
throw 'Unsupported element type found in copy buffer!';
- break;
}
if (element) {
diff --git a/ui/js/common.js b/ui/js/common.js
index 3c5f061cdce..367cd988cbc 100644
--- a/ui/js/common.js
+++ b/ui/js/common.js
@@ -1012,18 +1012,18 @@ function openMassupdatePopup(action, parameters = {}, {
switch (action) {
case 'popup.massupdate.item':
- parameters.context = form.querySelector('#context').value;
+ parameters.context = form.querySelector('#form_context').value;
parameters.prototype = 0;
break;
case 'popup.massupdate.trigger':
- parameters.context = form.querySelector('#context').value;
+ parameters.context = form.querySelector('#form_context').value;
break;
case 'popup.massupdate.itemprototype':
case 'popup.massupdate.triggerprototype':
- parameters.parent_discoveryid = form.querySelector('#parent_discoveryid').value;
- parameters.context = form.querySelector('#context').value;
+ parameters.parent_discoveryid = form.querySelector('#form_parent_discoveryid').value;
+ parameters.context = form.querySelector('#form_context').value;
parameters.prototype = 1;
break;
}
@@ -1032,6 +1032,43 @@ function openMassupdatePopup(action, parameters = {}, {
}
/**
+ * @param {boolean} value
+ * @param {string} objectid
+ * @param {string} replace_to
+ */
+function visibilityStatusChanges(value, objectid, replace_to) {
+ const obj = document.getElementById(objectid);
+
+ if (obj === null) {
+ throw `Cannot find objects with name [${objectid}]`;
+ }
+
+ if (replace_to && replace_to != '') {
+ if (obj.originalObject) {
+ const old_obj = obj.originalObject;
+ old_obj.originalObject = obj;
+
+ obj.parentNode.replaceChild(old_obj, obj);
+ }
+ else if (!value) {
+ const new_obj = document.createElement('span');
+ new_obj.setAttribute('name', obj.name);
+ new_obj.setAttribute('id', obj.id);
+ new_obj.innerHTML = replace_to;
+ new_obj.originalObject = obj;
+
+ obj.parentNode.replaceChild(new_obj, obj);
+ }
+ else {
+ throw 'Missing originalObject for restoring';
+ }
+ }
+ else {
+ obj.style.visibility = value ? 'visible' : 'hidden';
+ }
+}
+
+/**
* Clears session storage from markers of checked table rows.
* Or keeps only accessible IDs in the list of checked rows.
*
diff --git a/ui/js/functions.js b/ui/js/functions.js
index 91457e0eb37..04761a99e0e 100644
--- a/ui/js/functions.js
+++ b/ui/js/functions.js
@@ -947,9 +947,31 @@ function urlEncodeData(parameters, prefix = '') {
}
/**
- * Get all input fields from the given form and return them. The order of returned fields is not predictable.
- *
- * @param {object} form Form object from which fields are retrieved.
+ * Get form field values as deep object.
+ *
+ * Example:
+ * <form>
+ * <input name="a" value="1">
+ * <input name="b[c]" value="2">
+ * <input name="b[d]" value="3">
+ * <input name="e[f][]" value="4">
+ * <input name="e[f][]" value="5">
+ * </form>
+ *
+ * ... will result in:
+ *
+ * {
+ * a: "1",
+ * b: {
+ * c: "2",
+ * d: "3"
+ * },
+ * e: {
+ * f: ["4", "5"]
+ * }
+ * }
+ *
+ * @param {HTMLFormElement} form
*
* @return {object}
*/
@@ -957,6 +979,8 @@ function getFormFields(form) {
const fields = {};
for (let [key, value] of new FormData(form)) {
+ value = value.replace(/\r?\n/g, '\r\n');
+
const key_parts = [...key.matchAll(/[^\[\]]+|\[\]/g)];
let key_fields = fields;
diff --git a/ui/js/hostinterfacemanager.js b/ui/js/hostinterfacemanager.js
index b36da078ef4..747bdab679e 100644
--- a/ui/js/hostinterfacemanager.js
+++ b/ui/js/hostinterfacemanager.js
@@ -112,8 +112,6 @@ class HostInterfaceManager {
this.interfaces[value.interfaceid] = value;
});
-
- return this;
}
/**
@@ -410,10 +408,9 @@ class HostInterfaceManager {
this.data[interfaceid].useip = use_ip;
- [...elem.querySelectorAll('input[name$="[ip]"], input[name$="[dns]"]')].map((el) => {
+ [...elem.querySelectorAll('input[name$="[ip]"], input[name$="[dns]"]')].map((el) =>
el.removeAttribute('aria-required')
- return el;
- });
+ );
elem
.querySelector((use_ip == HostInterfaceManager.INTERFACE_USE_IP) ? '[name$="[ip]"]' : '[name$="[dns]"]')
@@ -515,7 +512,7 @@ class HostInterfaceManager {
}
makeReadonly() {
- [...document.querySelectorAll('.' + HostInterfaceManager.ZBX_STYLE_HOST_INTERFACE_ROW)].map((row) => {
+ [...document.querySelectorAll('.' + HostInterfaceManager.ZBX_STYLE_HOST_INTERFACE_ROW)].forEach((row) => {
[...row.querySelectorAll('input, z-select')].map((el) => {
this.setReadonly(el);
});
diff --git a/ui/jsrpc.php b/ui/jsrpc.php
index 75df7a95427..5758f0058e8 100644
--- a/ui/jsrpc.php
+++ b/ui/jsrpc.php
@@ -268,7 +268,7 @@ switch ($data['method']) {
case 'graph_prototypes':
$options = [
'output' => ['graphid', 'name'],
- 'selectHosts' => ['name'],
+ 'selectHosts' => ['hostid', 'name'],
'hostids' => array_key_exists('hostid', $data) ? $data['hostid'] : null,
'templated' => array_key_exists('real_hosts', $data) ? false : null,
'search' => array_key_exists('search', $data) ? ['name' => $data['search']] : null,
@@ -277,6 +277,8 @@ switch ($data['method']) {
];
if ($data['object_name'] === 'graph_prototypes') {
+ $options['selectDiscoveryRule'] = ['hostid'];
+
$records = API::GraphPrototype()->get($options);
}
else {
@@ -290,10 +292,18 @@ switch ($data['method']) {
}
foreach ($records as $record) {
+ if ($data['object_name'] === 'graphs') {
+ $host_name = $record['hosts'][0]['name'];
+ }
+ else {
+ $host_names = array_column($record['hosts'], 'name', 'hostid');
+ $host_name = $host_names[$record['discoveryRule']['hostid']];
+ }
+
$result[] = [
'id' => $record['graphid'],
'name' => $record['name'],
- 'prefix' => $record['hosts'][0]['name'].NAME_DELIMITER
+ 'prefix' => $host_name.NAME_DELIMITER
];
}
break;
@@ -617,8 +627,7 @@ switch ($data['method']) {
case 'patternselect.get':
$search = (array_key_exists('search', $data) && $data['search'] !== '') ? $data['search'] : null;
- $wildcard_enabled = (strpos($search, '*') !== false);
- $result = [];
+ $wildcard_enabled = array_key_exists('wildcard_allowed', $data) && strpos($search, '*') !== false;
switch ($data['object_name']) {
case 'hosts':
@@ -638,10 +647,7 @@ switch ($data['method']) {
'output' => ['name'],
'search' => ['name' => $search.($wildcard_enabled ? '*' : '')],
'searchWildcardsEnabled' => $wildcard_enabled,
- 'filter' => [
- 'value_type' => [ITEM_VALUE_TYPE_UINT64, ITEM_VALUE_TYPE_FLOAT],
- 'flags' => ZBX_FLAG_DISCOVERY_NORMAL
- ],
+ 'filter' => array_key_exists('filter', $data) ? $data['filter'] : null,
'templated' => array_key_exists('real_hosts', $data) ? false : null,
'webitems' => array_key_exists('webitems', $data) ? $data['webitems'] : null,
'limit' => $limit
diff --git a/ui/setup.php b/ui/setup.php
index 1ad2e4edb0c..cc585565269 100644
--- a/ui/setup.php
+++ b/ui/setup.php
@@ -156,7 +156,7 @@ DBclose();
$setup_wizard = new CSetupWizard();
// page title
-(new CPageHeader(_('Installation')))
+(new CPageHeader(_('Installation'), substr($default_lang, 0, strpos($default_lang, '_'))))
->addCssFile('assets/styles/'.CHtml::encode($default_theme).'.css')
->addJsFile((new CUrl('js/browsers.js'))->getUrl())
->addJsFile((new CUrl('jsLoader.php'))
@@ -185,9 +185,7 @@ $sub_footer = (new CDiv([_('Licensed under'), ' ', $link]))->addClass(ZBX_STYLE_
(new CDiv([
(new CTag('main', true, [$setup_wizard, $sub_footer])), makePageFooter()])
)->addClass(ZBX_STYLE_LAYOUT_WRAPPER)
-))
- ->setAttribute('lang', substr($default_lang, 0, strpos($default_lang, '_')))
- ->show();
+))->show();
?>
</html>
diff --git a/ui/tests/api_json/testAPIInfo.php b/ui/tests/api_json/testAPIInfo.php
index 6264b7fed5d..1e4f86d6a0f 100644
--- a/ui/tests/api_json/testAPIInfo.php
+++ b/ui/tests/api_json/testAPIInfo.php
@@ -36,6 +36,6 @@ class testAPIInfo extends CAPITest {
$this->disableAuthorization();
$result = $this->call('apiinfo.version', []);
- $this->assertSame('6.0.3', $result['result']);
+ $this->assertSame('6.0.4', $result['result']);
}
}
diff --git a/ui/tests/include/CTest.php b/ui/tests/include/CTest.php
index d869a7f047c..3ee5a2c49c6 100644
--- a/ui/tests/include/CTest.php
+++ b/ui/tests/include/CTest.php
@@ -243,8 +243,6 @@ class CTest extends TestCase {
if (!self::executeCallbacks($this, $callbacks)) {
self::markTestSuiteSkipped();
throw new Exception(implode("\n", static::$warnings));
-
- return;
}
// Store callback to be executed later.
diff --git a/ui/tests/include/web/elements/COverlayDialogElement.php b/ui/tests/include/web/elements/COverlayDialogElement.php
index 9716bbd7a45..64b02b23863 100644
--- a/ui/tests/include/web/elements/COverlayDialogElement.php
+++ b/ui/tests/include/web/elements/COverlayDialogElement.php
@@ -95,12 +95,10 @@ class COverlayDialogElement extends CElement {
/**
* Close overlay dialog.
- *
- * @return $this
*/
public function close() {
$this->query('class:overlay-close-btn')->one()->click();
- return $this->ensureNotPresent();
+ $this->ensureNotPresent();
}
/**
diff --git a/ui/tests/selenium/SeleniumTests.php b/ui/tests/selenium/SeleniumTests.php
index 06d5d4ffd5a..34c5c0f2aa9 100644
--- a/ui/tests/selenium/SeleniumTests.php
+++ b/ui/tests/selenium/SeleniumTests.php
@@ -186,6 +186,7 @@ require_once dirname(__FILE__).'/dashboard/testDashboardDynamicItemWidgets.php';
require_once dirname(__FILE__).'/dashboard/testDashboardGraphWidget.php';
require_once dirname(__FILE__).'/dashboard/testDashboardHostAvailabilityWidget.php';
require_once dirname(__FILE__).'/dashboard/testDashboardProblemsBySeverityWidget.php';
+require_once dirname(__FILE__).'/dashboard/testDashboardItemValueWidget.php';
require_once dirname(__FILE__).'/dashboard/testDashboardSystemInformationWidget.php';
require_once dirname(__FILE__).'/dashboard/testDashboardTopHostsWidget.php';
require_once dirname(__FILE__).'/dashboard/testDashboardPages.php';
@@ -384,6 +385,7 @@ class SeleniumTests {
$suite->addTestSuite('testDashboardGraphWidget');
$suite->addTestSuite('testDashboardHostAvailabilityWidget');
$suite->addTestSuite('testDashboardProblemsBySeverityWidget');
+ $suite->addTestSuite('testDashboardItemValueWidget');
$suite->addTestSuite('testDashboardSystemInformationWidget');
$suite->addTestSuite('testDashboardTopHostsWidget');
$suite->addTestSuite('testDashboardPages');
diff --git a/ui/tests/selenium/dashboard/testDashboardCopyWidgets.php b/ui/tests/selenium/dashboard/testDashboardCopyWidgets.php
index a0d2f691f9c..a7fb52f1a68 100644
--- a/ui/tests/selenium/dashboard/testDashboardCopyWidgets.php
+++ b/ui/tests/selenium/dashboard/testDashboardCopyWidgets.php
@@ -26,9 +26,9 @@ require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
*/
class testDashboardCopyWidgets extends CWebTest {
- const DASHBOARD_ID = 1300;
+ const DASHBOARD_IDS = [13000, 14000];
const PASTE_DASHBOARD_ID = 1310;
- const NEW_PAGE_ID = 14300;
+ const NEW_PAGE_IDS = [13001, 14001];
const NEW_PAGE_NAME = 'Test_page';
const UPDATE_TEMPLATEID = 50000;
const TEMPLATED_PAGE_NAME = 'Page for pasting widgets';
@@ -135,6 +135,21 @@ class testDashboardCopyWidgets extends CWebTest {
'value' => 700016
]
]
+ ],
+ [
+ 'type' => 'item',
+ 'name' => 'Item value widget',
+ 'x' => 13,
+ 'y' => 4,
+ 'width' => 4,
+ 'height' => 4,
+ 'fields' => [
+ [
+ 'type' => 0,
+ 'name' => 'itemid',
+ 'value' => 400410
+ ]
+ ]
]
]
],
@@ -159,48 +174,92 @@ class testDashboardCopyWidgets extends CWebTest {
}
/**
- * Data provider for copying widgets.
+ * Data provider for copying widgets from the first dashboard.
+ */
+ public static function getCopyWidgetsFirstData() {
+ return CDBHelper::getDataProvider('SELECT * FROM widget w'.
+ ' WHERE EXISTS ('.
+ 'SELECT NULL'.
+ ' FROM dashboard_page dp'.
+ ' WHERE w.dashboard_pageid=dp.dashboard_pageid'.
+ ' AND dp.dashboardid='.self::DASHBOARD_IDS[0].
+ ') ORDER BY w.widgetid DESC'
+ );
+ }
+
+ /**
+ * Data provider for copying widgets from the second dashboard.
*/
- public static function getCopyWidgetsData() {
+ public static function getCopyWidgetsSecondData() {
return CDBHelper::getDataProvider('SELECT * FROM widget w'.
' WHERE EXISTS ('.
'SELECT NULL'.
' FROM dashboard_page dp'.
' WHERE w.dashboard_pageid=dp.dashboard_pageid'.
- ' AND dp.dashboardid='.self::DASHBOARD_ID.
+ ' AND dp.dashboardid='.self::DASHBOARD_IDS[1].
') ORDER BY w.widgetid DESC'
);
}
/**
- * @dataProvider getCopyWidgetsData
+ * @dataProvider getCopyWidgetsFirstData
*/
- public function testDashboardCopyWidgets_SameDashboard($data) {
- $this->copyWidgets($data);
+ public function testDashboardCopyWidgets_SameDashboard_1($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[0]);
}
/**
- * @dataProvider getCopyWidgetsData
+ * @dataProvider getCopyWidgetsSecondData
+ */
+ public function testDashboardCopyWidgets_SameDashboard_2($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[1]);
+ }
+
+
+ /**
+ * @dataProvider getCopyWidgetsFirstData
*/
- public function testDashboardCopyWidgets_OtherDashboard($data) {
- $this->copyWidgets($data, true);
+ public function testDashboardCopyWidgets_OtherDashboard_1($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[0], null, true);
}
/**
- * @dataProvider getCopyWidgetsData
+ * @dataProvider getCopyWidgetsSecondData
*/
- public function testDashboardCopyWidgets_ReplaceWidget($data) {
- $this->copyWidgets($data, true, true);
+ public function testDashboardCopyWidgets_OtherDashboard_2($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[1], null, true);
}
/**
- * @dataProvider getCopyWidgetsData
+ * @dataProvider getCopyWidgetsFirstData
*/
- public function testDashboardCopyWidgets_NewPage($data) {
- $this->copyWidgets($data, false, false, true);
+ public function testDashboardCopyWidgets_ReplaceWidget_1($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[0], null, true, true);
}
- private function copyWidgets($data, $new_dashboard = false, $replace = false, $new_page = false, $templated = false) {
+ /**
+ * @dataProvider getCopyWidgetsSecondData
+ */
+ public function testDashboardCopyWidgets_ReplaceWidget_2($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[1], null, true, true);
+ }
+
+ /**
+ * @dataProvider getCopyWidgetsFirstData
+ */
+ public function testDashboardCopyWidgets_NewPage_1($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[0], self::NEW_PAGE_IDS[0], false, false, true);
+ }
+
+ /**
+ * @dataProvider getCopyWidgetsSecondData
+ */
+ public function testDashboardCopyWidgets_NewPage_2($data) {
+ $this->copyWidgets($data, self::DASHBOARD_IDS[1], self::NEW_PAGE_IDS[1], false, false, true);
+ }
+
+ private function copyWidgets($data, $start_dashboard, $paste_page_id = null, $new_dashboard = false, $replace = false,
+ $new_page = false, $templated = false) {
$name = $data['name'];
// Exclude Map navigation tree widget from replacing tests.
@@ -224,10 +283,10 @@ class testDashboardCopyWidgets extends CWebTest {
$url = 'zabbix.php?action=template.dashboard.edit&dashboardid=';
}
else {
- $dashboard_id = self::DASHBOARD_ID;
+ $dashboard_id = $start_dashboard;
$new_dashboard_id = self::PASTE_DASHBOARD_ID;
$new_page_name = self::NEW_PAGE_NAME;
- $new_page_id = self::NEW_PAGE_ID;
+ $new_page_id = $paste_page_id;
$url = 'zabbix.php?action=dashboard.view&dashboardid=';
}
@@ -374,6 +433,12 @@ class testDashboardCopyWidgets extends CWebTest {
],
[
[
+ 'name' => 'Item value widget',
+ 'copy to' => 'same page'
+ ]
+ ],
+ [
+ [
'name' => 'Clock widget',
'copy to' => 'another page'
]
@@ -404,6 +469,12 @@ class testDashboardCopyWidgets extends CWebTest {
],
[
[
+ 'name' => 'Item value widget',
+ 'copy to' => 'another page'
+ ]
+ ],
+ [
+ [
'name' => 'Clock widget',
'copy to' => 'another dashboard'
]
@@ -434,6 +505,12 @@ class testDashboardCopyWidgets extends CWebTest {
],
[
[
+ 'name' => 'Item value widget',
+ 'copy to' => 'another dashboard'
+ ]
+ ],
+ [
+ [
'name' => 'Clock widget',
'copy to' => 'another template'
]
@@ -453,15 +530,15 @@ class testDashboardCopyWidgets extends CWebTest {
public function testDashboardCopyWidgets_CopyTemplateWidgets($data) {
switch ($data['copy to']) {
case 'same page':
- $this->copyWidgets($data, false, false, false, true);
+ $this->copyWidgets($data, self::$dashboardid_with_widgets, null, false, false, false, true);
break;
case 'another page':
- $this->copyWidgets($data, false, false, true, true);
+ $this->copyWidgets($data, self::$dashboardid_with_widgets, null, false, false, true, true);
break;
case 'another dashboard':
- $this->copyWidgets($data, true, false, false, true);
+ $this->copyWidgets($data, self::$dashboardid_with_widgets, null, true, false, false, true);
break;
case 'another template':
diff --git a/ui/tests/selenium/dashboard/testDashboardDynamicItemWidgets.php b/ui/tests/selenium/dashboard/testDashboardDynamicItemWidgets.php
index 5daad1b739f..5197239bbac 100644
--- a/ui/tests/selenium/dashboard/testDashboardDynamicItemWidgets.php
+++ b/ui/tests/selenium/dashboard/testDashboardDynamicItemWidgets.php
@@ -72,8 +72,8 @@ class testDashboardDynamicItemWidgets extends CWebTest {
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP1 (IP1)'],
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP1 (IP1)'],
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP2 (I1, IP1, H1I2)'],
- ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP3 (H1IP1)']
-// ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP4 (H1IP1 and H2I1)']
+ ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP3 (H1IP1)'],
+ ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP4 (H1IP1 and H2I1)']
]
]
],
@@ -126,8 +126,8 @@ class testDashboardDynamicItemWidgets extends CWebTest {
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP1 (IP1)'],
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP1 (IP1)'],
['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets GP2 (I1, IP1, H1I2)'],
- ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP3 (H1IP1)']
-// ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP4 (H1IP1 and H2I1)']
+ ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP3 (H1IP1)'],
+ ['type' => 'Graph prototype', 'header' => 'Dynamic widgets H1: Dynamic widgets H1 GP4 (H1IP1 and H2I1)']
]
]
],
@@ -301,6 +301,7 @@ class testDashboardDynamicItemWidgets extends CWebTest {
);
$this->assertWidgetContent($data['widgets']);
+
// Check that after page refresh widgets remain the same.
$this->page->refresh();
$this->page->waitUntilReady();
@@ -310,8 +311,7 @@ class testDashboardDynamicItemWidgets extends CWebTest {
private function assertWidgetContent($data) {
$dashboard = CDashboardElement::find()->one();
$widgets = $dashboard->getWidgets();
-// TODO: uncomment "count" and widget name in 1 and 2 test case of data provider after fix ZBX-18271
-// $this->assertEquals(count($data), $widgets->count());
+ $this->assertEquals(count($data), $widgets->count());
foreach ($data as $key => $expected) {
$widget = $widgets->get($key);
diff --git a/ui/tests/selenium/dashboard/testDashboardItemValueWidget.php b/ui/tests/selenium/dashboard/testDashboardItemValueWidget.php
new file mode 100644
index 00000000000..dcca2f89d98
--- /dev/null
+++ b/ui/tests/selenium/dashboard/testDashboardItemValueWidget.php
@@ -0,0 +1,921 @@
+<?php
+
+/*
+** Zabbix
+** Copyright (C) 2001-2022 Zabbix SIA
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+**/
+
+require_once dirname(__FILE__).'/../../include/CWebTest.php';
+require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
+
+/**
+ * @backup dashboard
+ *
+ * @onBefore prepareDashboardData
+ */
+class testDashboardItemValueWidget extends CWebTest {
+
+ /**
+ * Attach MessageBehavior to the test.
+ *
+ * @return array
+ */
+ public function getBehaviors() {
+ return [
+ 'class' => CMessageBehavior::class
+ ];
+ }
+
+ protected static $dashboardid;
+ protected static $old_name = 'New widget';
+ private $sql = 'SELECT wf.widgetid, wf.type, wf.name, wf.value_int, wf.value_str, wf.value_groupid, wf.value_hostid,'.
+ ' wf.value_itemid, wf.value_graphid, wf.value_sysmapid, w.widgetid, w.dashboard_pageid, w.type, w.name, w.x, w.y,'.
+ ' w.width, w.height'.
+ ' FROM widget_field wf'.
+ ' INNER JOIN widget w'.
+ ' ON w.widgetid=wf.widgetid ORDER BY wf.widgetid, wf.name, wf.value_int, wf.value_str, wf.value_groupid,'.
+ ' wf.value_itemid, wf.value_graphid';
+
+ public static function prepareDashboardData() {
+ $response = CDataHelper::call('dashboard.create', [
+ [
+ 'name' => 'Dashboard for Single Item Widget test',
+ 'private' => 0,
+ 'pages' => [
+ [
+ 'name' => 'Page with widgets',
+ 'widgets' => [
+ [
+ 'type' => 'item',
+ 'name' => self::$old_name,
+ 'x' => 0,
+ 'y' => 0,
+ 'width' => 12,
+ 'height' => 4,
+ 'fields' => [
+ [
+ 'type' => 4,
+ 'name' => 'itemid',
+ 'value' => 42230
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'adv_conf',
+ 'value' => 1
+ ],
+ [
+ 'type' => 1,
+ 'name' => 'description',
+ 'value' => 'Some description here. Описание.'
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'desc_h_pos',
+ 'value' => 0
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'desc_v_pos',
+ 'value' => 0
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'time_h_pos',
+ 'value' => 2
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'time_v_pos',
+ 'value' => 2
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'desc_size',
+ 'value' => 17
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'decimal_size',
+ 'value' => 41
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'value_size',
+ 'value' => 56
+ ],
+ [
+ 'type' => 0,
+ 'name' => 'time_size',
+ 'value' => 14
+ ]
+ ]
+ ],
+ [
+ 'type' => 'item',
+ 'name' => 'Widget to delete',
+ 'x' => 13,
+ 'y' => 0,
+ 'width' => 4,
+ 'height' => 4,
+ 'fields' => [
+ [
+ 'type' => 4,
+ 'name' => 'itemid',
+ 'value' => 42230
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]);
+ self::$dashboardid = $response['dashboardids'][0];
+ }
+
+ /**
+ * Test to check Item Value Widget.
+ * Check authentication form fields layout.
+ */
+ public function testDashboardItemValueWidget_FormLayout() {
+ $this->page->login()->open('zabbix.php?action=dashboard.view&dashboardid='.self::$dashboardid)->waitUntilReady();
+ $dashboard = CDashboardElement::find()->waitUntilReady()->one();
+ $form = $dashboard->edit()->addWidget()->waitUntilReady()->asForm();
+ $form->fill(['Type' => 'Item value']);
+ $form->waitUntilReloaded();
+ $form->invalidate();
+
+ // Check default values with default Advanced configuration (false).
+ $default_values = [
+ 'Name' => '',
+ 'Refresh interval' => 'Default (1 minute)',
+ 'id:show_header' => true,
+ 'id:show_1' => true,
+ 'id:show_2' => true,
+ 'id:show_3' => true,
+ 'id:show_4' => true,
+ 'Advanced configuration' => false,
+ 'id:dynamic' => false
+ ];
+
+ foreach ($default_values as $field => $value) {
+ $this->assertEquals($value, $form->getField($field)->getValue());
+ }
+
+ // Check checkboxes dependency on Advanced configuration checkbox.
+ $description = [
+ 'id:description',
+ 'id:desc_h_pos',
+ 'id:desc_v_pos',
+ 'id:desc_size',
+ 'id:desc_bold'
+ // TODO: uncomment after DEV-2154 is ready.
+// 'id:desc_color'
+ ];
+
+ $values = [
+ 'id:decimal_places',
+ 'id:decimal_size',
+ 'id:value_h_pos',
+ 'id:value_size',
+ 'id:value_v_pos',
+ 'id:value_bold'
+ // TODO: uncomment after DEV-2154 is ready.
+// 'id:value_color'
+ ];
+
+ $units = [
+ 'id:units',
+ 'id:units_pos',
+ 'id:units_size',
+ 'id:units_bold'
+ // TODO: uncomment after DEV-2154 is ready.
+// 'id:units_color'
+ ];
+
+ $time = [
+ 'id:time_h_pos',
+ 'id:time_v_pos',
+ 'id:time_size',
+ 'id:time_bold'
+ // TODO: uncomment after DEV-2154 is ready.
+// 'id:time_color'
+ ];
+
+ $indicator_colors = [
+ // TODO: uncomment after DEV-2154 is ready.
+// 'id:up_color',
+// 'id:down_color',
+// 'id:updown_color',
+ ];
+
+ $background_color = [
+ // TODO: uncomment after DEV-2154 is ready.
+// 'lbl_bg_color'
+ ];
+
+ // Merge all Advanced fields into one array.
+ $fields = array_merge($description, $values, $units, $time, $indicator_colors, $background_color);
+
+ foreach ([false, true] as $advanced_config) {
+ $form->fill(['Advanced configuration' => $advanced_config]);
+
+ // Check that dynamic item checkbox is not depending on Advanced configuration checkbox state.
+ $dynamic_field = $form->getField('Dynamic item');
+ $this->assertTrue($dynamic_field->isVisible());
+ $this->assertTrue($dynamic_field->isEnabled());
+
+ // Check fields visibility depending on Advanced configuration checkbox state.
+ foreach ($fields as $field) {
+ $this->assertTrue($form->getField($field)->isVisible($advanced_config));
+ }
+
+ // Check advanced fields when Advanced configuration is true.
+ if ($advanced_config){
+ // Check hintbox.
+ $form->query('class:icon-help-hint')->one()->click();
+ $hint = $this->query('xpath:.//div[@data-hintboxid]')->waitUntilPresent();
+
+ // Assert text.
+ $this->assertEquals("Supported macros:".
+ "\n{HOST.*}".
+ "\n{ITEM.*}".
+ "\n{INVENTORY.*}".
+ "\nUser macros", $hint->one()->getText());
+
+ // Close the hint-box.
+ $hint->one()->query('xpath:.//button[@class="overlay-close-btn"]')->one()->click();
+ $hint->waitUntilNotPresent();
+
+ // Check default values with Advanced configuration = true.
+ $default_values_advanced = [
+ 'id:description' => '{ITEM.NAME}',
+ 'id:desc_h_pos' => 'Center',
+ 'id:desc_v_pos' => 'Bottom',
+ 'id:desc_size' => 15,
+ 'id:desc_bold' => false,
+ 'id:decimal_places' => 2,
+ 'id:decimal_size' => 35,
+ 'id:value_h_pos' => 'Center',
+ 'id:value_v_pos' => 'Middle',
+ 'id:value_size' => 45,
+ 'id:value_bold' => true,
+ 'id:units' => '',
+ 'id:units_pos' => 'After value',
+ 'id:units_size' => 35,
+ 'id:units_bold' => true
+ ];
+
+ foreach ($default_values_advanced as $field => $value) {
+ $this->assertEquals($value, $form->getField($field)->getValue());
+ }
+
+ // Check fields' lengths.
+ $field_lenghts = [
+ 'Name' => 255,
+ 'id:description' => 255,
+ 'id:desc_size' => 3,
+ 'id:decimal_places' => 2,
+ 'id:decimal_size' => 3,
+ 'id:value_size' => 3,
+ 'id:units' => 255,
+ 'id:units_size' => 3
+ ];
+
+ foreach ($field_lenghts as $field => $length) {
+ $this->assertEquals($length, $form->getField($field)->getAttribute('maxlength'));
+ }
+
+ // Check fields editability depending on "Show" checkboxes.
+ $config_editability = [
+ 'id:show_1' => $description,
+ 'id:show_2' => $values,
+ 'id:units_show' => $units,
+ 'id:show_3' => $time,
+ 'id:show_4' => $indicator_colors
+ ];
+
+ foreach ($config_editability as $config => $elements) {
+ foreach ([false, true] as $state) {
+ $form->fill([$config => $state]);
+
+ foreach ($elements as $element) {
+ $this->assertTrue($form->getField($element)->isEnabled($state));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static function getWidgetData() {
+ return [
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Refresh interval' => '30 seconds',
+ 'Item' => [
+ 'values' => '',
+ 'context' => [
+ 'values' => '',
+ 'context' => ''
+ ]
+ ]
+ ],
+ 'error' => ['Invalid parameter "Item": cannot be empty.']
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => '0',
+ // Value decimal part's size relative in %.
+ 'id:decimal_size' => '0',
+ // Value size in % relative to the size of the widget.
+ 'id:value_size' => '0',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '0',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '0'
+ ],
+ 'error' => [
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => '101',
+ // Value decimal part's size relative in %.
+ 'id:decimal_size' => '102',
+ // Value size in % relative to the size of the widget.
+ 'id:value_size' => '103',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '104',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '105'
+ ],
+ 'error' => [
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => '-1',
+ // Value decimal part's size relative in %.
+ 'id:decimal_size' => '-2',
+ // Value size in % relative to the size of the widget.
+ 'id:value_size' => '-3',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '-4',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '-5'
+ ],
+ 'error' => [
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => 'aqua',
+ // Value decimal part's size relative in %.
+ 'id:decimal_size' => 'один',
+ // Value size in % relative to the size of the widget.
+ 'id:value_size' => 'some',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '@6$',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '_+(*'
+ ],
+ 'error' => [
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.',
+ 'Invalid parameter "Size": value must be one of 1-100.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ 'id:decimal_places' => '-1'
+ ],
+ 'error' => [
+ 'Invalid parameter "Decimal places": value must be one of 0-10.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ 'id:decimal_places' => '99'
+ ],
+ 'error' => [
+ 'Invalid parameter "Decimal places": value must be one of 0-10.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_BAD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => 'Available memory in %',
+ 'Advanced configuration' => true,
+ 'id:description' => ''
+ ],
+ 'error' => [
+ 'Invalid parameter "Description": cannot be empty.'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Item' => [
+ 'values' => 'Available memory',
+ 'context' => [
+ 'values' => 'ЗАББИКС Сервер',
+ 'context' => 'Zabbix servers'
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Name' => 'Any name',
+ 'Refresh interval' => 'No refresh',
+ 'Item' => 'Available memory in %'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Name' => 'Имя виджета',
+ 'Refresh interval' => '10 seconds',
+ 'Item' => [
+ 'values' => 'Master item',
+ 'context' => [
+ 'values' => 'Test item host',
+ 'context' => 'Zabbix servers'
+ ]
+ ],
+ // Description checkbox.
+ 'id:show_1' => true,
+ // Value checkbox.
+ 'id:show_2' => false,
+ // Time checkbox.
+ 'id:show_3' => true,
+ // Change indicator checkbox.
+ 'id:show_4' => false,
+ 'Advanced configuration' => true,
+ 'id:description' => 'Несколько слов. Dāži vārdi.',
+ // Description horizontal position.
+ 'id:desc_h_pos' => 'Right',
+ // Description vertical position.
+ 'id:desc_v_pos' => 'Bottom',
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => '1',
+ // Time horizontal position.
+ 'id:time_h_pos' => 'Right',
+ // Time vertical position.
+ 'id:time_v_pos' => 'Middle',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '21'
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'id:show_header' => false,
+ 'Name' => '#$%^&*()!@{}[]<>,.|',
+ 'Refresh interval' => '10 minutes',
+ 'Item' => 'Response code for step "testFormWeb1" of scenario "testFormWeb1".',
+ // Description checkbox.
+ 'id:show_1' => false,
+ // Value checkbox.
+ 'id:show_2' => true,
+ // Time checkbox.
+ 'id:show_3' => false,
+ // Change indicator checkbox.
+ 'id:show_4' => true,
+ 'Advanced configuration' => true,
+ // Value units type.
+ 'id:units' => 'Some Units',
+ // Value units position.
+ 'id:units_pos' => 'Below value',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '100',
+ 'id:units_bold' => true
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'Name' => 'New Single Item Widget',
+ 'Refresh interval' => '2 minutes',
+ 'Item' => 'Http agent item form',
+ // Description checkbox.
+ 'id:show_1' => true,
+ // Value checkbox.
+ 'id:show_2' => true,
+ // Time checkbox.
+ 'id:show_3' => true,
+ // Change indicator checkbox.
+ 'id:show_4' => true,
+ 'Advanced configuration' => true,
+ 'id:description' => 'Some description here.',
+ // Description horizontal position.
+ 'id:desc_h_pos' => 'Left',
+ // Description vertical position.
+ 'id:desc_v_pos' => 'Top',
+ // Description size in % relative to the size of the widget.
+ 'id:desc_size' => '11',
+ // Description bold font checkbox.
+ 'id:desc_bold' => true,
+ // Value decimal places count.
+ 'id:decimal_places' => '3',
+ // Value horizontal position.
+ 'id:value_h_pos' => 'Right',
+ // Value vertical position.
+ 'id:value_v_pos' => 'Bottom',
+ // Value decimal part's size relative in %.
+ 'id:decimal_size' => '32',
+ // Value size in % relative to the size of the widget.
+ 'id:value_size' => '46',
+ 'id:value_bold' => true,
+ 'id:units' => 's',
+ // Value units position.
+ 'id:units_pos' => 'Before value',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '36',
+ 'id:units_bold' => true,
+ // Time horizontal position.
+ 'id:time_h_pos' => 'Left',
+ // Time vertical position.
+ 'id:time_v_pos' => 'Bottom',
+ // Time size in % relative to the size of the widget.
+ 'id:time_size' => '13',
+ 'id:time_bold' => true,
+ 'Dynamic item' => true
+ ]
+ ]
+ ],
+ [
+ [
+ 'expected' => TEST_GOOD,
+ 'fields' => [
+ 'Type' => 'Item value',
+ 'id:show_header' => false,
+ 'Name' => 'Color pick',
+ 'Refresh interval' => '10 minutes',
+ 'Item' => 'Response code for step "testFormWeb1" of scenario "testFormWeb1".',
+ // Description checkbox.
+ 'id:show_1' => true,
+ // Value checkbox.
+ 'id:show_2' => true,
+ // Time checkbox.
+ 'id:show_3' => true,
+ // Change indicator checkbox.
+ 'id:show_4' => true,
+ 'Advanced configuration' => true,
+ 'id:units' => 'B',
+ // Value units position.
+ 'id:units_pos' => 'Below value',
+ // Value units size in % relative to the size of the widget.
+ 'id:units_size' => '99',
+ 'id:units_bold' => true
+ ],
+ 'colors' => [
+ 'id:lbl_desc_color' => 'AABBCC',
+ 'id:lbl_value_color' => 'CC11CC',
+ 'id:lbl_units_color' => 'BBCC55',
+ 'id:lbl_time_color' => '11AA00',
+ 'id:lbl_up_color' => '00FF00',
+ 'id:lbl_down_color' => 'FF0000',
+ 'id:lbl_updown_color' => '0000FF',
+ // Background color.
+ 'id:lbl_bg_color' => 'FFAAAA'
+ ]
+ ]
+ ]
+ ];
+ }
+
+ /**
+ * @backupOnce dashboard
+ * @dataProvider getWidgetData
+ */
+ public function testDashboardItemValueWidget_Create($data) {
+ $this->checkWidgetForm($data);
+ }
+
+ /**
+ * @dataProvider getWidgetData
+ */
+ public function testDashboardItemValueWidget_Update($data) {
+ $this->checkWidgetForm($data, true);
+ }
+
+ /**
+ * Function for check the changes.
+ *
+ * @param boolean $update updating is performed
+ */
+ public function checkWidgetForm($data, $update = false) {
+ $this->page->login()->open('zabbix.php?action=dashboard.view&dashboardid='.self::$dashboardid);
+ $dashboard = CDashboardElement::find()->one();
+ $old_widget_count = $dashboard->getWidgets()->count();
+
+ $form = ($update)
+ ? $dashboard->getWidget(self::$old_name)->edit()->asForm()
+ : $dashboard->edit()->addWidget()->asForm();
+
+ COverlayDialogElement::find()->one()->waitUntilReady();
+ $form->fill($data['fields']);
+
+ if ($update && !CTestArrayHelper::get($data['fields'], 'Name')) {
+ $form->fill(['Name' => '']);
+ }
+
+ if (array_key_exists('colors', $data)) {
+ foreach ($data['colors'] as $fieldid => $color) {
+ $form->query($fieldid)->one()->click()->waitUntilReady();
+ $this->query('xpath://div[@class="overlay-dialogue color-picker-dialogue"]')->asColorPicker()->one()->fill($color);
+ }
+ }
+
+ $values = $form->getFields()->asValues();
+
+ $form->submit();
+ $this->page->waitUntilReady();
+
+ if (CTestArrayHelper::get($data, 'expected', TEST_GOOD) === TEST_BAD) {
+ $old_hash = CDBHelper::getHash('SELECT * FROM widget ORDER BY widgetid');
+ $this->assertMessage($data['expected'], null, $data['error']);
+ $this->assertEquals($old_hash, CDBHelper::getHash('SELECT * FROM widget ORDER BY widgetid'));
+ }
+ else {
+ COverlayDialogElement::ensureNotPresent();
+
+ $header = CTestArrayHelper::get($data['fields'], 'Name')
+ ? $data['fields']['Name']
+ : $data['fields']['Item']['context']['values'].': '.$data['fields']['Item']['values'];
+
+ $dashboard->getWidget($header)->waitUntilReady();
+
+ // Save Dashboard to ensure that widget is correctly saved.
+ $dashboard->save();
+ $this->assertMessage(TEST_GOOD, 'Dashboard updated');
+
+ // Check widget count.
+ $this->assertEquals($old_widget_count + ($update ? 0 : 1), $dashboard->getWidgets()->count());
+
+ // Check new widget form fields and values in frontend.
+ $saved_form = $dashboard->getWidget($header)->edit();
+ $this->assertEquals($values, $saved_form->getFields()->asValues());
+
+ // As form is quite complex, show_header field should be checked separately.
+ if (array_key_exists('show_header', $data['fields'])) {
+ $saved_form->checkValue(['id:show_header' => $data['fields']['show_header']]);
+ }
+
+ // Check that widget is saved in DB for correct dashboard and correct dashboard page.
+ $this->assertEquals(1,
+ CDBHelper::getCount('SELECT * FROM widget w'.
+ ' WHERE EXISTS ('.
+ 'SELECT NULL'.
+ ' FROM dashboard_page dp'.
+ ' WHERE w.dashboard_pageid=dp.dashboard_pageid'.
+ ' AND dp.dashboardid='.self::$dashboardid.
+ ' AND w.name ='.zbx_dbstr(CTestArrayHelper::get($data['fields'], 'Name', '')).')'
+ ));
+
+ // Check that original widget was not left in DB.
+ if ($update) {
+ $this->assertEquals(0, CDBHelper::getCount('SELECT null from widget WHERE name = '.zbx_dbstr(self::$old_name)));
+ }
+
+ // Close widget popup and check update interval.
+ $saved_form->submit();
+ COverlayDialogElement::ensureNotPresent();
+ $dashboard->save();
+ $this->assertMessage(TEST_GOOD, 'Dashboard updated');
+
+ // Check new widget update interval.
+ $refresh = (CTestArrayHelper::get($data['fields'], 'Refresh interval') === 'Default (1 minute)')
+ ? '15 minutes'
+ : (CTestArrayHelper::get($data['fields'], 'Refresh interval', '1 minute'));
+ $this->assertEquals($refresh, CDashboardElement::find()->one()->getWidget($header)->getRefreshInterval());
+
+ // Write new name to update widget for update scenario.
+ if ($update) {
+ self::$old_name = $header;
+ }
+ }
+ }
+
+ public function testDashboardItemValueWidget_SimpleUpdate() {
+ $this->checkNoChanges();
+ }
+
+ public static function getCancelData() {
+ return [
+ // Cancel creating widget with saving the dashboard.
+ [
+ [
+ 'cancel_form' => true,
+ 'create_widget' => true,
+ 'save_dashboard' => true
+ ]
+ ],
+ // Cancel updating widget with saving the dashboard.
+ [
+ [
+ 'cancel_form' => true,
+ 'create_widget' => false,
+ 'save_dashboard' => true
+ ]
+ ],
+ // Create widget without saving the dashboard.
+ [
+ [
+ 'cancel_form' => false,
+ 'create_widget' => true,
+ 'save_dashboard' => false
+ ]
+ ],
+ // Update widget without saving the dashboard.
+ [
+ [
+ 'cancel_form' => false,
+ 'create_widget' => false,
+ 'save_dashboard' => false
+ ]
+ ]
+ ];
+ }
+
+ /**
+ * @dataProvider getCancelData
+ */
+ public function testDashboardItemValueWidget_Cancel($data) {
+ $this->checkNoChanges($data['cancel_form'], $data['create_widget'], $data['save_dashboard']);
+ }
+
+ /**
+ * Function for checking canceling form or submitting without any changes.
+ *
+ * @param boolean $cancel true if cancel scenario, false if form is submitted
+ * @param boolean $create true if create scenario, false if update
+ * @param boolean $save_dashboard true if dashboard will be saved, false if not
+ */
+ private function checkNoChanges($cancel = false, $create = false, $save_dashboard = true) {
+ $old_hash = CDBHelper::getHash($this->sql);
+
+ $this->page->login()->open('zabbix.php?action=dashboard.view&dashboardid='.self::$dashboardid);
+ $dashboard = CDashboardElement::find()->one();
+ $old_widget_count = $dashboard->getWidgets()->count();
+
+ $form = $create
+ ? $dashboard->edit()->addWidget()->asForm()
+ : $dashboard->getWidget(self::$old_name)->edit();
+
+ $dialog = COverlayDialogElement::find()->one()->waitUntilReady();
+
+ if (!$create) {
+ $values = $form->getFields()->asValues();
+ }
+ else {
+ $form->fill(['Type' => 'Item value']);
+ }
+
+ if ($cancel || !$save_dashboard) {
+ $form->fill([
+ 'Name' => 'Widget to cancel',
+ 'Item' => 'Available memory in %'
+ ]);
+ }
+
+ if ($cancel) {
+ $dialog->query('button:Cancel')->one()->click();
+ }
+ else {
+ $form->submit();
+ }
+
+ COverlayDialogElement::ensureNotPresent();
+
+ if (!$cancel) {
+ $dashboard->getWidget(!$save_dashboard ? 'Widget to cancel' : self::$old_name)->waitUntilReady();
+ }
+
+ if ($save_dashboard) {
+ $dashboard->save();
+ $this->assertMessage(TEST_GOOD, 'Dashboard updated');
+ }
+ else {
+ $dashboard->cancelEditing();
+ }
+
+ $this->assertEquals($old_widget_count, $dashboard->getWidgets()->count());
+
+ // Check that updating widget form values did not change in frontend.
+ if (!$create && !$save_dashboard) {
+ $this->assertEquals($values, $dashboard->getWidget(self::$old_name)->edit()->getFields()->asValues());
+ }
+
+ // Check that DB hash is not changed.
+ $this->assertEquals($old_hash, CDBHelper::getHash($this->sql));
+ }
+
+ public function testDashboardItemValueWidget_Delete() {
+ $name = 'Widget to delete';
+ $this->page->login()->open('zabbix.php?action=dashboard.view&dashboardid='.self::$dashboardid);
+ $dashboard = CDashboardElement::find()->one()->edit();
+ $old_widget_count = $dashboard->getWidgets()->count();
+ $this->assertEquals(true, $dashboard->getWidget($name)->isEditable());
+ $dashboard->deleteWidget($name);
+ $dashboard->save();
+ $this->assertMessage(TEST_GOOD, 'Dashboard updated');
+ $this->assertEquals($old_widget_count - 1, $dashboard->getWidgets()->count());
+ $this->assertEquals('', CDBHelper::getRow('SELECT * from widget WHERE name = '.zbx_dbstr('Widget to delete')));
+ }
+}
diff --git a/ui/tests/selenium/data/data_test.sql b/ui/tests/selenium/data/data_test.sql
index 062bd3c3928..57b1a02f331 100644
--- a/ui/tests/selenium/data/data_test.sql
+++ b/ui/tests/selenium/data/data_test.sql
@@ -2444,28 +2444,22 @@ INSERT INTO media (mediaid, userid, mediatypeid, sendto, active, severity, perio
INSERT INTO media (mediaid, userid, mediatypeid, sendto, active, severity, period) VALUES (6,3,1,'zabbix@zabbix.com',0,60,'1-5,09:00-18:00');
-- Dashboards and widgets for Copy widget tests
-INSERT INTO dashboard (dashboardid, name, userid, private, auto_start) VALUES (1300, 'Dashboard for Copying widgets', 1, 1, 0);
-INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (13000, 1300);
-INSERT INTO dashboard_page (dashboard_pageid, dashboardid, name, sortorder) VALUES (14300, 1300, 'Test_page', 1);
+-- Dashboard_1 for widgets copying
+INSERT INTO dashboard (dashboardid, name, userid, private, auto_start) VALUES (13000, 'Dashboard_1 for Copying widgets', 1, 1, 0);
+INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (13000, 13000);
+INSERT INTO dashboard_page (dashboard_pageid, dashboardid, name, sortorder) VALUES (13001, 13000, 'Test_page', 1);
-INSERT INTO dashboard (dashboardid, name, userid, private) VALUES (1310, 'Dashboard for Paste widgets', 1, 1);
-INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (13100, 1310);
-
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10090, 13100, 'navtree', 'Test copy Map navigation tree', 0, 0, 6, 4);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (90479, 10090, 1, 'reference', 0, 'FYKXG');
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (0174, 13100, 'clock', 'Test widget for replace', 6, 0, 13, 8);
-
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10050, 13000, 'actionlog', 'Test copy Action log', 0, 0, 7, 6);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10050, 13000, 'actionlog', 'Test copy Action log', 0, 0, 7, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90250, 10050, 0, 'rf_rate', 10);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90251, 10050, 0, 'show_lines', 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90252, 10050, 0, 'sort_triggers', 7);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10051, 13000, 'clock', 'Test copy Clock', 7, 0, 2, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10051, 13000, 'clock', 'Test copy Clock', 18, 7, 2, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90253, 10051, 0, 'rf_rate', 60);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90254, 10051, 0, 'time_type', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (90412, 10051, 4, 'itemid', 0, 42229);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10052, 13000, 'dataover', 'Test copy Data overview', 9, 0, 4, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10052, 13000, 'dataover', 'Test copy Data overview', 18, 10, 6, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90255, 10052, 0, 'rf_rate', 0);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90256, 10052, 0, 'show_suppressed', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90257, 10052, 0, 'style', 1);
@@ -2473,23 +2467,23 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (90259, 10052, 2, 'groupids', 0, 50011);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (90260, 10052, 3, 'hostids', 0, 50012);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10053, 13000, 'graph', 'Test copy classic Graph', 13, 0, 11, 6);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10053, 13000, 'graph', 'Test copy classic Graph', 7, 0, 11, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90261, 10053, 0, 'dynamic', 10);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90262, 10053, 0, 'rf_rate', 30);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90263, 10053, 0, 'show_legend', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90264, 10053, 0, 'source_type', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (90265, 10053, 4, 'itemid', 0, 99088);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10054, 13000, 'favgraphs', 'Test copy Favourite graphs', 7, 2, 2, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10054, 13000, 'favgraphs', 'Test copy Favourite graphs', 20, 7, 4, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90413, 10054, 0, 'rf_rate', 30);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10055, 13000, 'favmaps', 'Test copy Favourite maps', 9, 2, 4, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10055, 13000, 'favmaps', 'Test copy Favourite maps', 14, 10, 4, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90266, 10055, 0, 'rf_rate', 600);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10056, 13000, 'discovery', 'Test copy Discovery status', 9, 4, 4, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10056, 13000, 'discovery', 'Test copy Discovery status', 8, 10, 6, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90267, 10056, 0, 'rf_rate', 900);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10058, 13000, 'graphprototype', 'Test copy Graph prototype', 0, 6, 13, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10058, 13000, 'graphprototype', 'Test copy Graph prototype', 0, 4, 13, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90269, 10058, 0, 'columns', 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90270, 10058, 0, 'rows', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90271, 10058, 0, 'dynamic', 1);
@@ -2497,7 +2491,7 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUE
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90273, 10058, 0, 'show_legend', 0);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_graphid) VALUES (900401, 10058, 7, 'graphid', 0, 600000);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10059, 13000, 'hostavail', 'Test copy Host availability', 13, 6, 5, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10059, 13000, 'hostavail', 'Test copy Host availability', 13, 4, 5, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90402, 10059, 0, 'interface_type', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90403, 10059, 0, 'interface_type', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904004, 10059, 0, 'interface_type', 3);
@@ -2506,11 +2500,11 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUE
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904007, 10059, 0, 'rf_rate', 60);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904008, 10059, 2, 'groupids', 0, 50013);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10060, 13000, 'map', 'Test copy Map', 18, 6, 6, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10060, 13000, 'map', 'Test copy Map', 18, 3, 6, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904009, 10060, 1, 'reference', 0, 'OYKZW');
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_sysmapid) VALUES (904010, 10060, 8, 'sysmapid', 0, 3);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10092, 13000, 'navtree', 'Test copy Map navigation tree', 0, 10, 6, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10092, 13000, 'navtree', 'Test copy Map navigation tree', 8, 8, 6, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904011, 10092, 0, 'navtree.order.2', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904012, 10092, 0, 'rf_rate', 60);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904013, 10092, 0, 'show_unavailable', 1);
@@ -2520,38 +2514,13 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904017, 10092, 8, 'navtree.sysmapid.1', 0, 6);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904018, 10092, 8, 'navtree.sysmapid.2', 0, 10);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10091, 13000, 'map', 'Test copy Map from tree', 6, 10, 7, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10091, 13000, 'map', 'Test copy Map from tree', 14, 8, 4, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904019, 10091, 0, 'rf_rate', 120);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904020, 10091, 0, 'source_type', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904021, 10091, 1, 'filter_widget_reference', 0, 'STZDI');
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904022, 10091, 1, 'reference', 0, 'PVEYR');
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10063, 13000, 'plaintext', 'Test copy plain text', 13, 10, 5, 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904023, 10063, 0, 'dynamic', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904024, 10063, 0, 'rf_rate', 0);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904025, 10063, 0, 'show_as_html', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904026, 10063, 0, 'show_lines', 12);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904027, 10063, 0, 'style', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (904028, 10063, 4, 'itemids', 0, 42230);
-
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10064, 13000, 'problemhosts', 'Test copy Problem hosts', 18, 10, 6, 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904029, 10064, 0, 'evaltype', 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904030, 10064, 0, 'ext_ack', 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904031, 10064, 0, 'hide_empty_groups', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904032, 10064, 0, 'rf_rate', 30);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904034, 10064, 0, 'severities', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904035, 10064, 0, 'severities', 3);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904036, 10064, 0, 'severities', 5);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904037, 10064, 0, 'show_suppressed', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904038, 10064, 0, 'tags.operator.0', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904039, 10064, 1, 'problem', 0, 'Test');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904040, 10064, 1, 'tags.tag.0', 0, 'Tag1');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904041, 10064, 1, 'tags.value.0', 0, 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904042, 10064, 2, 'exclude_groupids', 0, 50014);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904043, 10064, 2, 'groupids', 0, 50011);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (904044, 10064, 4, 'itemids', 0, 42230);
-
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10065, 13000, 'problems', 'Test copy Problems', 0, 12, 8, 6);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10065, 13000, 'problems', 'Test copy Problems', 0, 8, 8, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904045, 10065, 0, 'evaltype', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904046, 10065, 0, 'rf_rate', 900);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90321, 10065, 0, 'severities', 0);
@@ -2578,30 +2547,7 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904066, 10065, 2, 'groupids', 0, 50005);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (904067, 10065, 3, 'hostids', 0, 99026);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10066, 13000, 'problems', 'Test copy Problems 2', 8, 12, 16, 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904068, 10066, 0, 'rf_rate', 60);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904069, 10066, 0, 'show', 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904070, 10066, 0, 'show_lines', 5);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904071, 10066, 0, 'show_opdata', 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904072, 10066, 0, 'show_suppressed', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904073, 10066, 0, 'show_tags', 3);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904074, 10066, 0, 'show_timeline', 0);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904075, 10066, 0, 'sort_triggers', 3);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904076, 10066, 0, 'tag_name_format', 2);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904077, 10066, 0, 'tags.operator.0', 0);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904078, 10066, 0, 'tags.operator.1', 0);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904081, 10066, 0, 'unacknowledged', 1);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904082, 10066, 1, 'problem', 0, 'test4');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904083, 10066, 1, 'tags.value.0', 0, 3);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904084, 10066, 1, 'tags.value.1', 0, 44);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904085, 10066, 1, 'tag_priority', 0, 'test5, test6');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904086, 10066, 1, 'tags.tag.0', 0, 'tag3');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904087, 10066, 1, 'tags.tag.1', 0, 'tag44');
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904088, 10066, 2, 'exclude_groupids', 0, 50014);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904089, 10066, 2, 'groupids', 0, 50006);
-INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (904090, 10066, 3, 'hostids', 0, 99015);
-
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10067, 13000, 'problemsbysv', 'Test copy Problems by severity', 8, 14, 16, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10067, 13000, 'problemsbysv', 'Test copy Problems by severity', 18, 0, 6, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904091, 10067, 0, 'evaltype', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904092, 10067, 0, 'ext_ack', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904093, 10067, 0, 'layout', 1);
@@ -2618,11 +2564,17 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905005, 10067, 2, 'exclude_groupids', 0, 50008);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905006, 10067, 2, 'groupids', 0, 50011);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (905007, 10067, 3, 'hostids', 0, 99012);
+-- Please, don't add any widgets to Dashboard_1, for copying new widgets use Dashboard_2
+
+-- Dashboard_2 for widgets copying
+INSERT INTO dashboard (dashboardid, name, userid, private, auto_start) VALUES (14000, 'Dashboard_2 for Copying widgets', 1, 1, 0);
+INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (14000, 14000);
+INSERT INTO dashboard_page (dashboard_pageid, dashboardid, name, sortorder) VALUES (14001, 14000, 'Test_page', 1);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10068, 13000, 'systeminfo', 'Test copy System information', 0, 18, 7, 3);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10068, 14000, 'systeminfo', 'Test copy System information', 11, 0, 7, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905008, 10068, 0, 'rf_rate', 30);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10069, 13000, 'trigover', 'Test copy Trigger overview', 7, 18, 17, 3);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10069, 14000, 'trigover', 'Test copy Trigger overview', 5, 2, 6, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905009, 10069, 0, 'rf_rate', 120);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905010, 10069, 0, 'show', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905011, 10069, 0, 'show_suppressed', 1);
@@ -2631,19 +2583,67 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905014, 10069, 2, 'groupids', 0, 50011);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (905015, 10069, 3, 'hostids', 0, 99012);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10070, 13000, 'url', 'Test copy URL', 0, 21, 7, 3);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10066, 14000, 'problems', 'Test copy Problems 2', 0, 2, 5, 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904068, 10066, 0, 'rf_rate', 60);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904069, 10066, 0, 'show', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904070, 10066, 0, 'show_lines', 5);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904071, 10066, 0, 'show_opdata', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904072, 10066, 0, 'show_suppressed', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904073, 10066, 0, 'show_tags', 3);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904074, 10066, 0, 'show_timeline', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904075, 10066, 0, 'sort_triggers', 3);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904076, 10066, 0, 'tag_name_format', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904077, 10066, 0, 'tags.operator.0', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904078, 10066, 0, 'tags.operator.1', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904081, 10066, 0, 'unacknowledged', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904082, 10066, 1, 'problem', 0, 'test4');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904083, 10066, 1, 'tags.value.0', 0, 3);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904084, 10066, 1, 'tags.value.1', 0, 44);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904085, 10066, 1, 'tag_priority', 0, 'test5, test6');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904086, 10066, 1, 'tags.tag.0', 0, 'tag3');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904087, 10066, 1, 'tags.tag.1', 0, 'tag44');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904088, 10066, 2, 'exclude_groupids', 0, 50014);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904089, 10066, 2, 'groupids', 0, 50006);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (904090, 10066, 3, 'hostids', 0, 99015);
+
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10070, 14000, 'url', 'Test copy URL', 18, 0, 3, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905016, 10070, 0, 'dynamic', 1);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905017, 10070, 0, 'rf_rate', 120);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (905018, 10070, 1, 'url', 0, 'https://www.zabbix.com/integrations');
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10071, 13000, 'web', 'Test copy Web monitoring', 7, 21, 3, 3);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10063, 14000, 'plaintext', 'Test copy plain text', 0, 0, 5, 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904023, 10063, 0, 'dynamic', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904024, 10063, 0, 'rf_rate', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904025, 10063, 0, 'show_as_html', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904026, 10063, 0, 'show_lines', 12);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904027, 10063, 0, 'style', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (904028, 10063, 4, 'itemids', 0, 42230);
+
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10064, 14000, 'problemhosts', 'Test copy Problem hosts', 5, 0, 6, 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904029, 10064, 0, 'evaltype', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904030, 10064, 0, 'ext_ack', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904031, 10064, 0, 'hide_empty_groups', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904032, 10064, 0, 'rf_rate', 30);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904034, 10064, 0, 'severities', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904035, 10064, 0, 'severities', 3);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904036, 10064, 0, 'severities', 5);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904037, 10064, 0, 'show_suppressed', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (904038, 10064, 0, 'tags.operator.0', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904039, 10064, 1, 'problem', 0, 'Test');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904040, 10064, 1, 'tags.tag.0', 0, 'Tag1');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (904041, 10064, 1, 'tags.value.0', 0, 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904042, 10064, 2, 'exclude_groupids', 0, 50014);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (904043, 10064, 2, 'groupids', 0, 50011);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (904044, 10064, 4, 'itemids', 0, 42230);
+
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10071, 14000, 'web', 'Test copy Web monitoring', 21, 0, 3, 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905019, 10071, 0, 'maintenance', 0);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905020, 10071, 0, 'rf_rate', 120);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905021, 10071, 2, 'exclude_groupids', 0, 50008);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905022, 10071, 2, 'groupids', 0, 50016);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (905023, 10071, 3, 'hostids', 0, 99133);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10072, 13000, 'problems', 'Test copy Problems 3', 10, 21, 14, 2);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10072, 14000, 'problems', 'Test copy Problems 3', 19, 5, 5, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905024, 10072, 0, 'evaltype', 2);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905025, 10072, 0, 'rf_rate', 60);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905026, 10072, 0, 'severities', 0);
@@ -2669,7 +2669,7 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (905046, 10072, 2, 'groupids', 0, 50006);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (905047, 10072, 3, 'hostids', 0, 99015);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10073, 13000, 'graphprototype', 'Test copy Graph prototype 2', 10, 23, 14, 5);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10073, 14000, 'graphprototype', 'Test copy Graph prototype 2', 0, 4, 11, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905048, 10073, 0, 'columns', 20);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905049, 10073, 0, 'rows', 5);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905050, 10073, 0, 'dynamic', 0);
@@ -2677,7 +2677,7 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUE
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (90444, 10073, 0, 'show_legend', 0);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_graphid) VALUES (905053, 10073, 7, 'graphid', 0, 600000);
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10730, 13000, 'geomap', 'Geomap widget for copying', 0, 24, 10, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10730, 14000, 'geomap', 'Geomap widget for copying', 11, 2, 7, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (9050612, 10730, 2, 'groupids', 0, 4);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (9050613, 10730, 3, 'hostids', 0, 99136);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (9050614, 10730, 0, 'evaltype', 2);
@@ -2689,7 +2689,7 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUE
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (9050620, 10730, 1, 'tags.value.1', 0, 'value2');
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (9050621, 10730, 1, 'default.view', 0, '56.94417950974463, 24.231017685433184,17');
-INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (101101, 13000, 'tophosts', 'Test copy Top hosts', 0, 28, 10, 4);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (101101, 14000, 'tophosts', 'Test copy Top hosts', 11, 5, 8, 3);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_groupid) VALUES (9050622, 101101, 2, 'groupids', 0, 50011);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_hostid) VALUES (9050623, 101101, 3, 'hostids', 0, 50012);
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (9050624, 101101, 1, 'tags.tag.0', 0, 'tag_name');
@@ -2719,6 +2719,36 @@ INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (9050648, 101101, 1, 'columns.text.2', 0, 'text_here');
INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (9050649, 101101, 0, 'column', 0);
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10074, 14000, 'item', 'Test copy item value', 18, 2, 6, 3);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_itemid) VALUES (905056, 10074, 4, 'itemid', 0, 99142);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905057, 10074, 0, 'rf_rate', 60);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905058, 10074, 0, 'adv_conf', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905059, 10074, 0, 'desc_h_pos', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905060, 10074, 0, 'desc_v_pos', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905061, 10074, 0, 'desc_bold', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905062, 10074, 0, 'time_h_pos', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905063, 10074, 0, 'time_v_pos', 2);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905064, 10074, 0, 'time_bold', 1);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905065, 10074, 0, 'time_size', 16);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905066, 10074, 0, 'units_size', 34);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_str) VALUES (905067, 10074, 1, 'units', 'some');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_str) VALUES (905068, 10074, 1, 'bg_color', 'E1E1E1');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_str) VALUES (905069, 10074, 1, 'updown_color', 'FFB300');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_str) VALUES (905070, 10074, 1, 'up_color', 'CE93D8');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_str) VALUES (905071, 10074, 1, 'down_color', '29B6F6');
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905072, 10074, 0, 'value_v_pos', 0);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int) VALUES (905073, 10074, 0, 'dynamic', 1);
+
+-- Dashboard for Paste widgets in Copy widgets test
+INSERT INTO dashboard (dashboardid, name, userid, private) VALUES (1310, 'Dashboard for Paste widgets', 1, 1);
+INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (13100, 1310);
+
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (10090, 13100, 'navtree', 'Test copy Map navigation tree', 0, 0, 6, 4);
+INSERT INTO widget_field (widget_fieldid, widgetid, type, name, value_int, value_str) VALUES (90479, 10090, 1, 'reference', 0, 'FYKXG');
+
+INSERT INTO widget (widgetid, dashboard_pageid, type, name, x, y, width, height) VALUES (0174, 13100, 'clock', 'Test widget for replace', 6, 0, 13, 8);
+
+
-- Dashboard for Graph Prototype widget
INSERT INTO dashboard (dashboardid, name, userid, private) VALUES (1400, 'Dashboard for Graph Prototype widget', 1, 1);
INSERT INTO dashboard_page (dashboard_pageid, dashboardid) VALUES (1400, 1400);
diff --git a/ui/tests/selenium/testFormSetup.php b/ui/tests/selenium/testFormSetup.php
index 1830bf066c7..e8023496e8d 100644
--- a/ui/tests/selenium/testFormSetup.php
+++ b/ui/tests/selenium/testFormSetup.php
@@ -460,7 +460,7 @@ class testFormSetup extends CWebTest {
'value' => '/etc/apache2/magic'
],
'tls_encryption' => true,
- 'mysql_error' => 'Database error code 2002'
+ 'mysql_error' => 'Error connecting to database. Empty cipher.'
]
],
// Wrong "Database TLS key file" field format.
@@ -486,7 +486,7 @@ class testFormSetup extends CWebTest {
],
'tls_encryption' => true,
'fill_ca_file' => true,
- 'mysql_error' => 'Database error code 2002'
+ 'mysql_error' => 'Error connecting to database. Empty cipher.'
]
],
// Wrong "Database TLS certificate file" field format.
@@ -512,7 +512,7 @@ class testFormSetup extends CWebTest {
],
'tls_encryption' => true,
'fill_ca_file' => true,
- 'mysql_error' => 'Database error code 2002'
+ 'mysql_error' => 'Error connecting to database. Empty cipher.'
]
],
// With "Database TLS encryption" set.
diff --git a/ui/tests/selenium/testLanguage.php b/ui/tests/selenium/testLanguage.php
index 77bbae3562c..98994bd55b2 100644
--- a/ui/tests/selenium/testLanguage.php
+++ b/ui/tests/selenium/testLanguage.php
@@ -53,7 +53,7 @@ class testLanguage extends CWebTest {
],
'message' => 'Configuration updated',
'page_title' => 'Настройка веб-интерфейса',
- 'body_lang' => 'ru',
+ 'html_lang' => 'ru',
'defaultdb_lang' => 'ru_RU',
'info' => self::INFO_RUS,
'login_info' => [
@@ -69,7 +69,7 @@ class testLanguage extends CWebTest {
],
'message' => 'Настройки обновлены',
'page_title' => 'Configuration of GUI',
- 'body_lang' => 'en',
+ 'html_lang' => 'en',
'defaultdb_lang' => 'en_US',
'info' => self::INFO,
'login_info' => [
@@ -93,7 +93,7 @@ class testLanguage extends CWebTest {
$form->fill($data['field']);
$form->submit();
$this->page->waitUntilReady();
- $this->checkLanguage($data['message'], $data['page_title'], $data['body_lang'], $data['defaultdb_lang']);
+ $this->checkLanguage($data['message'], $data['page_title'], $data['html_lang'], $data['defaultdb_lang']);
// Red info icon check.
$this->query('xpath://a[@class="icon-info status-red"]')->one()->click();
@@ -102,10 +102,10 @@ class testLanguage extends CWebTest {
// After logout, warning message and login menu has system language.
$this->page->logout();
$this->page->refresh();
- $warning = ($data['body_lang'] == 'ru') ? self::WARNING_TITLE_RUS : self::WARNING_TITLE;
+ $warning = ($data['html_lang'] == 'ru') ? self::WARNING_TITLE_RUS : self::WARNING_TITLE;
$this->assertMessage(TEST_BAD, $warning);
$this->query('id:login')->one()->click();
- $this->assertEquals($data['body_lang'], $this->query('xpath://body')->one()->getAttribute('lang'));
+ $this->assertEquals($data['html_lang'], $this->query('xpath://html')->one()->getAttribute('lang'));
foreach ($data['login_info'] as $key => $value) {
$this->assertEquals($value, $this->query('xpath://label[@for="'.$key.'"]')->one()->getText());
@@ -121,7 +121,7 @@ class testLanguage extends CWebTest {
],
'message' => 'User updated',
'page_title' => 'Панель',
- 'body_lang' => 'ru',
+ 'html_lang' => 'ru',
'menu_lang' => 'en',
'userdb_lang' => 'ru_RU',
'defaultdb_lang' => 'en_US',
@@ -135,7 +135,7 @@ class testLanguage extends CWebTest {
],
'message' => 'Пользователь обновлен',
'page_title' => 'Dashboard',
- 'body_lang' => 'en',
+ 'html_lang' => 'en',
'menu_lang' => 'en',
'userdb_lang' => 'en_US',
'defaultdb_lang' => 'en_US',
@@ -149,7 +149,7 @@ class testLanguage extends CWebTest {
],
'message' => 'User updated',
'page_title' => 'Dashboard',
- 'body_lang' => 'en',
+ 'html_lang' => 'en',
'menu_lang' => 'en',
'userdb_lang' => 'default',
'defaultdb_lang' => 'en_US',
@@ -175,7 +175,7 @@ class testLanguage extends CWebTest {
$form->fill($data['field']);
$form->submit();
$this->page->waitUntilReady();
- $this->checkLanguage($data['message'], $data['page_title'], $data['body_lang'], $data['defaultdb_lang']);
+ $this->checkLanguage($data['message'], $data['page_title'], $data['html_lang'], $data['defaultdb_lang']);
$this->assertEquals($data['userdb_lang'], CDBHelper::getValue('SELECT lang FROM users WHERE username='.zbx_dbstr('user-zabbix')));
@@ -184,7 +184,7 @@ class testLanguage extends CWebTest {
$this->page->refresh();
$this->assertMessage(TEST_BAD, self::WARNING_TITLE);
$this->query('button:Login')->one()->click();
- $this->assertEquals($data['menu_lang'], $this->query('xpath://body')->one()->getAttribute('lang'));
+ $this->assertEquals($data['menu_lang'], $this->query('xpath://html')->one()->getAttribute('lang'));
$this->assertEquals('Username', $this->query('xpath://label[@for="name"]')->one()->getText());
$this->assertEquals('Password', $this->query('xpath://label[@for="password"]')->one()->getText());
}
@@ -203,7 +203,7 @@ class testLanguage extends CWebTest {
'Language' => 'Russian (ru_RU)'
],
'page_title' => 'Панель',
- 'body_lang' => 'ru',
+ 'html_lang' => 'ru',
'userdb_lang' => 'ru_RU',
'defaultdb_lang' => 'en_US'
]
@@ -220,7 +220,7 @@ class testLanguage extends CWebTest {
'Language' => 'System default'
],
'page_title' => 'Dashboard',
- 'body_lang' => 'en',
+ 'html_lang' => 'en',
'userdb_lang' => 'default',
'defaultdb_lang' => 'en_US'
]
@@ -237,7 +237,7 @@ class testLanguage extends CWebTest {
'Language' => 'English (en_US)'
],
'page_title' => 'Dashboard',
- 'body_lang' => 'en',
+ 'html_lang' => 'en',
'userdb_lang' => 'en_US',
'defaultdb_lang' => 'en_US'
]
@@ -260,16 +260,16 @@ class testLanguage extends CWebTest {
$this->page->logout();
$this->page->userLogin($data['fields']['Username'], $data['fields']['Password']);
$this->page->assertTitle($data['page_title']);
- $this->assertEquals($data['body_lang'], $this->query('xpath://body')->one()->getAttribute('lang'));
+ $this->assertEquals($data['html_lang'], $this->query('xpath://html')->one()->getAttribute('lang'));
$this->assertEquals($data['userdb_lang'], CDBHelper::getValue('SELECT lang FROM users WHERE username='.
zbx_dbstr($data['fields']['Username'])));
$this->assertEquals($data['defaultdb_lang'], CDBHelper::getValue('SELECT default_lang FROM config'));
}
- private function checkLanguage($message, $page_title, $body_lang, $defaultdb_lang) {
+ private function checkLanguage($message, $page_title, $html_lang, $defaultdb_lang) {
$this->assertMessage(TEST_GOOD, $message);
$this->page->assertTitle($page_title);
- $this->assertEquals($body_lang, $this->query('xpath://body')->one()->getAttribute('lang'));
+ $this->assertEquals($html_lang, $this->query('xpath://html')->one()->getAttribute('lang'));
$this->assertEquals($defaultdb_lang, CDBHelper::getValue('SELECT default_lang FROM config'));
}
}
diff --git a/ui/tests/selenium/testPageDashboardList.php b/ui/tests/selenium/testPageDashboardList.php
index 2707d671677..fae8bd0fd72 100644
--- a/ui/tests/selenium/testPageDashboardList.php
+++ b/ui/tests/selenium/testPageDashboardList.php
@@ -77,7 +77,7 @@ class testPageDashboardList extends CWebTest {
'fields' => [
'Show' => 'All'
],
- 'result_count' => 15
+ 'result_count' => 16
]
],
[
@@ -85,7 +85,7 @@ class testPageDashboardList extends CWebTest {
'fields' => [
'Show' => 'Created by me'
],
- 'result_count' => 14
+ 'result_count' => 15
]
],
[
@@ -103,7 +103,7 @@ class testPageDashboardList extends CWebTest {
'Name' => 'widget',
'Show' => 'Created by me'
],
- 'result_count' => 8
+ 'result_count' => 9
]
],
[
diff --git a/ui/tests/selenium/testPageHosts.php b/ui/tests/selenium/testPageHosts.php
index c7871fffb03..4e8e63ea06a 100644
--- a/ui/tests/selenium/testPageHosts.php
+++ b/ui/tests/selenium/testPageHosts.php
@@ -172,7 +172,7 @@ class testPageHosts extends CLegacyWebTest {
$this->zbxTestCheckTitle('Configuration of hosts');
$this->query('button:Reset')->one()->click();
- $this->zbxTestCheckboxSelect('ids_'.$hostid);
+ $this->zbxTestCheckboxSelect('hostids_'.$hostid);
$this->zbxTestClickButtonText('Disable');
$this->zbxTestAcceptAlert();
@@ -195,7 +195,7 @@ class testPageHosts extends CLegacyWebTest {
$this->zbxTestCheckTitle('Configuration of hosts');
$this->query('button:Reset')->one()->click();
- $this->zbxTestCheckboxSelect('ids_'.$hostid);
+ $this->zbxTestCheckboxSelect('hostids_'.$hostid);
$this->zbxTestClickButtonText('Enable');
$this->zbxTestAcceptAlert();
diff --git a/ui/tests/selenium/users/testFormUserProfile.php b/ui/tests/selenium/users/testFormUserProfile.php
index a8e2dc50fb3..24cb2a68647 100644
--- a/ui/tests/selenium/users/testFormUserProfile.php
+++ b/ui/tests/selenium/users/testFormUserProfile.php
@@ -542,12 +542,7 @@ class testFormUserProfile extends CLegacyWebTest {
$this->zbxTestDropdownSelect('mediatypeid', $data['type']);
}
- if (array_key_exists('send_to', $data) & !array_key_exists('type', $data)) {
- $this->zbxTestInputTypeByXpath('//div[@class="overlay-dialogue-body"]//input[@id="sendto"]', $data['send_to']);
- }
- else {
- $this->zbxTestInputTypeByXpath('//div[@class="overlay-dialogue-body"]//input[@id="sendto"]', $data['send_to']);
- }
+ $this->zbxTestInputTypeByXpath('//div[@class="overlay-dialogue-body"]//input[@id="sendto"]', $data['send_to']);
if (array_key_exists('period', $data)) {
$this->zbxTestInputClearAndTypeByXpath('//div[@class="overlay-dialogue-body"]//input[@id="period"]', $data['period']);
diff --git a/ui/tests/unit/include/classes/core/CRegistryFactoryTest.php b/ui/tests/unit/include/classes/core/CRegistryFactoryTest.php
index 2baf9326397..9f977a5ece8 100644
--- a/ui/tests/unit/include/classes/core/CRegistryFactoryTest.php
+++ b/ui/tests/unit/include/classes/core/CRegistryFactoryTest.php
@@ -44,11 +44,4 @@ class CRegistryFactoryTest extends TestCase {
$this->assertEquals(get_class($this->factory->getObject('string')), 'DateTime');
$this->assertEquals(get_class($this->factory->getObject('closure')), 'DateTime');
}
-
- /**
- * Test that the factory creates the object only once and returns the same object after that.
- */
- public function testObjectSame() {
- $this->assertTrue($this->factory->getObject('string') === $this->factory->getObject('string'));
- }
}