User Tools

Site Tools


сервис_zabbix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_zabbix [2024/08/20 08:17]
val [Обновление Zabbix]
сервис_zabbix [2025/05/23 08:58] (current)
val [Элементы типа trapper]
Line 7: Line 7:
 ===== Установка и запуск сервера ===== ===== Установка и запуск сервера =====
  
 +  * [[https://​www.zabbix.com/​release_notes|Release Notes for Zabbix]]
 ==== Установка SQL сервера ==== ==== Установка SQL сервера ====
  
Line 150: Line 151:
 # cat /​etc/​zabbix/​zabbix_proxy.conf # cat /​etc/​zabbix/​zabbix_proxy.conf
 </​code><​code>​ </​code><​code>​
-...+#...
 Hostname=gate Hostname=gate
-ConfigFrequency=60+ 
 +#v6 
 +#ConfigFrequency=60 
 +#v7 
 +#​ProxyConfigFrequency=60 
 +  ​
 Server=server Server=server
 DBName=/​var/​lib/​zabbix/​zabbix.db DBName=/​var/​lib/​zabbix/​zabbix.db
Line 201: Line 207:
 ===== Обновление Zabbix ===== ===== Обновление Zabbix =====
  
 +  * [[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade|Zabbix Documentation Upgrade procedure]] см. log_bin_trust_function_creators
   * [[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade/​packages/​debian_ubuntu|upgrade packages Debian/​Ubuntu]] и !!![[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade_notes_700|Upgrade notes for 7.0.0]]   * [[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade/​packages/​debian_ubuntu|upgrade packages Debian/​Ubuntu]] и !!![[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade_notes_700|Upgrade notes for 7.0.0]]
   * [[https://​bestmonitoringtools.com/​upgrade-zabbix-to-the-latest-version/​|Upgrade Zabbix (5.0, 5.2, 5.4) to 6.0 like a Pro (+6.0 to 6.4 guide)]]   * [[https://​bestmonitoringtools.com/​upgrade-zabbix-to-the-latest-version/​|Upgrade Zabbix (5.0, 5.2, 5.4) to 6.0 like a Pro (+6.0 to 6.4 guide)]]
-  * [[https://​www.zabbix.com/​documentation/​current/​manual/​installation/​upgrade/​packages/​debian_ubuntu|Steps required for a successful upgrade Zabbix]] + 
-  * [[https://​www.zabbix.com/​documentation/​current/​ru/​manual/​installation/​upgrade/​packages/​debian_ubuntu|Требуемые шаги для успешного обновления Zabbix]] +
-  * [[https://​www.zabbix.com/​documentation/​current/​en/​manual/​installation/​upgrade|Zabbix Documentation Upgrade procedure]]+
  
  
Line 225: Line 231:
 === Настройка подсистемы Email === === Настройка подсистемы Email ===
 <​code>​ <​code>​
-Administration->​Media types->​Email+Administration/Alerts->Media types->​Email
   SMTP server: server.corpX.un   SMTP server: server.corpX.un
   SMTP helo: server.corpX.un   SMTP helo: server.corpX.un
   SMTP email: zabbix@corpX.un   SMTP email: zabbix@corpX.un
  
-Administration->​Users->​student->​Media+Administration/Users->​Users->​student->​Media
   Type: Email   Type: Email
   Send to: student@corpX.un   Send to: student@corpX.un
Line 236: Line 242:
 === Настройка уведомлений о срабатывании триггеров === === Настройка уведомлений о срабатывании триггеров ===
 <​code>​ <​code>​
-Configuration->​Actions->​Event source: Triggers+Configuration/Alerts->​Actions->​Event source: Triggers
   Report problems to Zabbix administrators->​Enable   Report problems to Zabbix administrators->​Enable
   ...   ...
Line 618: Line 624:
 </​code><​code>​ </​code><​code>​
 #!/bin/sh #!/bin/sh
 +
 +### iperf ###
 +MY_RES=$(iperf -c gate.isp.un -t 5 -R -f b -y c)
 +MY_DOWNLOAD=$(echo $MY_RES | cut -d','​ -f9)
 +MY_RES=$(iperf -c gate.isp.un -t 5 -f b -y c)
 +MY_UPLOAD=$(echo $MY_RES | cut -d','​ -f9)
  
 ### speedtest-cli ### result bits/s ### speedtest-cli ### result bits/s
-MY_RES=`speedtest-cli --csv` +#MY_RES=`speedtest-cli --csv` 
-MY_DOWNLOAD=`echo $MY_RES | cut -d','​ -f7` +#MY_DOWNLOAD=`echo $MY_RES | cut -d','​ -f7` 
-MY_UPLOAD=`echo $MY_RES | cut -d','​ -f8`+#MY_UPLOAD=`echo $MY_RES | cut -d','​ -f8`
  
 ### speedtest ### result Bytes/s (use preprocess Custom multiplier) ### speedtest ### result Bytes/s (use preprocess Custom multiplier)
 #​MY_RES=`speedtest -f csv` #​MY_RES=`speedtest -f csv`
 #​MY_DOWNLOAD=`echo $MY_RES | cut -d','​ -f6` #​MY_DOWNLOAD=`echo $MY_RES | cut -d','​ -f6`
-#Y_UPLOAD=`echo $MY_RES | cut -d','​ -f7`+#MY_UPLOAD=`echo $MY_RES | cut -d','​ -f7`
  
 zabbix_sender -z 127.0.0.1 -p 10051 -s server.corpX.un -k speedtest.download -o $MY_DOWNLOAD zabbix_sender -z 127.0.0.1 -p 10051 -s server.corpX.un -k speedtest.download -o $MY_DOWNLOAD
Line 796: Line 808:
  
 === Примеры простых целочисленных триггеров === === Примеры простых целочисленных триггеров ===
 +
 +  * https://​www.zabbix.com/​documentation/​7.0/​ru/​manual/​config/​triggers/​expression
 +
 <​code>​ <​code>​
 Host: server.corpX.un Host: server.corpX.un
Line 928: Line 943:
 # apt install zabbix-get # apt install zabbix-get
  
-$ zabbix_get -s IP/​DNSNAME ​-p 10050 -k agent.version+$ zabbix_get -s IP/DNSNAME -k agent.version ​#-p 10050
 </​code>​ </​code>​
  
Line 1062: Line 1077:
  
 <​code>​ <​code>​
-Configuration->​Discovery+Data collection/Configuration->​Discovery
 Discovery rules Discovery rules
   Name: Local network ​   или ​   Cisco Router Discovery   Name: Local network ​   или ​   Cisco Router Discovery
Line 1079: Line 1094:
   Enabled: yes   Enabled: yes
  
-Configuration->​Actions+Alert/Configuration->​Actions
   Event source: Discovery   Event source: Discovery
-    Name: Action add snmp device to zabbix+    Name: Action add Cisco device to zabbix
     Conditions: ​     Conditions: ​
       Received value: like или contains router       Received value: like или contains router
Line 1093: Line 1108:
              4.XX Template Module Interfaces Simple SNMPv2              4.XX Template Module Interfaces Simple SNMPv2
              5.XX Template Net Cisco IOS SNMP       !!! Уменьшить период Network interfaces discovery !!!              5.XX Template Net Cisco IOS SNMP       !!! Уменьшить период Network interfaces discovery !!!
-             6.XX Cisco IOS by SNMP+        ​6.XX 7.XX Cisco IOS by SNMP
       Set host inventory mode: Automatic       Set host inventory mode: Automatic
     Add     Add
Line 1163: Line 1178:
 Configuration Configuration
   Templates   Templates
-    ​Template App SSH Service/SSH Service+    SSH Service
   Full Clone   Full Clone
-    ​Template App SSH Port Service/SSH Port Service+    SSH Port Service
   Add   Add
  
   Templates   Templates
-    ​Template App SSH Port Service/SSH Port Service+    ​Name: SSH Port Service 
 +      Template groups: Templates/Applications
       Items       Items
-        SSH service is running +        ​Name: SSH service is running 
-          Key: net.tcp.service[ssh,,​{$SSH_PORT}] +        Key: net.tcp.service[ssh,,​{$SSH_PORT}] 
-          Update interval: 30s+        Update interval: 30s 
 +      Triggers 
 +        Name: SSH service is down on {HOST.NAME} 
 +        Severity: Average 
 +        Expression: max(/SSH Port Service/​net.tcp.service[ssh,,​{$SSH_PORT}],#​3)=0
       Macros       Macros
         {$SSH_PORT}=22         {$SSH_PORT}=22
Line 1358: Line 1378:
  
   * [[https://​www.zabbix.com/​forum/​zabbix-troubleshooting-and-problems/​36900-api-key-lifetime|api key lifetime]]   * [[https://​www.zabbix.com/​forum/​zabbix-troubleshooting-and-problems/​36900-api-key-lifetime|api key lifetime]]
 +  * Для и до 6-й версии "​user":​ "​Admin",​
 <​code>​ <​code>​
 server:~# apt install curl server:~# apt install curl
Line 1367: Line 1387:
    "​method":​ "​user.login",​    "​method":​ "​user.login",​
    "​params":​ {    "​params":​ {
-      "user": "​Admin",​+      "username": "​Admin",​
       "​password":​ "​zabbix"​       "​password":​ "​zabbix"​
    },    },
Line 1501: Line 1521:
 } " http://​127.0.0.1/​zabbix/​api_jsonrpc.php } " http://​127.0.0.1/​zabbix/​api_jsonrpc.php
 </​code><​code>​ </​code><​code>​
-server.corp1.un:​~#​ /​root/​zab_set_map_name.sh 2 "ISP1"+server.corp1.un:​~#​ /​root/​zab_set_map_name.sh 2 "ISP 1"
 </​code>​ </​code>​
сервис_zabbix.1724131063.txt.gz · Last modified: 2024/08/20 08:17 by val