Home/Support/Support Forum/PPP Down Question
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

PPP Down Question

0 votes
Hi,

Is that any python that used to detect PPP down in WR11?

BR
asked Oct 16, 2018 in Python by ShamJS New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
Hi the easy way is to use saroscli library and talk to the WR11 at CLI with the "PPP 1 status" or "PPPstat 1"

this will tell you if the ppp is idle or if it has an IP address

def ppp_is_up(ppp_nb):
....ret = False
....mycmd = "ppp " + str(ppp_nb) + " status"
....res = writeCli(mycmd)
....if "IP Address:" in res:
........if not "IP Address: 0.0.0.0" in res:
............ret = True
....return ret

this was some code i used to check if PPP had a IP address and could pass it which instance of PPP to check if your doing dual sim fail over

The WriteCLI is used to talk to the CLI of the transport

import saroscli

def writeCli( str ):
....cli = sarcli.open()
....cli.write( str )
....res = cli.read()
....cli.close()
....return( res )

hope that helps

regards

James
answered Oct 26, 2018 by James.Wilson Veteran of the Digi Community (1,227 points)
...