下载微软的Microsoft Spy++ 这个软件,直接百度搜。
具体操作步骤参考:https://blog.csdn.net/jszj/article/details/78390008
测试了一下,这个软件可以找到整个桌面操作窗口的弹窗广告,对于通知栏的闪动广告还无法查到。
2018-12-29
发表者 Venus
查找垃圾弹窗广告是哪个进程启动的已关闭评论
下载微软的Microsoft Spy++ 这个软件,直接百度搜。
具体操作步骤参考:https://blog.csdn.net/jszj/article/details/78390008
测试了一下,这个软件可以找到整个桌面操作窗口的弹窗广告,对于通知栏的闪动广告还无法查到。
2018-12-21
发表者 Venus
shell通过正则获取ssh登录失败ip已关闭评论
[root@sych ~]# cat /var/log/secure | grep Failed | grep -o “[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}”
2018-12-14
发表者 Venus
docker ps格式化输出显示指定列已关闭评论
目的:实现docker ps时显示指定列
有时候映射的端口多了,或者容器名字过长,docker ps时,屏幕太小会换行。通过去掉一些不看的列,让其显示为一行,方便查找。
通过 man docker ps 帮助文档可以看到–format参数可以实现格式化输出自定义列。
支持的列名如下:
--format="TEMPLATE" Pretty-print containers using a Go template. Valid placeholders: .ID - Container ID .Image - Image ID .Command - Quoted command .CreatedAt - Time when the container was created. .RunningFor - Elapsed time since the container was started. .Ports - Exposed ports. .Status - Container status. .Size - Container disk size. .Names - Container names. .Labels - All labels assigned to the container. .Label - Value of a specific label for this container. For example {{.Label "com.docker.swarm.cpu"}} .Mounts - Names of the volumes mounted in this container.
table实现第一行打印列名,后面是GO语言里template语法(docker是基于go语言开发的)
[root@host ~]# docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Status}}" CONTAINER ID IMAGE NAMES STATUS a640a8b3c0d2 docker.io/rabbitmq:management rabbitmq Up 9 days a814698e6c4d centos new_guanwang Up 2 weeks 06f722c239b6 c7j8t8 guanwang Exited (137) 2 weeks ago
这样就达到想要的格式效果了。
2018-12-13
发表者 Venus
logstalgia实现nginx访问日志可视化已关闭评论
支持nginx、apache标准日志。生成图形动态效果,非常炫酷。
支持linux及windows客户端。
ubuntu下安装:
root@venus:~# apt install logstalgia
# 读取本地日志
root@venus:/usr/local/openresty/nginx/logs# logstalgia access.log
日志读取完会退出程序。
# 动态读取本地日志
root@venus:/usr/local/openresty/nginx/logs# tail -f access.log | logstalgia --sync
# 动态读取远程日志并设置一个标题
root@venus:~# ssh root@HOST tail -f /var/log/nginx/api_access.log | logstalgia --sync --title sych-api
# 更多参数通过-h查看。
root@venus:~# logstalgia -h
2018-12-13
发表者 Venus
zabbix3.4添加nginx活动连接数监控(Active connections)已关闭评论
前提:
nginx编译时添加了
--with-http_stub_status_module
这个参数。
首先配置nginx的监控模块,在虚拟主机中添加一个location
location /status { allow all; stub_status on; access_log off; }
这样访问http://域名/status就可以看到统计信息,如图。
用shell获取active connections这个值。
curl -s http://xxx.com/status | grep "Active connections:" | awk '{print $3}'
配置zabbix 被监控端:
1、添加自定义监控项
[root@sych ~]# cd /usr/local/zabbix/etc/zabbix_agentd.conf.d [root@sych zabbix_agentd.conf.d]# cat nginx.conf UserParameter=nginx.active,curl -s "http://xxx.com/status" | grep "Active connections:" | awk '{print $3}'
nginx.active是键值名,给zabbix监控端配置监控项时使用。
2、修改zabbix配置文件
[root@sych ~]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
添加下面3行
# 允许用root执行 AllowRoot=1 # 加载自定义配置文件配置路径 Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.conf #启用用户自定义监控脚本,1启用,0不启用 UnsafeUserParameters=1
重启zabbix_agentd
回到zabbix监控端测试添加的监控键值。
[root@zabbixserver ~]# /usr/local/zabbix/bin/zabbix_get -s ip地址 -p 10050 -k “nginx.active”
10
返回10,取值成功。再去配置zabbix web,添加一个监控项。
查看生成图:
配置zabbix监控nginx活动数完成。