lyhabc

第 171 位会员

会员
个人信息
  • 加入于 2016-05-23 15:31:19
  • 最后登录时间 1年前
个人成就
  • 发表文章次数 4
  • 发布评论次数 3
  • 个人主页浏览次数 1
Lepus 3.8 Bug 收集专贴1年前

1、界面显示的SQL Server版本号不够详细 get_version(conn):

try:
    curs=conn.cursor()
    data=curs.execute("SELECT @@VERSION");
    data=curs.fetchone()
    result  = data[0].split(' ')[3]
except Exception,e:
    print e

建议显示更详细信息 2008 R2 (SP3) - 10.50.6000.34 (X64)

2、获取已运行时间不准确 get_uptime(conn)

3、函数名ger -》get ger_processes_running(conn): 4、所有有关进程的SQL语句更改 def ger_processes(conn):

try:
    curs=conn.cursor()
    curs.execute("SELECT COUNT(*) FROM [Master].[dbo].[SYSPROCESSES] WHERE [DBID] IN ( SELECT  [dbid] FROM [Master].[dbo].[SYSDATABASES])");
    result = curs.fetchone()[0]
    return result

except Exception,e:
    return null    
    print e

finally:
    curs.close()

def ger_processes_running(conn):

try:
    curs=conn.cursor()
    curs.execute("SELECT COUNT(*) FROM [Master].[dbo].[SYSPROCESSES] WHERE [DBID] IN ( SELECT  [dbid] FROM [Master].[dbo].[SYSDATABASES])  AND  status !='SLEEPING' AND status !='BACKGROUND'");
    result = curs.fetchone()[0]
    return result

except Exception,e:
    return null
    print e

finally:
    curs.close()

def ger_processes_waits(conn):

try:
    curs=conn.cursor()
    curs.execute("SELECT COUNT(*) FROM [Master].[dbo].[SYSPROCESSES] WHERE [DBID] IN ( SELECT  [dbid] FROM [Master].[dbo].[SYSDATABASES])  AND  status ='SUSPENDED' AND waittime >2 ");
    result = curs.fetchone()[0]
    return result

except Exception,e:
    return null
    print e

finally:
    curs.close()

改为 def ger_processes(conn): SELECT COUNT(*) FROM sys.sysprocesses WHERE spid >49

def ger_processes_running(conn): SELECT COUNT(*) FROM sys.sysprocesses WHERE spid>49

    AND status != 'SLEEPING'
    AND status != 'BACKGROUND'
	
	

def ger_processes_waits(conn): SELECT COUNT(*) FROM sys.sysprocesses WHERE spid>49 AND status ='SUSPENDED' AND waittime >2

Lepus 3.8 Bug 收集专贴1年前

lepus脚本启动问题

start lepus

if [ $lepus_process -ge "2" ];then echo " lepus server is already run!" else cd $basedir && nohup python lepus.py &> logs/lepus.log& sleep 30 lepus_process=ps -ef|grep lepus.py |grep -v grep|wc -l echo $lepus_process if [ $lepus_process -ge "2" ];then

  echo "lepus server start success!"

else

  echo "lepus server start fail!"

fi fi ;;

在start分支结构里,写的是 sleep 5,会容易导致当启动的时候显示"lepus server start fail!",但是实际上lepus已经启动了 的情况,建议改为 sleep 30

Lepus 3.8 Bug 收集专贴1年前

关闭了lepus采集器,前端界面还是显示正在运行 lepus stop lepus processes id 1497 been stop lepus processes id 1499 been stop lepus processes id 1505 been stop [root@vm2_centos lepus]# /usr/local/sbin/lepus: line 16: 1497 Terminated nohup python lepus.py &>logs/lepus.log