首页 文章 精选 留言 我的

精选列表

搜索[长期价值性],共10000篇文章
优秀的个人博客,低调大师

Linux中周期性任务

用途: 按照设置的时间间隔为用户反复执行某一项固定的系统任务 软件包: cronie , crontabs 系统服务 crond 日志文件 : /var/log/crond 启动计划任务,并且设置开机自启 systemctl start crond [root@openstack ~]# systemctl enable crond 编辑: crontab -e -u 用户名 格式 : 分 时 日 月 周 任务命令行(绝对路径) 查看 : crontab -l ]# crontab -l 50 21 * /usr/sbin/poweroff清除 : crontab -r -u 用户名 # crontab -r -u root[root@openstack ~]# crontab -l no crontab for root

优秀的个人博客,低调大师

阶段性总结_学习笔记

从11月6日到12月6日, 一个月从入门到放弃 目前为止,学习了 FHS,linux文件架构标准 / /boot /dev /opt /mnt /media /proc /tmp /usr /etc /lib 等等 文件的查找 locate find。 文本处理工具 cat,tac,grep,sed,wc,sort,uniqc,tr,cut,paste,diff,head,tail,less,more, 文件的操作 cp,mv,rm,mkdir,rmdir,touch,file,stat,tree,ls,ln vi及vim工具的使用 压缩解压缩 tar,gzip,bz2,xz,cpio 用户、组、文件权限的管理 useradd usermod userdel finger,id,chsh,chfn passwd groupadd,groupmod,groupdel newuser,newgrp, chmod,chown,chgrp, lsattr,chattr,getfacl,setfacl 磁盘及文件系统管理 fdisk,gdisk,parted,partx,partprobe,kpartx mkfs,tune2fs,dume2fs,blk,lsblk,df,dh,dd mount,umount 高级文件系统管理 quota, raid,lvm mdadm bash shell脚本编写初级 linux基础命令 type,who,tty,which,whatis,where,hash,history,date,man, lscpu,free, 软件包管理 rpm,yum 通配符glob,管道符|,正则表达式 man 7 glob bash的快捷操作方式。 本文转自 lajifeiwomoshu 51CTO博客,原文链接:http://blog.51cto.com/lajifeiwomoshu/2048503

优秀的个人博客,低调大师

zabbix3.0.4监控nginx性

在zabbixagentd客户端上,查看nginx是否加载了–with-http_stub_status_module。因为zabbix监控nginx是根据nginx的Stub Status模块,抓取Status模块所提供的数据。假如以前没开启,现在想启用StubStatus 模块,在编译nginx 的时候要加上参数 –with-http_stub_status_module,执行./configure && make就可以了,不用make install。不过,一般情况下都是安装了的。 检查with-http_stub_status_module有没有安装 nginx status 开启方法: server{ ... location/status{ stub_statuson; access_logoff; allow123.123.123.123;#zabbix服务器IP地址,一般是内网地址。 allow127.0.0.1; denyall; } 在nginx配置文件中: 启动nginx [root@iZ25sh42s8wZvhosts]#/usr/local/nginx/sbin/nginx-t nginx:theconfigurationfile/usr/local/nginx/conf/nginx.confsyntaxisok nginx:configurationfile/usr/local/nginx/conf/nginx.conftestissuccessful [root@iZ25sh42s8wZvhosts]#/etc/init.d/nginxreload ReloadingNginx:[OK] 用curl做测试 状态页面各项数据的意义:active connections – 当前 Nginx 正处理的活动连接数。serveraccepts handled requests — 总共处理了 233851 个连接 , 成功创建 233851 次握手 (证明中间没有失败的 ), 总共处理了 687942 个请求 ( 平均每次握手处理了 2.94 个数据请求 )。reading — nginx 读取到客户端的 Header 信息数。writing — nginx 返回给客户端的 Header 信息数。waiting — 开启 keep-alive 的情况下,这个值等于 active – (reading + writing), 意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接。 zabbix-agent 配置 有3个步骤,首先是编写获取Nginx信息脚本,接着配置中增加key信息,然后重启agent 服务。 ①编写Nginx监控脚本,记住路径,后面配置需要用到,注意脚本权限问题,agent运行用户要能执行。 mkidr -p /usr/local/zabbix-agent/scripts/ cd /usr/local/zabbix-agent/scripts vi nginx-check.sh #!/bin/bash ################################## # Zabbix monitoring script # # nginx: # - anything available via nginx stub-status module # ################################## # Contact: # vincent.viallet@gmail.com # Zabbix requested parameter ZBX_REQ_DATA="$1" ZBX_REQ_DATA_URL="$2" # Nginx defaults NGINX_STATUS_DEFAULT_URL="http://bbs.jzq.pub/nginx-status" #(这里写网站的域名) WGET_BIN="/usr/bin/wget" # # Error handling: # - need to be displayable in Zabbix (avoid NOT_SUPPORTED) # - items need to be of type "float" (allow negative + float) # ERROR_NO_ACCESS_FILE="-0.9900" ERROR_NO_ACCESS="-0.9901" ERROR_WRONG_PARAM="-0.9902" ERROR_DATA="-0.9903" # either can not connect / bad host / bad port # Handle host and port if non-default if [ ! -z "$ZBX_REQ_DATA_URL" ]; then URL="$ZBX_REQ_DATA_URL" else URL="$NGINX_STATUS_DEFAULT_URL" fi # save the nginx stats in a variable for future parsing NGINX_STATS=$($WGET_BIN -q $URL -O - 2> /dev/null) # error during retrieve if [ $? -ne 0 -o -z "$NGINX_STATS" ]; then echo $ERROR_DATA exit 1 fi # # Extract data from nginx stats # case $ZBX_REQ_DATA in active_connections) echo "$NGINX_STATS" | head -1 | cut -f3 -d' ';; accepted_connections) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f2 -d' ';; handled_connections) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f3 -d' ';; handled_requests) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f4 -d' ';; reading) echo "$NGINX_STATS" | tail -1 | cut -f2 -d' ';; writing) echo "$NGINX_STATS" | tail -1 | cut -f4 -d' ';; waiting) echo "$NGINX_STATS" | tail -1 | cut -f6 -d' ';; *) echo $ERROR_WRONG_PARAM; exit 1;; esac exit 0 ~ chmodo+x/usr/local/zabbix-agent/scripts/nginx-check.sh agent的配置文件 /etc/zabbix/zabbix_agentd.conf 中定义了其他key的包含目录 Include=/etc/zabbix/zabbix_agentd.d/, 如果没有这个配置请自己添加下。接着在 /etc/zabbix/zabbix_agentd.d/ 目录新建一个文件 nginx-params.conf, 内容如下 加入以下内容: UserParameter=nginx[*],/usr/local/zabbix-agent/scripts/nginx-check.sh "$1" /etc/init.d/zabbix-agent restart 模板文件比较长留一个下载地址https://github.com/jizhang/zabbix-templates/blob/master/nginx/nginx-template.xml 在新建的主机--选择该模板。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册