Ok, I'm back again, the method I used in my previous post didn't work because the gateway of my router changes upon reconnecting.

now I'll be trying solution 2, which states:
if your modem is SNMP enabled, then you can do a test on the  ppp
interface to see if its up or down

from the snmpwalk
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.3 = STRING: ixp0
IF-MIB::ifDescr.4 = STRING: ixp1
IF-MIB::ifDescr.5 = STRING: eth0
IF-MIB::ifDescr.6 = STRING: br0
IF-MIB::ifDescr.7 = STRING: ppp0
IF-MIB::ifDescr.8 = STRING: ipsec0
IF-MIB::ifMtu.1 = INTEGER: 16436
IF-MIB::ifMtu.3 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1492
IF-MIB::ifMtu.5 = INTEGER: 1500
IF-MIB::ifMtu.6 = INTEGER: 1500
IF-MIB::ifMtu.7 = INTEGER: 1420
IF-MIB::ifMtu.8 = INTEGER: 16260

now from the PPPoE RFC (http://www.faqs.org/rfcs/rfc2516.html)
....
the PPP MTU MUST NOT be greater than 1492. .....

and looking at the above output I only have interface 4 with an MTU of 1492.

also from the snmpwalk I get:
IF-MIB::ifPhysAddress.4 = STRING: 0:c:41:8f:96:6d

which is the *same* physical address given by the admin interface of the router
MAC            Address :                      00:0C:41:8F:96:6D

does that mean that the interface ixp1 (index number 4) is the interface I should be watching? if its not, I'm leaving the computers world and going to open a grocery store.


On 5/11/05, Zaid Amireh <[EMAIL PROTECTED]> wrote:
doing a traceroute from one of my machines revealed this

localhost:/var# traceroute www.go.com.jo
traceroute to www.go.com.jo ( 196.27.0.7), 30 hops max, 38 byte packets
 1  linksys (192.168.1.1)  0.567 ms  0.293 ms  0.231 ms
 2  192.168.0.76 ( 192.168.0.76)  54.077 ms  609.326 ms  62.732 ms
 3  217.23.37.84 ( 217.23.37.84)  55.476 ms  56.343 ms  55.329 ms

so 192.168.0.76 is my router's gateway and this is confirmed by the router, now I can formulate a logical check using the ping values returned from this host to check for connectivity.

thanks Ali

*hugs and kisses*



On 5/11/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Zaid,
the Interface Admin status has nothing todo with what you're trying to
accomplish
AdminStatus means if the interface is up/down administrativly (you make it)
as for the problem itself, there are a number of ways to accomlish what
you want:
1a- have a ping (or whatever means you deem necessary) to ping your ISP
ADSL gateway (just to make sure there is traffic going on; a sort of a
keep alive)
1b- use snmpget (not walk) to get a value for the In/Out bytes on an
interface
2- wait for a while,then poll again for the same value
3- if the difference is z--- then, you have a down interface where you
have to fireup an action accordingly
4- use locking to coordinate flow

solution2:
if your modem is SNMP enabled, then you can do a test on the  ppp
interface to see if its up or down

solution 3:
ping the F---- then from the a machine that has clear site (path) to the
ISP gateway, and decide on the loss

solution 4:
use nagios alert facility in a way that generates an alert once your PINGs
have 0% for a while

have fun,

> <rant>
> Notice, this email contains HTML formatting, if you are offended by such
> technology (or you use mutt), dont read this email :p
> </rant>
>
> Please excuse a noob in SNMP but I need to resolve this issue quickly, so
> here it goes.
> I have a Linksys router operating in "Gateway" mode and I need to find out
> when the ADSL connection dies using SNMP so that Nagios won't send a
> million
> SMS message to my mobile late at night >:(
> here is the snmpwalk on the router
>
> # snmpwalk -v 2c -c public 192.168.1.1 < http://192.168.1.1>
> .1.3.6.1.2.1.2.2
>>
>>  IF-MIB::ifIndex.1 = INTEGER: 1
>>  IF-MIB::ifIndex.3 = INTEGER: 3
>>  IF-MIB::ifIndex.4 = INTEGER: 4
>>  IF-MIB::ifIndex.5 = INTEGER: 5
>>  IF-MIB::ifIndex.6 = INTEGER: 6
>>  IF-MIB::ifIndex.7 = INTEGER: 7
>>  IF-MIB::ifIndex.8 = INTEGER: 8
>>  IF-MIB::ifDescr.1 = STRING: lo
>>  IF-MIB::ifDescr.3 = STRING: ixp0
>>  IF-MIB::ifDescr.4 = STRING: ixp1
>>  IF-MIB::ifDescr.5 = STRING: eth0
>>  IF-MIB::ifDescr.6 = STRING: br0
>>  IF-MIB::ifDescr.7 = STRING: ppp0
>>  IF-MIB::ifDescr.8 = STRING: ipsec0
>>  IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
>>  IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
>>  IF-MIB::ifType.4 = INTEGER: ethernetCsmacd(6)
>>  IF-MIB::ifType.5 = INTEGER: ethernetCsmacd(6)
>>  IF-MIB::ifType.6 = INTEGER: ethernetCsmacd(6)
>>  IF-MIB::ifType.7 = INTEGER: ppp(23)
>>  IF-MIB::ifType.8 = INTEGER: ppp(23)
>>
>
>
> and here is the ifAdminStatus and ifOperStatus dump
>
> IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.3 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.5 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.6 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.7 = INTEGER: up(1)
>>  IF-MIB::ifAdminStatus.8 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.1 = INTEGER: up(1)
>>  IF-MIB:: ifOperStatus.3 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.4 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.5 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.6 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.7 = INTEGER: up(1)
>>  IF-MIB::ifOperStatus.8 = INTEGER: up(1)
>>
>
>
> now that sounds pretty easy and logical, the ifOperStatus should tell you
> if
> an interface is up or down, and thats confirmed by Cisco's OID tree (
> http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.2.1.2.2.1
> )
>
>
> but the problem is that if the connection dies, all the ifOperStatus
> values
> stay (1) which means up!
>
> here is the script that I use to check for the connection status
>
> #!/bin/bash
>>
>>  RESULT=`snmpwalk -v 2c -c public 192.168.1.1
>> < http://192.168.1.1>.1.3.6.1.2.1.2.2.1.8 | awk -F\( '{ print $2 }' |
>> awk -F\) '{ print $1 }' |
>> grep -v 1`
>>
>>  if [ -z "$RESULT" ]; then
>>  echo -e "OK, Connection ON"
>>  exit 0
>>  else
>>  echo -e "CRITICAL, Connection OFF"
>>  echo -e "connection died" > /tmp/connection_died
>>  exit 1
>>  fi
>>
>
>
>  this script checks the ifOperStatus on ALL the interfaces, a desperate
> measure on my part.
>
> help?!
>
> --
> ---------------------------
> Netiquette -> http://www.dtcc.edu/cs/rfc1855.html
> http://tumbak.at.preempted.net
> ---------------------------
> _______________________________________________
> General mailing list
> [email protected]
> http://mail.jolug.org/mailman/listinfo/general_jolug.org
>




--
---------------------------



--
---------------------------
Netiquette -> http://www.dtcc.edu/cs/rfc1855.html
http://tumbak.at.preempted.net
---------------------------
_______________________________________________
General mailing list
[email protected]
http://mail.jolug.org/mailman/listinfo/general_jolug.org

Reply via email to