def getServiceStatus(server, port, adminUser,  adminPass, folder, serviceNameAndType, useSSL=True, token=None):    
    
    
    if token is None:    
        token = gentoken(server, port, adminUser, adminPass, useSSL)    
    
    if folder is not None:
        folderServerNameType = folder + "/" + serviceNameAndType
    else:
        folderServerNameType = serviceNameAndType
        
    serviceInfo = {}       
    URL = "{}{}{}/arcgis/admin/services/{}/status?token={}&f=json".format(getProtocol(useSSL), server, getPort(port), folderServerNameType, token)    

    serviceInfo = json.loads(urllib2.urlopen(URL).read())
    
    return serviceInfo
Function to get service status
dataset/ETHPy150Open Esri/ops-server-config/SupportFiles/AGSRestFunctions.py/getServiceStatus