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
Next revision Both sides next revision
сервис_zabbix [2022/04/05 06:19]
val [Обработка SNMPTRAP]
сервис_zabbix [2022/07/28 08:41]
val [Мониторинг с использованием Zabbix agents]
Line 132: Line 132:
 # mkdir /​var/​lib/​zabbix # mkdir /​var/​lib/​zabbix
  
 +# В 6-й версии не нужно, БД будет создана автоматически
 # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3/​schema.sql.gz | sqlite3 /​var/​lib/​zabbix/​zabbix.db # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3/​schema.sql.gz | sqlite3 /​var/​lib/​zabbix/​zabbix.db
 </​code>​ </​code>​
Line 398: Line 399:
 {{HOSTNAME}:​{TRIGGER.KEY}.last(#​2)} {{HOSTNAME}:​{TRIGGER.KEY}.last(#​2)}
 </​code>​ </​code>​
 +
 +  * [[https://​www.zabbix.com/​forum/​zabbix-help/​445808-display-an-items-previous-value|Display an items previous value...does not work...]]
 ==== Простые проверки ==== ==== Простые проверки ====
  
Line 597: Line 600:
     Key:  speedtest.download     Key:  speedtest.download
     Type of information:​ Numeric (float) или Numeric (unsigned)     Type of information:​ Numeric (float) или Numeric (unsigned)
-    Units: ​Бит/сек+    Units: ​бит/​с ​ ​или ​ bit/s
     Allowed hosts: 127.0.0.1     Allowed hosts: 127.0.0.1
   Preprocessing ​   может понадобиться   Preprocessing ​   может понадобиться
Line 828: Line 831:
  
 === Пример с текстовым элементом === === Пример с текстовым элементом ===
 +Zabbix 5
 <​code>​ <​code>​
 Name: Host {HOST.NAME} nmap change Name: Host {HOST.NAME} nmap change
Line 835: Line 839:
   или   или
 Expression: {val.bmstu.ru:​my.nmap.diff()}=1 Expression: {val.bmstu.ru:​my.nmap.diff()}=1
 +</​code>​
 +Zabbix 6
 +<​code>​
 +Name: installed soft on host {HOST.NAME} change
 +Severity: Warning
 +
 +Expression: (last(/​Template OS Windows list installed soft Active/​listinstalledsoft,#​1)<>​last(/​Template OS Windows list installed soft Active/​listinstalledsoft,#​2))=1
 </​code>​ </​code>​
  
Line 977: Line 988:
  
   * Windows examples   * Windows examples
-  * [[PowerShell#​Список установленного ПО]] ​ !!! Попробовать вариант с форматированием+  * [[PowerShell#​Список установленного ПО]]
  
 <​code>​ <​code>​
Line 985: Line 996:
 Timeout=30 Timeout=30
  
-UserParameter=listinstalledsoft,​powershell -Command Get-ChildItem HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall;​ powershell -Command Get-ChildItem HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall+#UserParameter=listinstalledsoft,​powershell -Command Get-ChildItem HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall;​ powershell -Command Get-ChildItem HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
  
-#UserParameter=listinstalledsoft,​C:​\bin\listinstalledsoft.bat+UserParameter=listinstalledsoft,​C:​\bin\listinstalledsoft.bat ​| findstr /v "​^$"​
  
 UnsafeUserParameters=1 UnsafeUserParameters=1
Line 998: Line 1009:
 @echo off @echo off
  
-powershell -command "​Get-ItemProperty HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName | Format-Table -AutoSize -HideTableHeaders"​+powershell -command "​Get-ItemProperty HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall\* ​| Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName ​| Select-Object ​-Property DisplayName | Format-Table -AutoSize -HideTableHeaders"​ 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName | Select-Object -Property ​DisplayName | Format-Table -AutoSize -HideTableHeaders"​
  
-powershell -command "​Get-ItemProperty HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName | Format-Table -AutoSize -HideTableHeaders"​ 
 </​code>​ </​code>​
 ==== Мониторинг по протоколу SNMP ==== ==== Мониторинг по протоколу SNMP ====
Line 1043: Line 1054:
              4.XX Template Module Interfaces Simple SNMPv2              4.XX Template Module Interfaces Simple SNMPv2
              5.XX Template Net Cisco IOS SNMP                  !!!! Уменьшить период Discovery !!!!              5.XX Template Net Cisco IOS SNMP                  !!!! Уменьшить период Discovery !!!!
 +             6.XX Cisco IOS SNMP
       Set host inventory mode: Automatic       Set host inventory mode: Automatic
     Add     Add
Line 1059: Line 1071:
   * [[https://​www.zabbix.com/​documentation/​3.0/​ru/​manual/​config/​items/​itemtypes/​snmptrap|Zabbix Documentation SNMP трапы]]   * [[https://​www.zabbix.com/​documentation/​3.0/​ru/​manual/​config/​items/​itemtypes/​snmptrap|Zabbix Documentation SNMP трапы]]
   * [[https://​gist.github.com/​jpawlowski/​152abb4951f39ce1cfa0b1c5220b8635|SNMPTT installation on CentOS 7 for Zabbix integration]]   * [[https://​gist.github.com/​jpawlowski/​152abb4951f39ce1cfa0b1c5220b8635|SNMPTT installation on CentOS 7 for Zabbix integration]]
 +  * [[https://​programmersought.com/​article/​39768892920/​|How to deploy SNMP Traps in Centos8]]
   * [[https://​www.zabbix.com/​forum/​zabbix-help/​28463-catch-all-snmp-traps-with-general-event|catch all snmp traps with general event]]   * [[https://​www.zabbix.com/​forum/​zabbix-help/​28463-catch-all-snmp-traps-with-general-event|catch all snmp traps with general event]]
   * [[https://​blog.zabbix.com/​snmp-traps-in-zabbix/​8210/​|SNMP Traps in Zabbix]]   * [[https://​blog.zabbix.com/​snmp-traps-in-zabbix/​8210/​|SNMP Traps in Zabbix]]
 +  * [[https://​youtu.be/​fVK2YWdTalQ|youtube SNMP Traps in Zabbix Tutorial]]
  
 <​code>​ <​code>​
Line 1279: Line 1293:
       Name: On {HOST.NAME} in the DHCP pool {#POOLNAME}       Name: On {HOST.NAME} in the DHCP pool {#POOLNAME}
       Expression: {Template App DHCP Pools:​dhcp.pools.shared-network[{#​POOLNAME},​used].last()}/​{Template App DHCP Pools:​dhcp.pools.shared-network[{#​POOLNAME},​defined].last()}*100 > {$DHCP.POOLS.MAX.PERCENT}       Expression: {Template App DHCP Pools:​dhcp.pools.shared-network[{#​POOLNAME},​used].last()}/​{Template App DHCP Pools:​dhcp.pools.shared-network[{#​POOLNAME},​defined].last()}*100 > {$DHCP.POOLS.MAX.PERCENT}
 +                  last(/​Template App DHCP Pools/​dhcp.pools.shared-network[{#​POOLNAME},​used])/​last(/​Template App DHCP Pools/​dhcp.pools.shared-network[{#​POOLNAME},​defined])*100 > {$DHCP.POOLS.MAX.PERCENT}
       Severity: Warning       Severity: Warning
 </​code>​ </​code>​
сервис_zabbix.txt · Last modified: 2023/10/03 18:15 by val