On Wed, 9 Jun 2004 15:51:27 +0700 (WIT), Cahyo <[EMAIL PROTECTED]> wrote: > > Iya nih mas Kamas gak kepikiran klo grep dari iptables aja > dengan buat rule yg hanya untuk membaca traffic aja trus digrep pake > awk,pd hal tempo hari saya abis pake cara itu > contoh salah satu script untuk rule saya tempo hari > > #!/bin/bash > IPTABLES="/sbin/iptables" > UPTIME="/usr/bin/uptime" > $IPTABLES -nvxL | grep INPUT | awk '{ print $5 }' > $UPTIME | awk '{ print $3, $4, $5 }' > > tapi mas kalo mrtg server gak dirouter itu tapi di jalan snmp gimana saya > bisa "inject" script itu di snmp trus biar bisa dibaca sama server mrtg > diatasnya > > -+Cahyo+-
mengutip snmpd.conf bagian bawah: # Note: this has been specifically commented out to prevent # accidental security holes due to someone else on your system writing # a /tmp/shtest before you do. Uncomment to use it. # # exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50 # enterprises.ucdavis.50.1.1 = 1 # enterprises.ucdavis.50.2.1 = "shelltest" # enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest" # enterprises.ucdavis.50.100.1 = 35 # enterprises.ucdavis.50.101.1 = "hello world." # enterprises.ucdavis.50.101.2 = "hi there." # enterprises.ucdavis.50.102.1 = 0 # Now the Output has grown to two lines, and we can see the 'hi # there.' output as the second line from our shell script. # # Note that you must alter the mib.txt file to be correct if you want # the .50.* outputs above to change to reasonable text descriptions. # Other ideas: # # exec .1.3.6.1.4.1.2021.51 ps /bin/ps # exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top # exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq -- andika -- Unsubscribe: kirim email kosong ke [EMAIL PROTECTED] Arsip dan info di http://linux.or.id/milis.php FAQ milis http://linux.or.id/faq.php