Ascend Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (ASCEND) SNMP traps



On Fri, Feb 06, 1998 at 10:02:55AM -0500, Paul Monaghan wrote:
> 
> Does anyone use any tools to gather SNMP traps on connections for Ascend
> MAX?  I am looking for something that will log more detail than the
> syslogs. Something that logs connect speed, IP address.  The reason that I

If you want _that_, SNMP Traps are the wrong thing to head out for.
Ascend uses traps for some erratic or critical condidtions or at best
important information, but not for the general logging of information.
That is BTW the correct use of SNMP traps IMHO too ;)

> am looking for something that logs this info is simple.  When a customer
> calls support wanting to know why their modem is only connecting at 19200
> I want support to be able to check the logs after the customer has tried
> to connect and see the info.  This is why traps are more or less the only
> way to go.

But you won't get traps for this.

Besides RADIUS accounting and syslog the Max _is_ generating a load of
log information. It is doing this even by means of SNMP. The interesting
factoid, however, is that a lot of users simply don't know anything about
this. Exception is probably germans <g> who want to use the NET5 PRI
billing unit logging feature of the Max family. What I'm speaking of is
the Event MIB.

> Any software you can recommend would be great, be it publicly available
> or commercial.

I don't know of any software that uses the event MIB. Maybe Navis does,
but I've not dived into it (Navis is still way ahead the firmware versions
we have to use). As always, when a certain piece of software is missing,
one can hack one himself. The following is a simple hack (in Scotty as
always ;) to permanently snoop on the event MIB and log the events in
a one-per-line-easy-to-parse-with-awk-style. If you can make sense out
of the code, fine ;)

--------------------------- apply knife -----------------------------
#!/usr/local/bin/scotty2.1.7

set ivSecs 3
set ivmSecs [expr $ivSecs * 1000]

# This is exploded some ten times into one string, so we better precompute
set ev "1.3.6.1.4.1.529.10.4.1"

set logVals {eventIdNumber eventTimeStamp eventType eventCallReferenceNum eventDataRate eventSlotNumber eventSlotLineNumber eventSlotChannelNumber eventModemSlotNumber eventModemOnSlot eventCurrentService eventUserName eventUserIPAddress eventUserSubnetMask eventDisconnectReason eventConnectProgress eventCallCharge eventCalledPartyID eventCallingPartyID eventInOctets eventOutOctets eventMultiLinkID}

#set logVals {eventType}

set agent [lindex $argv 0]
 
if {$agent == ""} {
 set agent mymax
}
 
set comm [lindex $argv 1]
 
if {$comm == ""} {
 set comm "public"
}
 
set s [snmp session -address $agent -community $comm -timeout 3 -retries 10]
 
while {
 [catch {
  set queryEV [$s get "ascend.eventGroup.eventOldestEventIdNumber.0\
                       ascend.eventGroup.eventLatestEventIdNumber.0\
                       ascend.systemStatusGroup.sysAbsoluteStartupTime.0\
                       ascend.systemStatusGroup.sysSecsSinceStartup.0"]
 }]
} {
 set tStamp [getclock]
 puts "+DEAD $agent $tStamp"
 sleep 10
}

set startEV [lindex [lindex $queryEV 0] 2]
set lastEV [lindex [lindex $queryEV 1] 2]
set sysStart [lindex [lindex $queryEV 2] 2]
set sysUp [lindex [lindex $queryEV 3] 2]

# assume we are starting over if oldest available event is still 1
# comment out if you don't want this

if {$startEV == 1} {
 set lastEV 0
}

proc UpdateStats {s} {

 global lastEV
 global ivSecs
 global ivmSecs
 global logVals
 global ev
 global agent

 set tStamp [getclock]

 while {
  [catch {
   set currEV [lindex [lindex [
    $s get "ascend.eventGroup.eventLatestEventIdNumber.0"
   ] 0] 2]
  }]
 } {
  puts "+DEAD $agent $tStamp"
  sleep 10
 }

 if { $currEV < $lastEV } {
  puts "+WRAP $lastEV $currEV"

# another hack to restart with the first event, not the latest one when reconnect succeeds
# should check whether oldest event is 1 but this should suffice for the moment

  set lastEV $currEV
  if { $currEV < 100 } {
   set lastEV 0
  }
 }

 set i [expr $lastEV + 1]

 while { $i <= $currEV } {

  set queryEV ""
  set numVals 0

  foreach oid $logVals {
   set queryEV "$queryEV $ev.$oid.$i"
   incr numVals
  }

# We leave the loop whenever a get fails

  if {
   [catch {
    set entryEV [$s get $queryEV]
   }]
  } return

# If get succeeded, draw lastEV with us

  set lastEV $i

#  for {set j 0} {$j < $numVals} {incr j} {
#   set name [lindex $logVals $j]
#   set val [lindex [lindex $entryEV $j] 2]
#   puts "$name = $val"
#  }
  for {set j 0} {$j < $numVals} {incr j} {
   set val [lindex [lindex $entryEV $j] 2]
   puts -nonewline "$val "
  }
  puts ""
  incr i

 } 

# set lastEV $currEV

 flush stdout
}

job create -command {UpdateStats $s} -interval $ivmSecs

puts "+START $agent $sysStart $sysUp $startEV $lastEV"
---------------------- apply knife --------------------------------

Have Fun (or a bad day if you're new to Tcl, Scotty, Ascend MIBs etc),
Andre.
-- 

Kanther-Line: PGP SSH IDEA MD5 GOST RIPE-MD160 3DES RSA FEAL32 RC4

+-o-+--------------------------------------------------------+-o-+
| o |               \\\- Brain Inside -///                   | o |
| o |                   ^^^^^^^^^^^^^^                       | o |
| o | Andre' Beck (ABPSoft) beck@ibh-dd.de XLink PoP Dresden | o |
+-o-+--------------------------------------------------------+-o-+
++ Ascend Users Mailing List ++
To unsubscribe:	send unsubscribe to ascend-users-request@bungi.com
To get FAQ'd:	<http://www.nealis.net/ascend/faq>


References: