This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
сервис_mrtg [2018/03/29 15:35] val [Использование не SNMP источника] |
сервис_mrtg [2022/03/24 16:33] val [Установка] |
||
---|---|---|---|
Line 8: | Line 8: | ||
freebsd# pkg install mrtg | freebsd# pkg install mrtg | ||
- | debian# apt install mrtg | + | debian/ubuntu# apt install mrtg |
</code> | </code> | ||
Line 70: | Line 70: | ||
===== Отладка ===== | ===== Отладка ===== | ||
<code> | <code> | ||
- | server# cat /WWWDATADIR/mrtg/*.log | + | server# cat /var/www/html/mrtg/*.log |
</code> | </code> | ||
Line 120: | Line 120: | ||
==== Использование скриптов ==== | ==== Использование скриптов ==== | ||
<code> | <code> | ||
- | # cat /etc/cisco-dhcp-stat.sh | + | # cat /etc/mrtg-dhcp-stat.sh |
</code><code> | </code><code> | ||
#!/bin/sh | #!/bin/sh | ||
- | CMD='rsh router show ip dhcp binding | grep 192.168 | wc -l' | + | #CMD='rsh router show ip dhcp binding | grep 192.168 | wc -l' |
+ | #MAX=9 | ||
+ | #CUR=`eval $CMD` | ||
- | MAX=99 | + | #CMD='/usr/bin/dhcpd-pools -l /var/lib/dhcp/dhcpd.leases -c /etc/dhcp/dhcpd.conf -f c | grep 192.168.X.' |
- | CUR=`eval $CMD` | + | #CMD='/usr/local/bin/dhcpd-pools -l /var/db/dhcpd/dhcpd.leases -c /usr/local/etc/dhcpd.conf -f c | grep 192.168.X.' |
+ | #MAX=`eval $CMD | cut -d'"' -f8` | ||
+ | #CUR=`eval $CMD | cut -d'"' -f10` | ||
echo $MAX | echo $MAX | ||
Line 137: | Line 141: | ||
</code><code> | </code><code> | ||
... | ... | ||
- | Target[cisco-dhcp-stat]: `/etc/cisco-dhcp-stat.sh` | + | Target[dhcp-stat]: `/etc/mrtg-dhcp-stat.sh` |
- | Title[cisco-dhcp-stat]: cisco-dhcp-stat (ip) | + | Title[dhcp-stat]: dhcp stat (ip) |
- | PageTop[cisco-dhcp-stat]: <H1>cisco-dhcp-stat (ip)</H1> | + | PageTop[dhcp-stat]: <H1>dhcp stat (ip)</H1> |
- | Options[cisco-dhcp-stat]: nobanner,gauge,noinfo,nopercent | + | Options[dhcp-stat]: nobanner,gauge,noinfo,nopercent |
- | MaxBytes[cisco-dhcp-stat]: 100 | + | MaxBytes[dhcp-stat]: 10 |
- | Unscaled[cisco-dhcp-stat]: dwmy | + | Unscaled[dhcp-stat]: dwmy |
- | YLegend[cisco-dhcp-stat]: Hosts (ip) | + | YLegend[dhcp-stat]: Hosts (ip) |
- | ShortLegend[cisco-dhcp-stat]: ip | + | ShortLegend[dhcp-stat]: ip |
- | LegendI[cisco-dhcp-stat]: dhcp leased | + | LegendI[dhcp-stat]: dhcp leased |
- | LegendO[cisco-dhcp-stat]: max ip in pool | + | LegendO[dhcp-stat]: max ip in pool |
</code> | </code> |