curl 监控web
2024-09-05 04:56:42
[root@rhel6 ~]# curl -I -s -w "%{http_code}\n" -o /dev/null http://127.0.0.1
[root@rhel6 ~]# curl -I http://127.0.0.1 2>/dev/null | head -1 | egrep "200|300|301"
HTTP/1.1 OK
#!/bin/bash if [ $# -ne ];then
echo $"Usage $0 url"
exit
fi while true;do
res=`curl -o /dev/null --connect-timeout -s -w "%{http_code}" $|grep -E -w "200|301|302"|wc -l`
if [ $res -ne ];then
echo "$1 is down."
else
echo "$1 is ok."
fi
sleep
done
Options:
-I/--head Show document info only
-s/--silent Silent mode. Don't output anything
-w/--write-out <format> What to output after completion
-o/--output <file> Write output to <file> instead of stdout
-k/--insecure turn off curl's verification of the certificate
--retry <num> Retry request <num> times if transient problems occur
--connect-timeout <seconds> Maximum time allowed for connection
最新文章
- win7下装ubuntu14.04双系统
- doxygen的使用(一)配置并生成文档
- emmet插件快捷键:
- lumen 错误&;日志
- SqlServer中使用Select语句给变量赋值的时候需要注意的一个问题
- Android布局_网格布局GirdLayout
- Android实现button一边圆角一边直角
- tty/pts 相关指令
- Arcengine 开发,FeatureClass新增feature时“The Geometry has no z-value”或";The Geometry has null z-value";的解决方案
- SQLite数据转换成sql server数据
- 开源的.Net ORM微型框架SuperHelper
- Python-老男孩-02_装饰器_面向对象_封装_继承_异常_接口_数据库
- c# 操作数据库
- Windows ML,系统内置的机器学习平台初探
- Django 系列博客(八)
- Do-Now—团队Scrum 冲刺博客五
- Spring Cloud学习笔记--Spring Boot初次搭建
- WPF的Style的TargetType不同写法的异同
- 005.KVM日常管理2-virt管理
- chorme 浏览器记住密码后input黄色背景处理