当前位置:首页>python>10个Python运维监控必备脚本!建议收藏

10个Python运维监控必备脚本!建议收藏

  • 2026-06-28 06:44:27
10个Python运维监控必备脚本!建议收藏

常用的Python运维自动化脚本

1.自动备份脚本

说明:将指定的源文件夹打包压缩成一个带有时间戳的 ZIP 备份文件,并保存到目标目录中。

import shutilimport osimport datetimesource = '/data/k8s/'   #需要备份的文件路径backup = '/data/k8s-backup/'   #备份文件存放路径os.makedirs(backup, exist_ok=Truenow = datetime.datetime.now()name = 'backup_' + now.strftime('%Y-%m-%d_%H-%M-%S'shutil.make_archive(os.path.join(backup, name), 'zip', source)print(f"备份成功完成!")

2.监控系统性能脚本

说明:监控CPU,内存,磁盘使用率等系统性能指标并发送邮件报警

import psutilimport timeimport smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人last_alert_time = 0ALERT_INTERVAL = 300  # 5分钟内只发一次告警,防抖def send_mail(body):    try:        server = smtplib.SMTP_SSL("smtp.163.com"465)        server.login(MAIL_USER, MAIL_PASS)        msg = MIMEText(body, "plain""utf-8")        msg["Subject"= "【服务器告警】CPU/内存/磁盘过高"        msg["From"= MAIL_USER        msg["To"= MAIL_TO        server.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        server.quit()        print("告警邮件发送成功!")    except Exception as e:        print("邮件发送失败:", e)while True:    cpu  = psutil.cpu_percent(interval=1)    mem  = psutil.virtual_memory().percent    disk = psutil.disk_usage("/").percent    print(f"监控中 → CPU: {cpu}% | 内存: {mem}% | 磁盘: {disk}%")    if cpu > 80 or mem > 80 or disk > 80:    #告警阈值        now = time.time()        if now - last_alert_time > ALERT_INTERVAL:            content = f"""服务器性能告警!CPU:{cpu}%内存:{mem}%磁盘:{disk}%"""            send_mail(content)            last_alert_time = now    time.sleep(60)

3.日志关键词告警脚本

说明:持续监控服务日志,当日志中出现异常关键字时,自动发送邮件告警,并支持告警防抖,避免邮件轰炸。

import tailerimport timeimport smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人LOG_FILE  = "/usr/local/nginx/logs/error.log"   #日志目录(nginx举例)KEYWORDS  = ["error""emerg""failed""invalid"]   #告警关键字ALERT_INTERVAL = 300  # 防抖:5 分钟内只发 1 次last_alert_time = 0def send_mail(body):    try:        server = smtplib.SMTP_SSL("smtp.163.com"465)        server.login(MAIL_USER, MAIL_PASS)        msg = MIMEText(body, "plain""utf-8")        msg["Subject"= "【Nginx 错误日志告警】"        msg["From"= MAIL_USER        msg["To"= MAIL_TO        server.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        server.quit()        print("告警邮件发送成功")    except Exception as e:        print("邮件发送失败:", e)print("Nginx 日志监控已启动")print(f"监控文件: {LOG_FILE}")print(f"告警关键词: {KEYWORDS}\n")for line in tailer.follow(open(LOG_FILE, "r")):    line_lower = line.lower()    alert = False    for kw in KEYWORDS:        if kw in line_lower:            alert = True            break    if alert:        now = time.time()        if now - last_alert_time > ALERT_INTERVAL:            print("⚠️ 触发告警:", line.strip())            send_mail(f"【Nginx 日志告警】\n\n日志内容:\n{line}")            last_alert_time = now        else:            print("⏳ 告警冷却中(5分钟内仅发一次):", line.strip())

4.端口存活监控脚本

说明:监控 80/443/22/3306/6379 等端口是否能连通

import socket, time, smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"MAIL_PASS = "W8nE4gA2uM7pX1kV"MAIL_TO   = "111111111@qq.com"CHECK_PORT = [22804438090808033066379]   #根据需要配置端口INTERVAL = 30def send_alert(msg):    m = MIMEText(msg, "plain""utf-8")    m["Subject"= "【端口监控告警】"    m["From"= MAIL_USER    m["To"= MAIL_TO    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        s.sendmail(MAIL_USER, [MAIL_TO], m.as_string())        s.quit()    except:        passprint("端口监控已启动")last = {}while True:    now = time.strftime("%Y-%m-%d %H:%M:%S")    down = []    for p in CHECK_PORT:        try:            socket.create_connection(("127.0.0.1", p), timeout=2)        except:            down.append(p)    if down and (str(down) not in last or time.time() - last[str(down)] > 60):        send_alert(f"⚠️ 端口监听异常\n时间:{now}\n失联端口:{down}")        last[str(down)] = time.time()    time.sleep(INTERVAL)

5.进程存活监控脚本

说明:监控 nginx /mysql/redis 等进程是否存活

import psutil, time, smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人PROCESSES = ["nginx""mysql""redis""docker""etcd""kubelet""kube-proxy""kube-apiserver""kube-controller-manager""kube-scheduler"]    #自定义进程关键词INTERVAL = 30def send_alert(msg):    m = MIMEText(msg, "plain""utf-8")    m["Subject"= "【进程监控告警】"    m["From"= MAIL_USER    m["To"= MAIL_TO    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        s.sendmail(MAIL_USER, [MAIL_TO], m.as_string())    except:        passprint("进程监控已启动")last = {}while True:    now = time.strftime("%Y-%m-%d %H:%M:%S")    missing = []    for p in PROCESSES:        if not any(p in proc.info["name"for proc in psutil.process_iter(["name"])):            missing.append(p)    if missing:        key = str(missing)        if key not in last or time.time() - last[key] > 60:            send_alert(f"⚠️ 进程丢失\n时间:{now}\n异常:{missing}")            last[key] = time.time()    time.sleep(INTERVAL)

6.Docker 容器监控脚本

说明:持续监控服务器上所有 Docker 容器,只要发现容器异常,自动发送邮件告警

import docker, time, smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人ALERT_INTERVAL = 120client = docker.from_env()def send_mail(body):    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        msg = MIMEText(body, "plain""utf-8")        msg["Subject"= "【Docker告警】容器异常"        msg["From"= MAIL_USER        msg["To"= MAIL_TO        s.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        s.quit()        print("✅ 告警邮件发送成功")    except:        print("❌ 邮件发送失败")last_alert = 0print("Docker 容器监控已启动")while True:    alerts = [f"{c.name} ({c.status})"              for c in client.containers.list(all=True)              if c.status != "running"]    if alerts and time.time() - last_alert > ALERT_INTERVAL:        now_str = time.strftime("%Y-%m-%d %H:%M:%S")  # 时间戳        body = f"⚠️ Docker 容器异常告警 ⚠️\n"        body += "=" * 40 + "\n"        for i, info in enumerate(alerts, 1):            body += f"{i}{info}\n"        body += "=" * 40 + "\n"        body += f"告警时间:{now_str}"        print(f"⚠️ {now_str} 异常容器:", alerts)        send_mail(body)        last_alert = time.time()    time.sleep(30)

7. Inode 使用率监控脚本

说明:定时检查服务器所有分区的 Inode 使用率,一旦超过阈值,就自动发邮件告警,防止服务器因为 Inode 满了无法创建文件。

import os, time, smtplibfrom email.mime.text import MIMETextMAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人WARNING = 85INTERVAL = 60def send_alert(body):    msg = MIMEText(body, "plain""utf-8")    msg["Subject"= "【inode 使用率过高】服务器紧急告警"    msg["From"= MAIL_USER    msg["To"= MAIL_TO    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        s.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        s.quit()        print("✅ 告警邮件发送成功")    except:        print("❌ 邮件发送失败")last_alert = {}print("✅ inode 监控已启动")while True:    now = time.strftime("%Y-%m-%d %H:%M:%S")    for line in os.popen("df -i").read().splitlines()[1:]:        parts = line.split()        if len(parts) < 6continue        try:            inode_used = int(parts[-2].replace("%"""))        except:            continue        fs = parts[0]        mount = parts[-1]        key = mount        if inode_used >= WARNING:            if key in last_alert and time.time() - last_alert[key] < 300:                continue            body = f"""📛 服务器 Inode 使用率过高告警 📛============================================告警时间:{now}文件系统:{fs}挂载路径:{mount}Inode 使用率:{inode_used}%告警阈值:{WARNING}%============================================⚠️ 说明:Inode 耗尽会导致无法创建新文件!请及时清理小文件、日志或碎片文件。"""            send_alert(body)            last_alert[key] = time.time()    time.sleep(INTERVAL)

8.SSL 证书过期监控脚本

说明:自动批量监控多个域名的 SSL 证书有效期,提前发现即将过期的证书并汇总邮件告警,防止因证书过期导致网站 HTTPS 服务中断。

import ssl, socket, time, smtplibfrom datetime import datetimefrom email.mime.text import MIMETextDOMAINS = ["www.test1.com""www.test2.com""www.test3.com"]   #需要监控的域名WARNING_DAYS = 30  # 提前30天告警INTERVAL = 86400   # 每天检查一次MAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人last_alert = 0def send_alert(subject, body):    msg = MIMEText(body, "plain""utf-8")    msg["Subject"= subject    msg["From"= MAIL_USER    msg["To"= MAIL_TO    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        s.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        s.quit()        print("✅ 汇总告警邮件已发送")    except Exception as e:        print("❌ 邮件发送失败:", e)print("✅ SSL证书监控已启动")while True:    now = datetime.now()    expiring = []    errors = []    for domain in DOMAINS:        try:            context = ssl.create_default_context()            with socket.create_connection((domain, 443), timeout=10as sock:                with context.wrap_socket(sock, server_hostname=domain) as ssock:                    cert = ssock.getpeercert()            expire = datetime.strptime(cert["notAfter"], "%b %d %H:%M:%S %Y GMT")            days_left = (expire - now).days            # 只保留即将过期的域名            if days_left <= WARNING_DAYS:                expiring.append({                    "domain": domain,                    "days": days_left,                    "expire": expire.strftime("%Y-%m-%d %H:%M:%S")                })        except Exception as e:            errors.append({"domain": domain, "error"str(e)})    if expiring or errors:        if time.time() - last_alert > 300:            body = "📛 服务器SSL证书过期告警 📛\n"            body += "=" * 50 + "\n"            body += f"检测时间:{now.strftime('%Y-%m-%d %H:%M:%S')}\n"            body += "=" * 50 + "\n"            if expiring:                body += "【即将过期的域名】\n"                for item in expiring:                    body += f" 域名:{item['domain']:<30}\n"                    body += f" 剩余天数:{item['days']} 天\n"                    body += f" 过期时间:{item['expire']}\n"                    body += "-" * 50 + "\n"            if errors:                body += "【检查失败的域名】\n"                for item in errors:                    body += f" 域名:{item['domain']:<30}\n"                    body += f" 错误信息:{item['error']}\n"                    body += "-" * 50 + "\n"            send_alert("【服务器SSL证书过期告警】", body)            last_alert = time.time()    time.sleep(INTERVAL)

9.服务器批量巡检脚本

说明:批量检查所有机器的运行状态,省去手动一台台登录,生成一份完整巡检报告并自动发送邮件到你的邮箱

import paramikoimport timeimport smtplibfrom email.mime.text import MIMEText# 服务器列表SERVERS = [    {"host""172.16.0.2""user""test""pass""test123"},    {"host""172.16.0.3""user""test""pass""test123"},    {"host""172.16.0.4""user""test""pass""test123"},    {"host""172.16.0.5""user""test""pass""test123"}]# 巡检命令(和你截图里的 emoji 保持一致)CHECK_CMD = r'''echo "🖥️ 主机名: $(hostname)"echo "🌐 IP地址: $(hostname -I | awk '{print (date '+%Y-%m-%d %H:%M:%S')"echo "⚙️ CPU负载: 2}')"echo "🧠 内存使用率: 3, $2, $3/(df -h / | awk '/\// {print $3 "/" $2 " (" (df -i / | awk '/\// {print (uptime -p)"'''# 邮箱配置MAIL_USER = "systemalert@163.com"    #发邮件的163邮箱地址MAIL_PASS = "W8nE4gA2uM7pX1kV"			 #发邮件的163邮箱授权码MAIL_TO   = "111111111@qq.com"  #告警邮箱收件人def send_alert(body):    msg = MIMEText(body, "plain""utf-8")    msg["Subject"= "【服务器批量巡检报告】"    msg["From"= MAIL_USER    msg["To"= MAIL_TO    try:        s = smtplib.SMTP_SSL("smtp.163.com"465)        s.login(MAIL_USER, MAIL_PASS)        s.sendmail(MAIL_USER, [MAIL_TO], msg.as_string())        s.quit()    except Exception as e:        print("❌ 邮件发送失败:", e)print("✅ 开始批量巡检...")report = []for srv in SERVERS:    try:        ssh = paramiko.SSHClient()        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())        ssh.connect(            hostname=srv["host"],            username=srv["user"],            password=srv["pass"],            timeout=10        )        stdin, stdout, stderr = ssh.exec_command(CHECK_CMD)        output = stdout.read().decode().strip()        ssh.close()        block = f"\n【{srv['host']}】\n{output}\n"        report.append(block)    except Exception as e:        block = f"\n【{srv['host']}】\n❌ 连接失败: {str(e)}\n"        report.append(block)# 整体邮件内容final_body = f"""📛 服务器批量巡检报告 📛🕒 巡检时间: {time.strftime('%Y-%m-%d %H:%M:%S')}{'-' * 40}{"".join(report)}"""send_alert(final_body)print("✅ 巡检完成,报告已发送")

10.自动清理备份文件脚本

说明:自动清理指定目录下 N 天前的日志、备份文件,防止磁盘被占满,例如Gitlab数据备份目录

import osimport timeBAK_DIR = "/data/gitlab-bak"   #存放备份文件目录KEEP_DAYS = 7   #保留7天# 清理 7 天前的 GitLab 备份if os.path.exists(BAK_DIR):    cmd = f"find {BAK_DIR} -name '*gitlab_backup.tar' -type f -mtime +{KEEP_DAYS} -delete"    os.system(cmd)print("✅ 清理完成:保留最近 7 天的 GitLab 备份")

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-02 23:27:51 HTTP/2.0 GET : https://f.mffb.com.cn/a/500475.html
  2. 运行时间 : 2.112410s [ 吞吐率:0.47req/s ] 内存消耗:4,724.85kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=88db34553c6102714215438c20e0fbc2
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001038s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001468s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.101283s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.101421s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001634s ]
  6. SELECT * FROM `set` [ RunTime:0.101254s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001873s ]
  8. SELECT * FROM `article` WHERE `id` = 500475 LIMIT 1 [ RunTime:0.101433s ]
  9. UPDATE `article` SET `lasttime` = 1783006071 WHERE `id` = 500475 [ RunTime:0.221162s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.008449s ]
  11. SELECT * FROM `article` WHERE `id` < 500475 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.016073s ]
  12. SELECT * FROM `article` WHERE `id` > 500475 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004081s ]
  13. SELECT * FROM `article` WHERE `id` < 500475 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.077655s ]
  14. SELECT * FROM `article` WHERE `id` < 500475 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.937869s ]
  15. SELECT * FROM `article` WHERE `id` < 500475 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.349967s ]
2.116279s