此博客中的热门博文
Squid2.5+自定义日记
Squid2.6由于不能自由定义不同源的虚拟主机,所以只好使用2.5,可惜2.5的日志不能自定义。 补丁下载的网址: http://devel.squid-cache.org/customlog/ 可以生成Apache combined日志补丁 下载回来放到源码目录,运行 patch -p0 然后重新编译: ./configure --prefix=/usr/local/squid --enable-delay-pools --enable-useragent-log --enable-referer-log --enable-default-err-language=Simplify_Chinese --enable-x-accelerator-vary --enable-kill-parent-hack --enable-err-languages="Simplif y_Chinese English" --with-pthreads --with-aio --enable-cache-digests --with-large-files 编译结束后, 在 squid.conf 中添加: logformat combined %>a - %un [%{%d/%b/%Y:%H:%M:%S +0800}tl] "%rm %ru HTTP/%rv" %Hs % h" "%{User-agent}>h" cache_access_log /var/squid/logs/access.log combined 一个支持 combined 日志模式的 Squid 即告完成。 注意, 这里用了 +0800 ,绕过了使用 tl 的 %z 或者 %Z 的问题,用 z% ,将显示为 25%z ,可能是 patch 有问题。 Squid custom log format Basic syntax: %...field where ... is an optional field width. On numeric fields the output will be 0 padded if the field width starts with a 0. If the field width s...
uptime-kuma部署和批量添加
无意中发现这个监控小工具,感觉界面有模仿uptimerobot.功能不错部署简单。 但在试用中发现有一个麻烦的地方就是这个不支持批量控制,如果你有几百个项目要监控的话,操作非常麻烦。 官方还没有一个解决方案,通过官网的一个讨论,我看到了: https://github.com/lucasheld/uptime-kuma-api/ 基本上可以解决这个问题了。 比如我使用这样的命令: result = api.add_monitor(type=MonitorType.HTTP, name="usa7-nas03", maxretries=10,expiryNotification=1,url="https://test.url/client/php.php") ; print(result)
评论