{
    "name"  : "L2TPoverIPSec分支配置检查",
    "problems" : {
        "NoTunnelProtection" : {
            "desc"      : "【问题】接口下未配置tunnel protection ipsec profile",
            "advice"    : "【建议】在virtual-pp接口下需要有profile"
        },
		"NoTransformSet" : {
            "desc"      : "【问题】没有配置转换集",
            "advice"    : "【建议】需要配置转换集"
        },
		"NoSetKey" : {
            "desc"      : "【问题】需要配置对端的共享密钥",
            "advice"    : "【建议】配置对端的共享密钥"
        }
    }
}
---------------------------code-------------------------------
l2tpOverIpsecBranch = precondition('l2tpOverIpsecBranch')
port = precondition('keyChangeBand')
print 'l2tpOverIpsecBranch='+l2tpOverIpsecBranch

if l2tpOverIpsecBranch == "":
    return 'skip'
end
print 'port='+port
cmd = 'show run int ' + port
result=cli(cmd)
print 'port='+port

if result.indexOf("tunnel protection ipsec profile")==-1:
    add_problem('NoTunnelProtection')
    return 'warn'
end

res3 = cli("show run")
print 'res3='+res3
if res3.indexOf("crypto ipsec transform-set")==-1 :
   add_problem('NoTransformSet')
return 'warn'
end

res4 = cli("show run | inc crypto isakmp key")
print 'res4='+res4
   if res4.indexOf("crypto isakmp key")==-1 :
	  add_problem('NoSetKey')
	  return 'warn'
   end
return 'success'
