运维命令记录

2019-07-30  本文已影响0人  圣地亚哥_SVIP
通过命令行获取硬件信息:
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]
上一篇 下一篇

猜你喜欢

热点阅读