美文网首页
运维命令记录

运维命令记录

作者: 圣地亚哥_SVIP | 来源:发表于2019-07-30 13:58 被阅读0次
通过命令行获取硬件信息:
yum install pciutils storcli -y

型号:

dmidecode |grep -i "System Information" -C 5
查看CPU及序列号等信息

CPU信息:

dmidecode |grep -i CPU

内存信息:

dmidecode |grep -i "memory device" -C 20
dmidecode |grep -i "memory device" |wc -l

raid卡信息:

lspci |grep -i raid

硬盘信息:

/opt/MegaRAID/storcli/storcli64 /c0 show 
storcli具体使用可参考官方文档

查看磁盘的错误日志:

 # smartctl -l error  /dev/sdi

查看磁盘的ERR:

 # storcli64 /c0/e0/s{slot} show all

磁盘定位:

 # storcli64 /c0/e0/s7 start/stop locate 

网卡信息:
lspci |grep -i eth

查看本机的IPMI地址:

   ipmitool lan print

进入IPMI界面:

ipmitool -I lanplus -H {ipmi} -U root -P root sol activate

本地console连接虚拟机

云虚拟机中,一般通过vnc连接虚拟机,但是当虚拟机出现启动问题进入紧急模式时,通过vnc就无法进入,此时需要另一种方式进入虚拟机处理。

可以在虚拟机所在物理机通过console进入虚拟机,如下:

#virsh destroy {instance}
#virsh edit {instance}   //修改如下block

    <serial type="pty">
        <target port='0'/>
    </serial>
    <console type="pty">
        <target type='serial' port='0'/>
    </console>

#virsh start {instance}
#virsh console {instance}

Linux系统运维

  1. 内存管理
    手动释放内存:

/proc/sys/vm/drop_caches: 1/2/3

1: 释放pagecache
2: 释放inode及dentry缓存
3: 释放 pagecache及inode及dentry缓存

ARP命令:

ip -s -s neigh flush all          //删除ARP缓存
arp -d {ip}                           //删除ARP某个条目

查看socket信息

echo "help"    | socat stdio {sock}
echo "show info" | socat stdio {sock}

storcli64命令

# storcli64 /c0/e0/s7 help
     Storage Command Line Tool  Ver 007.0409.0000.0000 Nov 06, 2017

     (c)Copyright 2017, AVAGO Technologies, All Rights Reserved.


storcli /cx[/ex]/sx show 
storcli /cx[/ex]/sx show all
storcli /cx[/ex]/sx start rebuild 
storcli /cx[/ex]/sx stop rebuild 
storcli /cx[/ex]/sx pause rebuild 
storcli /cx[/ex]/sx resume rebuild 
storcli /cx[/ex]/sx show rebuild 
storcli /cx[/ex]/sx show health 
storcli /cx[/ex]/sx show poh [ignoreselftest]
storcli /cx[/ex]/sx show smart 
storcli /cx[/ex]/sx start copyback target=e:s 
storcli /cx[/ex]/sx stop copyback 
storcli /cx[/ex]/sx pause copyback 
storcli /cx[/ex]/sx resume copyback 
storcli /cx[/ex]/sx reset phyerrorcounters 
storcli /cx[/ex]/sx show copyback 
storcli /cx[/ex]/sx show patrolread 
storcli /cx[/ex]/sx show phyerrorcounters 
storcli /cx[/ex]/sx start initialization  
storcli /cx[/ex]/sx stop initialization  
storcli /cx[/ex]/sx show initialization  
storcli /cx[/ex]/sx start locate  
storcli /cx[/ex]/sx stop locate  
storcli /cx[/ex]/sx show securitykey keyid 
storcli /cx[/ex]/sx add hotsparedrive [DGs=<N|0,1,2...>] [enclaffinity]
    [nonrevertible]
storcli /cx[/ex]/sx delete hotsparedrive
storcli /cx[/ex]/sx spinup
storcli /cx[/ex]/sx spindown
storcli /cx[/ex]/sx set online 
storcli /cx[/ex]/sx set offline 
storcli /cx[/ex]/sx set missing 
storcli /cx[/ex]/sx set jbod 
storcli /cx[/ex]/sx set security=on 
storcli /cx[/ex]/sx set good [force]  
storcli /cx[/ex]/sx insert dg=A array=B row=C 
storcli /cx[/ex]/sx download src=<filepath> [satabridge] [mode= 5|7] [parallel] [force]
storcli /cx[/ex]/sx download status
storcli /cx[/ex]/sx download src=<filepath> mode= E offline [activatenow] [delay=<val>]
storcli /cx[/ex]/sx download  mode= F offline [delay=<val>]
storcli /cx[/ex]/sx secureerase [force]  
storcli /cx[/ex]/sx start erase [simple| normal| thorough | standard| threepass | crypto]
   [patternA=<val>] [patternB=<val>]
storcli /cx[/ex]/sx stop erase 
storcli /cx[/ex]/sx show erase 
storcli /cx[/ex]/sx show rawdata pageaddr=<pageaddress in hex> file=<filename> 
storcli /cx[/ex]/sx set bootdrive=<on|off> 
storcli /cx[/ex]/sx show diag paniclog [Query] | [ExtractSlot=x] 
                                         | [EraseSlot=x] [file=filepath]
storcli /cx[/ex]/sx show diag smartlog [file=filepath] 
storcli /cx[/ex]/sx show diag errorlog [file=filepath] 
storcli /cx[/ex]/sx start format [thorough]

相关文章

  • 运维命令记录

    通过命令行获取硬件信息: 型号: CPU信息: 内存信息: raid卡信息: 硬盘信息: 查看磁盘的错误日志: 查...

  • 常用运维命令

    运维查询命令 开发调试命令

  • qos-server,dubbo的在线命令服务

    qos-server,是dubbo在线运维命令服务,默认端口号为:2222,用于接口命令,运维dubbo。

  • 云计算工程师学习内容

    运维命令: 运维工程师学习内容: 云计算工程师学习内容:

  • Linux之crontab定时任务

    ****前言****无论是做开发还是做运维的程序猿,crontab命令是必须用到的命令,特别是对于运维的人,自动化...

  • Linux运维常用的命令介绍-文本查看命令

    今天小编要跟大家分享的文章是关于Linux运维常用的命令介绍-文本查看命令。熟悉Linux运维工作的小伙伴们都知道...

  • RocketMQ运维命令

    RocketMQ 提供有控制台及一系列控制台命令,用于对主题,集群,broker等信息的管理; 登录控制台: 查看...

  • 日常运维命令

    计算空间du -h --max-depth=1 /path 连接数netstat -n | awk '/^tcp/...

  • 运维日常命令

    1.修改系统时间date -s "2017-11-18 10:18:00"clock -w2.查看系统的内核una...

  • linux运维命令

    查看cpu信息 查看cpu processor个数 查看内存情况 其中buff/cache是缓冲区大小 查看某个进...

网友评论

      本文标题:运维命令记录

      本文链接:https://www.haomeiwen.com/subject/mztnrctx.html