1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WAG54G-EU V2 and SNMP

Discussion in 'Other Linksys Equipment' started by Arabian, Jul 2, 2005.

  1. Arabian

    Arabian Network Guru Member

    Hello folks,

    I faild to setup the SNMP with WAG54G V2 with the latest firmaware v1.01.01.

    Do you have HOWTO for that?

    I try to point to connect to http://192.168.1.100 to see the SNMP, but my IE6 doesn't display anything :roll:.

    Any hints?

    Thank you,

    -Arabian
     
  2. Ofloo

    Ofloo Network Guru Member

    what is it you want to get from snmp ? for instance here is an example of how u get traffic on ppp0


    Code:
    snmpget -v 1 -c public -Oqv 192.168.1.1 IF-MIB::ifOutOctets.13
    snmpget -v 1 -c public -Oqv 192.168.1.1 IF-MIB::ifInOctets.13
    this will show how many bytes pass , if you look at this in a time line then you can determine how fast everything goes what the traffic is

    Code:
    snmpwalk -v 1 -c public router.ofloo.net IF-MIB::ifDescr
    IF-MIB::ifDescr.1 = STRING: lo
    IF-MIB::ifDescr.2 = STRING: eth0
    IF-MIB::ifDescr.3 = STRING: tunl0
    IF-MIB::ifDescr.4 = STRING: gre0
    IF-MIB::ifDescr.5 = STRING: ipsec0
    IF-MIB::ifDescr.6 = STRING: ipsec1
    IF-MIB::ifDescr.7 = STRING: ipsec2
    IF-MIB::ifDescr.8 = STRING: ipsec3
    IF-MIB::ifDescr.9 = STRING: ipsec4
    IF-MIB::ifDescr.10 = STRING: br0
    IF-MIB::ifDescr.11 = STRING: wlan0
    IF-MIB::ifDescr.12 = STRING: nas0
    IF-MIB::ifDescr.13 = STRING: ppp0
    
    here is an applying code example for bandwidth on all interfaces it is in tcl so it should work on all operatingsystems if you have the nessesairy executables ..

    Code:
    #!/usr/local/bin/tclsh8.4
    ################################################################################
    #  
    #  TCL scripts by Ofloo all rights reserved.
    # 
    #  HomePage: http://ofloo.net/
    #  CVS: http://cvs.ofloo.net/
    #  Email: support[at]ofloo.net
    #  
    #  This program is free software; you can redistribute it and/or
    #  modify it under the terms of the GNU General Public License
    #  as published by the Free Software Foundation; either version 2
    #  of the License, or (at your option) any later version.
    #   
    #  This program is distributed in the hope that it will be useful,
    #  but WITHOUT ANY WARRANTY; without even the implied warranty of
    #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    #  GNU General Public License for more details.
    #   
    #  You should have received a copy of the GNU General Public License
    #  along with this program; if not, write to the Free Software
    #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    #   
    ################################################################################
    
    set snmpwalk "/usr/local/bin/snmpwalk" ;# set this to your liking ex: c:\\snmpwalk.exe
    set snmpget "/usr/local/bin/snmpget" ;# set this to your liking ex: c:\\snmpget.exe
    set routerip "192.168.1.1" ;# probably won't have to change this
    set community "public" ;# check your settings in the router you can change this
    
    if {![catch {exec $snmpwalk -v 1 -c $community $routerip IF-MIB::ifDescr} interfaces]} {
      foreach {x} [split $interfaces \n] {
        if {[regexp -nocase {IF\-MIB::ifDescr\.([0-9]{1,100})[\x20]{1,100}=[\x20]{1,100}STRING:[\x20]{0,100}([a-z0-9]{1,100})} $x -> i n]} {
          set _INTER($i) $n
          if {![catch {exec $snmpget -v 1 -c $community -Oqv $routerip IF-MIB::ifInOctets.$i} inc_s] && ![catch {exec $snmpget -v 1 -c $community -Oqv $routerip IF-MIB::ifOutOctets.$i} out_s]} {
            after 500
            if {![catch {exec $snmpget -v 1 -c $community -Oqv $routerip IF-MIB::ifInOctets.$i} inc_e] && ![catch {exec $snmpget -v 1 -c $community -Oqv $routerip IF-MIB::ifOutOctets.$i} out_e]} {
              puts stdout "\[$_INTER($i)\]: incoming [format %.2f [expr ($inc_e - $inc_s) / 512.0]] kb/s outgoing [format %.2f [expr ($out_e - $out_s) / 512.0]] kb/s"
            } else {
          	  puts stderr "error couldn't retreive data"
            } 
          } else {
        	  puts stderr "error couldn't retreive data"
          }
        }
      }
    
    } else {
      puts stderr "couldn't retreive info"
    }
    result looks like this


    enjoy i hope you are able to read it with that crappy window rewrap
     

Share This Page