网站后台如何添加关键词,云南网站的设计公司,网站建设实训存在的问题,适合女生的计算机专业有哪些一、 
一般项目基本完成的时候#xff0c;后期运维工作的重点就是及时的#xff0c;合理的频率巡检了#xff0c;巡检的目的主要是及时发现各种各样的问题 
那么#xff0c;自己编写shell脚本是大部分人的第一选择#xff0c;这里有个比较麻烦的地方#xff0c;shell脚本…一、 
一般项目基本完成的时候后期运维工作的重点就是及时的合理的频率巡检了巡检的目的主要是及时发现各种各样的问题 
那么自己编写shell脚本是大部分人的第一选择这里有个比较麻烦的地方shell脚本可能巡检的指标不够全面以及shell脚本难以编写的问题 
这里我推荐大家使用xsos这个软件来简化巡检的工作很多巡检工作可以使用此工具代替了 
二、 
xsos的下载地址 
https://codeload.github.com/ryran/xsos/tar.gz/refs/tags/v0.7.33 
下载完毕后解压将xsos这个可执行文件移动到/usr/local/bin/目录下并赋予执行权限即可使用此软件无需任何依赖无需任何动态链接库可以直接使用非常nice的主要因为它是其实是一个写的非常长的shell脚本有4000多行 [rootcentos7 xsos-0.7.33]# ldd /usr/local/bin/xsos not a dynamic executable[rootcentos7 xsos-0.7.33]# file /usr/local/bin/xsos 
/usr/local/bin/xsos: Bourne-Again shell script, UTF-8 Unicode text executable, with very long lines 三、 
此软件下载只能在github其它地方没有发现需要指出的是此软件和sosreport这个软件比较类似是可以基于sosreport命令运行所产生的文件来工作的当然xsos单独也是可以工作的 
单独运行此软件 
1、获取系统的信息和内存信息 
xsos --os --mem 
输出如下 
OSHostname: centos7Distro:   [redhat-release] CentOS Linux release 7.7.1908 (Core)[centos-release] CentOS Linux release 7.7.1908 (Core)[os-release] CentOS Linux 7 (Core) 7 (Core)RHN:      (missing)RHSM:     (missing)YUM:      2 enabled plugins: fastestmirror, langpacksRunlevel: N 3  (default multi-user)SELinux:  disabled  (default disabled)Arch:     machx86_64  cpux86_64  platformx86_64Kernel:Booted kernel:  3.10.0-1062.el7.x86_64GRUB default:   3.10.0-1062.el7.x86_64  Build version:Linux version 3.10.0-1062.el7.x86_64 (mockbuildkbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Wed Aug 7 18:08:02 UTC 2019Booted kernel cmdline:root/dev/mapper/centos-root ro rd.lvm.lvcentos/root rhgb quiet LANGen_US.UTF-8GRUB default kernel cmdline:  root/dev/mapper/centos-root ro rd.lvm.lvcentos/root rhgb quiet LANGen_US.UTF-8Taint-check: 0  (kernel untainted)- - - - - - - - - - - - - - - - - - -Sys time:  Thu Oct 24 22:28:00 CST 2024Boot time: Thu Oct 24 16:22:10 CST 2024  (epoch: 1729758130)Time Zone: Asia/ShanghaiUptime:    6:05,  2 usersLoadAvg:   [4 CPU] 0.07 (2%), 0.07 (2%), 0.06 (2%)/proc/stat:procs_running: 1   procs_blocked: 0    processes [Since boot]: 19286cpu [Utilization since boot]:us 0%, ni 0%, sys 0%, idle 100%, iowait 0%, irq 0%, sftirq 0%, steal 0%MEMORYStats graphed as percent of MemTotal:MemUsed    ▊▊▊▊▊▊▊▊▊.........................................  17.3%Buffers    ..................................................   0.2%Cached     ▊▊▊▊▊.............................................  10.7%HugePages  ..................................................   0.0%Dirty      ..................................................   0.0%RAM:3.9 GiB total ram0.7 GiB (17%) used0.2 GiB (6%) used excluding Buffers/Cached0 GiB (0%) dirtyHugePages:No ram pre-allocated to HugePagesTHP:0.01 GiB allocated to THP LowMem/Slab/PageTables/Shmem:0.11 GiB (3%) of total ram used for Slab0 GiB (0%) of total ram used for PageTables0.01 GiB (0%) of total ram used for ShmemSwap:No system swap space configured 
2、 
获取系统的cpu主板以及网络相关信息 
xsos --cpu --lspci --net 
输出如下 
[rootcentos7 xsos-0.7.33]# xsos --cpu --lspci --net
CPU4 logical processors (4 CPU cores)2 13th Gen Intel Core i7-13700KF (flags: aes,constant_tsc,ht,lm,nx,pae,rdrand,vmx) └─2 threads / 2 cores eachLSPCINet:(1) Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)Storage:(1) VMware SATA AHCI controllerVGA:VMware SVGA II AdapterETHTOOLInterface Status:ens33  0000:02:01.0  linkup  rx ring 32/512  drv pcnet32 v1.35 / fw UNKNOWNInterface Errors:[None]SOFTIRQBacklog max is sufficient (Current value: net.core.netdev_max_backlog  1000)Budget is not sufficient, consider reviewing budget tunable. (Current value: net.core.netdev_budget  300)(see https://access.redhat.com/solutions/1241943)NETDEVInterface  RxMiBytes  RxPackets  RxErrs   RxDrop  RxFifo  RxComp  RxFrame  RxMultCast                 ens33      11         11 k       11 (0%)  6 (0%)  0       0       0        0 - - - - - - - - - - - - - - - - -Interface  TxMiBytes  TxPackets  TxErrs   TxDrop  TxFifo  TxComp  TxColls  TxCarrier                  ens33      1          5 k        0        0       0       0       0        0 SOCKSTATsockets: used 189TCP: inuse 4 orphan 0 tw 0 alloc 6 mem 5UDP: inuse 0 mem 0UDPLITE: inuse 0RAW: inuse 0FRAG: inuse 0 memory 0IP4Interface  Master IF  MAC Address        MTU     State  IPv4 Address          lo         -          -                  65536   up     127.0.0.1/8ens33      -          00:0c:29:90:91:4e  1500    up     192.168.123.17/24SS CHECKSessions:lost reord_seen back_log retrans_total rq tq sock_drop app_limited dsack_dups %CPU %MEM Proto User Local Command Peer ---- ---------- -------- ------------- -- -- --------- ----------- ---------- ---- ----- ---- ----- ---- ---- ------- FIREWALLServices enabled:No firewall services enabled.Rules loaded:No rules loaded.
IFCFGServices enabled:FILE         TYPE      DEVICE  NAME      HWADDR  ONBOOT  DEFROUTE  GATEWAY        NM_CONTROLLED  BOND/TEAM  MASTER  BRIDGE  ETHTOOL  PHYSDEV  PEERDNS  ZONE  MTUifcfg-ens33  Ethernet  ens33   ens33     -       yes     yes       192.168.123.2  -              -          -       -       -        -        -        -     -    ifcfg-lo     -         lo      loopback  -       yes     -         -              -              -          -       -       -        -        -        -     -    
NET STATSTcp.EstabResets:                            2TcpExt.DelayedACKs:                        40TcpExt.TCPLossProbeRecovery:                3TcpExt.TCPLossProbes:                       3TcpExt.TCPLossUndo:                         1TcpExt.TCPTimeouts:                         13、 
常用方式 
Content options:-a, --all      show everything-b, --bios     show info from dmidecode-o, --os       show hostname, distro, SELinux, kernel info, uptime, etc-k, --kdump    inspect kdump configuration-c, --cpu      show info from /proc/cpuinfo-m, --mem      show info from /proc/meminfo-d, --disks    show info from /proc/partitions  dm-multipath synopsis-t, --mpath    show info from dm-multipath-l, --lspci    show info from lspci-e, --ethtool  show info from ethtool-r, --softirq  show info from /proc/net/softnet_stat-n, --netdev   show info from /proc/net/dev-g, --bonding  show info from /proc/net/bonding-i, --ip       show info from ip addr (BASH v4 required)--net      alias for: --lspci --ethtool --softirq --netdev --bonding --ip-s, --sysctl   show important kernel sysctls-p, --ps       inspect running processes via psDisplay options:--scrub-ip     remove IP addresses  hostnames from output--scrub-mac    remove HW MAC addresses from outputsee XSOS_SCRUB_IP_HN  XSOS_SCRUB_MACADDR env vars-6, --ipv6         parse ip addr output for IPv6 addresses instead of IPv4-q, --wwidID      restrict dm-multipath output to a particular mpath device,where ID is a wwid, friendly name, or LUN identifier-u, --unitP       change byte display for /proc/meminfo  /proc/net/dev,where P is b for byte, or else k, m, g, or t-v, --verboseNUM  specify ps verbosity level (0-4, default: 1)-w, --widthNUM    change fold-width, in columns (positive number, e.g., 80)0 disables wrapping, w autodetects width (default)-x, --nocolor      disable output colorization-y, --less         send output to less -SR-z, --more         send output to moreSpecial options (BASH v4 required):--BFILE  read from FILE containing dmidecode dump--CFILE  read from FILE containing /proc/cpuinfo dump--MFILE  read from FILE containing /proc/meminfo dump--DFILE  read from FILE containing /proc/partitions dump--TFILE  read from FILE containing multipath -v4 -ll dump--LFILE  read from FILE containing lspci dump--RFILE  read from FILE containing /proc/net/softnet_stat dump--NFILE  read from FILE containing /proc/net/dev dump--GFILE  read from FILE containing /proc/net/bonding/xxx dump--IFILE  read from FILE containing ip addr dump--PFILE  read from FILE containing ps aux dump例如简单的查看网络流量情况 
[rootcentos7 xsos-0.7.33]# xsos -n
NETDEVInterface  RxMiBytes  RxPackets  RxErrs   RxDrop  RxFifo  RxComp  RxFrame  RxMultCast                 ens33      11         11 k       11 (0%)  6 (0%)  0       0       0        0 - - - - - - - - - - - - - - - - -Interface  TxMiBytes  TxPackets  TxErrs   TxDrop  TxFifo  TxComp  TxColls  TxCarrier                  ens33      1          5 k        0        0       0       0       0        0 SOCKSTATsockets: used 189TCP: inuse 4 orphan 0 tw 0 alloc 6 mem 4UDP: inuse 0 mem 0UDPLITE: inuse 0RAW: inuse 0FRAG: inuse 0 memory 0简单的查看biso信息 
[rootcentos7 xsos-0.7.33]# xsos -b
DMIDECODEBIOS:Vend: Phoenix Technologies LTDVers: 6.00Date: 11/12/2020BIOS Rev: 4.6FW Rev:   0.0System:Mfr:  VMware, Inc.Prod: VMware Virtual PlatformVers: NoneSer:  VMware-56 4d ea a7 9a 71 34 2d-80 fa b4 13 75 90 91 4eUUID: a7ea4d56-719a-2d34-80fa-b4137590914eCPU:4 of 4 CPU sockets populated, 2 cores/0 threads per CPU8 total cores, 0 total threadsMfr:  GenuineIntelFam:  UnknownFreq: 3433 MHzVers: 13th Gen Intel(R) Core(TM) i7-13700KFMemory:Total: 4096 MiB (4 GiB)DIMMs: 1 of 192 populatedMaxCapacity: 5120 MiB (5 GiB / 0.00 TiB)xsos --bios --ip --lspci --ethtool --net --ps 此命令等于xsos -bilenp 
xsos  --disks --mem --unitm 
输出如下 
[rootcentos7 xsos-0.7.33]# xsos  --disks --mem --unitm
MEMORYStats graphed as percent of MemTotal:MemUsed    ▊▊▊▊▊▊▊▊▊.........................................  17.3%Buffers    ..................................................   0.2%Cached     ▊▊▊▊▊.............................................  10.8%HugePages  ..................................................   0.0%Dirty      ..................................................   0.0%RAM:3950 MiB total ram682 MiB (17.3%) used248 MiB (6.3%) used excluding Buffers/Cached0 MiB (0%) dirtyHugePages:No ram pre-allocated to HugePagesTHP:6 MiB allocated to THP LowMem/Slab/PageTables/Shmem:112 MiB (2.8%) of total ram used for Slab4 MiB (0.1%) of total ram used for PageTables9 MiB (0.2%) of total ram used for ShmemSwap:No system swap space configuredSTORAGEWhole Disks from /proc/partitions:1 disks, totaling 100 GiB (0.10 TiB)- - - - - - - - - - - - - - - - - - - - -Disk 	Size in GiB----	-----------sda 	100Disk layout from lsblk:NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTsda               8:0    0  100G  0 disk ├─sda1            8:1    0    1G  0 part /boot└─sda2            8:2    0   80G  0 part └─centos-root 253:0    0   80G  0 lvm  /sr0              11:0    1  4.4G  0 rom  /mntFilesystem usage from df:Filesystem              1K-blocks    Used Available Use% Mounted on/dev/mapper/centos-root  83845120 1666404  82178716   2% //dev/sr0                  4554702 4554702         0 100% /mnt/dev/sda1                 1038336  139156    899180  14% /boot查看网络详情 xsos --net --unit k
LSPCINet:(1) Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)Storage:(1) VMware SATA AHCI controllerVGA:VMware SVGA II AdapterETHTOOLInterface Status:ens33  0000:02:01.0  linkup  rx ring 32/512  drv pcnet32 v1.35 / fw UNKNOWNInterface Errors:[None]SOFTIRQBacklog max is sufficient (Current value: net.core.netdev_max_backlog  1000)Budget is not sufficient, consider reviewing budget tunable. (Current value: net.core.netdev_budget  300)(see https://access.redhat.com/solutions/1241943)NETDEVInterface  RxKiBytes  RxPackets  RxErrs   RxDrop  RxFifo  RxComp  RxFrame  RxMultCast                 ens33      11788      11296      11 (0%)  6 (0%)  0       0       0        0 - - - - - - - - - - - - - - - - -Interface  TxKiBytes  TxPackets  TxErrs   TxDrop  TxFifo  TxComp  TxColls  TxCarrier                  ens33      801        5720       0        0       0       0       0        0 SOCKSTATsockets: used 189TCP: inuse 4 orphan 0 tw 0 alloc 6 mem 3UDP: inuse 0 mem 0UDPLITE: inuse 0RAW: inuse 0FRAG: inuse 0 memory 0IP4Interface  Master IF  MAC Address        MTU     State  IPv4 Address          lo         -          -                  65536   up     127.0.0.1/8ens33      -          00:0c:29:90:91:4e  1500    up     192.168.123.17/24SS CHECKSessions:lost reord_seen back_log retrans_total rq tq sock_drop app_limited dsack_dups %CPU %MEM Proto User Local Command Peer ---- ---------- -------- ------------- -- -- --------- ----------- ---------- ---- ----- ---- ----- ---- ---- ------- FIREWALLServices enabled:No firewall services enabled.Rules loaded:No rules loaded.
IFCFGServices enabled:FILE         TYPE      DEVICE  NAME      HWADDR  ONBOOT  DEFROUTE  GATEWAY        NM_CONTROLLED  BOND/TEAM  MASTER  BRIDGE  ETHTOOL  PHYSDEV  PEERDNS  ZONE  MTUifcfg-ens33  Ethernet  ens33   ens33     -       yes     yes       192.168.123.2  -              -          -       -       -        -        -        -     -    ifcfg-lo     -         lo      loopback  -       yes     -         -              -              -          -       -       -        -        -        -     -    
NET STATSTcp.EstabResets:                            2TcpExt.DelayedACKs:                        53TcpExt.TCPLossProbeRecovery:                3TcpExt.TCPLossProbes:                       3TcpExt.TCPLossUndo:                         1TcpExt.TCPTimeouts:                         1总之以上参数可以自由搭配组合得出自己喜欢的一个输出内容从而得到一个自己所期望的巡检结果 
该工具还是非常非常nice的哦~~~ 文章转载自: http://www.morning.fddfn.cn.gov.cn.fddfn.cn http://www.morning.wyppp.cn.gov.cn.wyppp.cn http://www.morning.rxkl.cn.gov.cn.rxkl.cn http://www.morning.lthpr.cn.gov.cn.lthpr.cn http://www.morning.lpcct.cn.gov.cn.lpcct.cn http://www.morning.mlhfr.cn.gov.cn.mlhfr.cn http://www.morning.kgnnc.cn.gov.cn.kgnnc.cn http://www.morning.mooncore.cn.gov.cn.mooncore.cn http://www.morning.srmpc.cn.gov.cn.srmpc.cn http://www.morning.cfrz.cn.gov.cn.cfrz.cn http://www.morning.mwjwy.cn.gov.cn.mwjwy.cn http://www.morning.cgntj.cn.gov.cn.cgntj.cn http://www.morning.bmtkp.cn.gov.cn.bmtkp.cn http://www.morning.mmsf.cn.gov.cn.mmsf.cn http://www.morning.rrwgh.cn.gov.cn.rrwgh.cn http://www.morning.bfgbz.cn.gov.cn.bfgbz.cn http://www.morning.pinngee.com.gov.cn.pinngee.com http://www.morning.newfeiya.com.cn.gov.cn.newfeiya.com.cn http://www.morning.rdlrm.cn.gov.cn.rdlrm.cn http://www.morning.mbpfk.cn.gov.cn.mbpfk.cn http://www.morning.nbhft.cn.gov.cn.nbhft.cn http://www.morning.tqsmc.cn.gov.cn.tqsmc.cn http://www.morning.liyixun.com.gov.cn.liyixun.com http://www.morning.rwzc.cn.gov.cn.rwzc.cn http://www.morning.yxgqr.cn.gov.cn.yxgqr.cn http://www.morning.qfplp.cn.gov.cn.qfplp.cn http://www.morning.gbqgr.cn.gov.cn.gbqgr.cn http://www.morning.nbgfz.cn.gov.cn.nbgfz.cn http://www.morning.stbhn.cn.gov.cn.stbhn.cn http://www.morning.cnqwn.cn.gov.cn.cnqwn.cn http://www.morning.mcgsq.cn.gov.cn.mcgsq.cn http://www.morning.tnrdz.cn.gov.cn.tnrdz.cn http://www.morning.rqsnl.cn.gov.cn.rqsnl.cn http://www.morning.lpcct.cn.gov.cn.lpcct.cn http://www.morning.qwfl.cn.gov.cn.qwfl.cn http://www.morning.lkkgq.cn.gov.cn.lkkgq.cn http://www.morning.gnkdp.cn.gov.cn.gnkdp.cn http://www.morning.prjty.cn.gov.cn.prjty.cn http://www.morning.mrxgm.cn.gov.cn.mrxgm.cn http://www.morning.sbrpz.cn.gov.cn.sbrpz.cn http://www.morning.qjsxf.cn.gov.cn.qjsxf.cn http://www.morning.nbqwt.cn.gov.cn.nbqwt.cn http://www.morning.wjjxr.cn.gov.cn.wjjxr.cn http://www.morning.dbfj.cn.gov.cn.dbfj.cn http://www.morning.yfcyh.cn.gov.cn.yfcyh.cn http://www.morning.lrplh.cn.gov.cn.lrplh.cn http://www.morning.zlhcw.cn.gov.cn.zlhcw.cn http://www.morning.bmtkp.cn.gov.cn.bmtkp.cn http://www.morning.qkrgk.cn.gov.cn.qkrgk.cn http://www.morning.njhyk.cn.gov.cn.njhyk.cn http://www.morning.rbzd.cn.gov.cn.rbzd.cn http://www.morning.dxqwm.cn.gov.cn.dxqwm.cn http://www.morning.bdqpl.cn.gov.cn.bdqpl.cn http://www.morning.kldtf.cn.gov.cn.kldtf.cn http://www.morning.pangucheng.cn.gov.cn.pangucheng.cn http://www.morning.nzfqw.cn.gov.cn.nzfqw.cn http://www.morning.lpyjq.cn.gov.cn.lpyjq.cn http://www.morning.tslxr.cn.gov.cn.tslxr.cn http://www.morning.qpnmd.cn.gov.cn.qpnmd.cn http://www.morning.fksxs.cn.gov.cn.fksxs.cn http://www.morning.lwzgn.cn.gov.cn.lwzgn.cn http://www.morning.ntcmrn.cn.gov.cn.ntcmrn.cn http://www.morning.nkjxn.cn.gov.cn.nkjxn.cn http://www.morning.zzfqn.cn.gov.cn.zzfqn.cn http://www.morning.ptzbg.cn.gov.cn.ptzbg.cn http://www.morning.yunease.com.gov.cn.yunease.com http://www.morning.rxhs.cn.gov.cn.rxhs.cn http://www.morning.mkhwx.cn.gov.cn.mkhwx.cn http://www.morning.zqkms.cn.gov.cn.zqkms.cn http://www.morning.ygbq.cn.gov.cn.ygbq.cn http://www.morning.kqbjy.cn.gov.cn.kqbjy.cn http://www.morning.rmdsd.cn.gov.cn.rmdsd.cn http://www.morning.dxtxk.cn.gov.cn.dxtxk.cn http://www.morning.bkgfp.cn.gov.cn.bkgfp.cn http://www.morning.rlrxh.cn.gov.cn.rlrxh.cn http://www.morning.lxqkt.cn.gov.cn.lxqkt.cn http://www.morning.lmyq.cn.gov.cn.lmyq.cn http://www.morning.cnhgc.cn.gov.cn.cnhgc.cn http://www.morning.kdrly.cn.gov.cn.kdrly.cn http://www.morning.fhykt.cn.gov.cn.fhykt.cn