By : Hendy Joe Sebenarnya ada banyak tool untuk log mikrotik, mikrotik sendiri menyediakan MT_Syslog running di windows, atau yang berbayar...
By : Hendy JoeSebenarnya ada banyak tool untuk log mikrotik, mikrotik sendiri menyediakanMT_Syslog running di windows, atau yang berbayar seperti kiwisyslog, untuk keluarga *nix anda bisa menggunakan syslog-ng,yang bisa dikombinasikan dengan mysql sehingga controlling log dapat dilakukan dengan rapi & mudah, tapi perlu diingat mysql “rakus” memory, untuk hardware all in one service & dengan memory pas²an not recomended lah, nah alternative lainnya adalah menggunakan syslogd, yang emank udah running di freebsd, let’s we start!NOTE : MikroTik Handle seluruh urusan routing, FreeBSD di posisikan sejajar MikroTik & diberlakukan static route!
# ip freebsd server : 192.168.2.1
# defaultrouter : 192.168.2.2
masuk freebsd console »
edit /etc/syslog.conf salin dan tambahkan »
!*
+192.168.2.2
local0.* /var/log/mikrotik.log
penting, agar log tidak melakukan double write ke /var/log/messages
tambahkan local0.none di baris /var/log/messages, seperti ini contohnya »
*.notice;local0.none;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
next, edit & tambahkan di /etc/rc.conf
syslogd_enable=”YES”
syslogd_flags=”-a 192.168.2.0/30:* -vv”
masuk ke dir /var/log
create »
# touch mikrotik.log
# chmod 600 mikrotik.log
and then restart syslogd anda
# /etc/rc.d/syslogd restart
enough! sekarang beralih ke winbox atau console mikrotik.
/system logging
add action=remote disabled=no prefix=”" topics=info
add action=remote disabled=no prefix=”" topics=error
add action=remote disabled=no prefix=”" topics=warning
add action=echo disabled=no prefix=”" topics=critical
add action=remote disabled=no prefix=”" topics=firewall
and last »
/system logging action
set remote bsd-syslog=yes name=remote remote=192.168.2.1:514 src-address=0.0.0.0 syslog-facility=local0 syslog-severity=auto target=remote
kalo udah semua, and step² nya bener, hasilnya gini »
[root@bsdbox ~]# tail -f /var/log/mikrotik.log
May 9 08:44:42 192.168.2.2 MikroTik user admin logged out from 192.168.0.100 via winbox
May 9 08:45:52 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via winbox
May 9 08:46:50 192.168.2.2 MikroTik simple queue changed by admin
May 9 08:49:06 192.168.2.2 MikroTik simple queue changed by admin
May 9 08:51:09 192.168.2.2 last message repeated 10 times
May 9 08:54:37 192.168.2.2 MikroTik user admin logged out from 192.168.0.100 via winbox
May 9 08:57:05 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via winbox
May 9 09:01:45 192.168.2.2 MikroTik nat rule changed by admin
May 9 10:18:10 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via ssh
May 9 10:53:56 192.168.2.2 MikroTik dhcp1 assigned 192.168.5.6 to 00:25:D0:09:C0:05
Tips : biar log gak “menggunung” , masuk ke /etc/newsyslog.conf & tambahkan »
/var/log/mikrotik.log 600 5 * @T00 JC
:: soal newsyslog next article.. (kalo gak males )
# ip freebsd server : 192.168.2.1
# defaultrouter : 192.168.2.2
masuk freebsd console »
edit /etc/syslog.conf salin dan tambahkan »
!*
+192.168.2.2
local0.* /var/log/mikrotik.log
penting, agar log tidak melakukan double write ke /var/log/messages
tambahkan local0.none di baris /var/log/messages, seperti ini contohnya »
*.notice;local0.none;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
next, edit & tambahkan di /etc/rc.conf
syslogd_enable=”YES”
syslogd_flags=”-a 192.168.2.0/30:* -vv”
masuk ke dir /var/log
create »
# touch mikrotik.log
# chmod 600 mikrotik.log
and then restart syslogd anda
# /etc/rc.d/syslogd restart
enough! sekarang beralih ke winbox atau console mikrotik.
/system logging
add action=remote disabled=no prefix=”" topics=info
add action=remote disabled=no prefix=”" topics=error
add action=remote disabled=no prefix=”" topics=warning
add action=echo disabled=no prefix=”" topics=critical
add action=remote disabled=no prefix=”" topics=firewall
and last »
/system logging action
set remote bsd-syslog=yes name=remote remote=192.168.2.1:514 src-address=0.0.0.0 syslog-facility=local0 syslog-severity=auto target=remote
kalo udah semua, and step² nya bener, hasilnya gini »
[root@bsdbox ~]# tail -f /var/log/mikrotik.log
May 9 08:44:42 192.168.2.2 MikroTik user admin logged out from 192.168.0.100 via winbox
May 9 08:45:52 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via winbox
May 9 08:46:50 192.168.2.2 MikroTik simple queue changed by admin
May 9 08:49:06 192.168.2.2 MikroTik simple queue changed by admin
May 9 08:51:09 192.168.2.2 last message repeated 10 times
May 9 08:54:37 192.168.2.2 MikroTik user admin logged out from 192.168.0.100 via winbox
May 9 08:57:05 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via winbox
May 9 09:01:45 192.168.2.2 MikroTik nat rule changed by admin
May 9 10:18:10 192.168.2.2 MikroTik user admin logged in from 192.168.0.100 via ssh
May 9 10:53:56 192.168.2.2 MikroTik dhcp1 assigned 192.168.5.6 to 00:25:D0:09:C0:05
Tips : biar log gak “menggunung” , masuk ke /etc/newsyslog.conf & tambahkan »
/var/log/mikrotik.log 600 5 * @T00 JC
:: soal newsyslog next article.. (kalo gak males )
COMMENTS