This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервис_zabbix [2025/05/16 12:36] val [Мониторинг с использованием Zabbix agents] |
сервис_zabbix [2025/05/23 08:58] (current) val [Элементы типа trapper] |
||
---|---|---|---|
Line 151: | 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 226: | 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 237: | 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 619: | 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 1066: | 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 1083: | 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 1097: | 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 1167: | 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 1362: | 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 1371: | Line 1387: | ||
"method": "user.login", | "method": "user.login", | ||
"params": { | "params": { | ||
- | "user": "Admin", | + | "username": "Admin", |
"password": "zabbix" | "password": "zabbix" | ||
}, | }, | ||
Line 1505: | 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> |