python/samples/ops.py
def status(ServiceName):
    '''
        Desc: Check GameServer Status
 
        CLI Example:
                opsmod.py ServiceName status
    '''    
    cmd = 'ps -ef|grep "{0}"|grep -v grep'.format(ServiceName)
    proc = Popen(cmd, stdout=subprocess.PIPE, shell=True)
    item = proc.stdout.read().split('\n')[:-2]
    its = '\n'.join(item)
    cot = len(item)
    ret = its + '\n' + '*'*80 + '\n' + 'The total of process is {0} !'.format(cot)
    logging.info('{0} status'.format(ServiceName))  
    return G(ret)

        Desc: Check GameServer Status
 
        CLI Example:
                opsmod.py ServiceName status
    
Check GameServer Status
CLI Example:
opsmod.py ServiceName status
Check GameServer Status CLI Example : opsmod . py ServiceName status
def status(ServiceName):
    cmd = 'ps -ef|grep "{0}"|grep -v grep'.format(ServiceName)
    proc = Popen(cmd, stdout=subprocess.PIPE, shell=True)
    item = proc.stdout.read().split('\n')[:-2]
    its = '\n'.join(item)
    cot = len(item)
    ret = its + '\n' + '*'*80 + '\n' + 'The total of process is {0} !'.format(cot)
    logging.info('{0} status'.format(ServiceName))  
    return G(ret)
def status ( ServiceName ) : cmd = 'ps -ef|grep "{0}"|grep -v grep' . format ( ServiceName ) proc = Popen ( cmd , stdout = subprocess . PIPE , shell = True ) item = proc . stdout . read ( ) . split ( '\n' ) [ : - 2 ] its = '\n' . join ( item ) cot = len ( item ) ret = its + '\n' + '*' * 80 + '\n' + 'The total of process is {0} !' . format ( cot ) logging . info ( '{0} status' . format ( ServiceName ) ) return G ( ret )
Desc: Check GameServer Status
CLI Example:
opsmod.py ServiceName status
Desc : Check GameServer Status CLI Example : opsmod . py ServiceName status
'''
        Desc: Check GameServer Status
 
        CLI Example:
                opsmod.py ServiceName status
    '''
ServiceName