python version 2.7.3
here is the "code" so far:
import subprocess
p = subprocess.Popen(["pppoe-discovery", "-I", "eth0"], stdout=subprocess.PIPE)
output, err = p.communicate()
print output
This will give a string containing all the pppoe servers discovered
My problem is extracting all mac addresses and compare each one with a predefined list or string.
Even if I could find and print all of them , it is still unclear for me as a beginner to find a solution to compare each to see if it's in the list. After that I'll just cook up some if "condition" and send a email with the non-matching mac-address.
output:
Access-Concentrator: xxxx Service-Name: xxxx
Got a cookie: de 58 08 d0 66 c8 58 15 a0 66 9b b1 02 3f 7c 95 1f 42 00 00
AC-Ethernet-Address: 00:22:33:6b:4b:ee
this is just one of the servers , the list goes on.