python 吊java通过短信猫报警

#!/usr/bin/python  

#coding:utf-8  

from jpype import *

from sms import Sms,Sms2

import os.path,sys

from django.core.management import setup_environ

ROOT_PATH = os.path.split(os.path.abspath(os.path.dirname(__file__)))

sys.path.insert(0,ROOT_PATH[0])

import settings

set = os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

ROOT_PATH = os.path.abspath(os.path.dirname(__file__))

jarpath=ROOT_PATH + '/testweb/testscript.jar'

jvmpath = getDefaultJVMPath()

def Testweb():

       startJVM(jvmpath, "-ea", "-Djava.class.path=%s" % jarpath)

       test = JPackage('http.testscript').SendHttpRequest

       tw = test()

       auth=tw.checkAnalyticsLogin('****@***','123456')

       if auth != "1":

               Sms("ops group",u"http://**************** 网页登陆故障,请检查" )

       shutdownJVM()

if __name__ == '__main__':

       Testweb()


本文出自 “linux&python” 博客,转载请与作者联系!

你可能感兴趣的:(java,jvm,python,短信猫报警)