This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервис_snmp [2022/03/10 09:44] val [Сервис SNMP] |
сервис_snmp [2024/06/19 14:12] (current) val [Настройка snmptrapd сервиса] |
||
---|---|---|---|
Line 73: | Line 73: | ||
server# systemctl enable snmptrapd | server# systemctl enable snmptrapd | ||
+ | ubuntu24# systemctl status snmptrapd.socket | ||
</code> | </code> | ||
+ | === Debian/Ubuntu === | ||
+ | * Срабатывает более точный traphandle | ||
+ | * !!! В Ubuntu24 snmptrapd работает с правами Debian-snmp, надо использовать [[Пакет sudo]] | ||
- | === Debian/Ubuntu === | ||
<code> | <code> | ||
server# cat /etc/snmp/snmptrapd.conf | server# cat /etc/snmp/snmptrapd.conf | ||
Line 88: | Line 91: | ||
traphandle SNMPv2-SMI::enterprises.9.9.43.* /root/cisco-backup-config.sh | traphandle SNMPv2-SMI::enterprises.9.9.43.* /root/cisco-backup-config.sh | ||
+ | #traphandle SNMPv2-SMI::enterprises.9.9.43.* sudo /root/cisco-backup-config.sh | ||
#router RMON | #router RMON | ||
Line 113: | Line 117: | ||
/usr/bin/sshpass -p cisco /usr/bin/scp ${cisco_name}:running-config /srv/tftp/${cisco_name}-running-config | /usr/bin/sshpass -p cisco /usr/bin/scp ${cisco_name}:running-config /srv/tftp/${cisco_name}-running-config | ||
+ | #/usr/bin/sshpass -p cisco /usr/bin/scp -O ${cisco_name}:running-config /srv/tftp/${cisco_name}-running-config | ||
cd /srv/tftp/ | cd /srv/tftp/ | ||
/usr/bin/git add * | /usr/bin/git add * | ||
Line 162: | Line 167: | ||
=== Вывод количества байт, прошедших через порт устройства с момента его включения === | === Вывод количества байт, прошедших через порт устройства с момента его включения === | ||
<code> | <code> | ||
- | server# snmpget -c public -v2c -On router ifInOctets.3 | + | FastEthernet0/0 |
- | server# snmpget -c public -v2c -On router ifHCInOctets.3 | + | |
+ | server# snmpget -c public -v2c -On router ifInOctets.1 | ||
+ | server# snmpget -c public -v2c -On router ifHCInOctets.1 | ||
+ | |||
+ | Port-channel1 | ||
- | server# snmpget -c public -v2c -On router ifOutOctets.2 | + | server# snmpget -c public -v2c -On router ifOutOctets.5 |
- | server# snmpget -c public -v2c -On router ifHCOutOctets.2 | + | server# snmpget -c public -v2c -On router ifHCOutOctets.5 |
</code> | </code> | ||