前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >windows如何收集日志

windows如何收集日志

原创
作者头像
Windows技术交流
修改2022-03-02 14:39:40
4.5K1
修改2022-03-02 14:39:40
举报
文章被收录于专栏:Windows技术交流Windows技术交流

腾讯云有个内网收集日志的脚本

Windows Server 2008R2:安全性太差,用的人少,我放到本文结尾了

Windows Server 2012+:

在PowerShell中输入这2句

第一句 Powershell Invoke-WebRequest -uri http://mirrors.tencentyun.com/install/platform_ops/qcloud/QCloud_Windows_Status_Check_Script.ps1 -OutFile QCloud_Windows_Status_Check_Script.ps1;

第二句 ./QCloud_Windows_Status_Check_Script.ps1

如上图,dns不是平台默认dns影响内网域名解析,脚本收集不了日志的话

cmd命令行以管理员身份运行如下命令后,内网域名解析就正常了(事物是发展变化的……内网ip和域名的对应关系以实际情况为准

具体metadata.tencentyun.com对应哪个IP,访问如下2个URL,哪个能访问通,就在hosts里面指定哪个IP

http://169.254.0.23/latest/meta-data/uuid

http://169.254.10.10/latest/meta-data/uuid

169.254.0.23、169.254.10.10这2个IP,vpc机器都能访问,但是基础网络机器只能访问169.254.10.10。

echo 169.254.0.3 mirrors.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.15 update2.agent.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.4 receiver.barad.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.5 custom.message.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.23 metadata.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.19 kms.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.54 kms1.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.26 windowsupdate.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.2 ntpupdate.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.79 time1.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.80 time2.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.81 time3.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.82 time4.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.83 time5.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

s.yd.qcloud.com、l.yd.qcloud.com、u.yd.qcloud.com ,云镜的3个内网域名对应的IP经常变,摸不清规律,以实测的为准,建议在同子网里购买个按量机器并把dns改回vpc默认183打头的那2个DNS(183.60.83.19、183.60.82.98)然后ping云镜相关的域名得到IP,获得ip后把刚买的按量机器销毁即可

如果还不行,看下面

C:\Windows\System32\winevt\Logs

C:\Program Files\QCloud\Logs

C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log

这3个目录复制到一个新建的文件夹,然后对那个新建文件夹压缩提供压缩包即可

这个对2008-2022、Vista-Win11是通用的

Windows Server 2008R2通过如下方式收集日志

在PowerShell中输入:

第一句 $client = new-object System.Net.WebClient

第二句 $client.DownloadFile('http://mirrors.tencentyun.com/install/platform_ops/qcloud/QCloud_Windows_Status_Check_Script.ps1','QCloud_Windows_Status_Check_Script.ps1')

第三句 ./QCloud_Windows_Status_Check_Script.ps1

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云服务器
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com