Latest Posts

简单修改ipmitool代码,让工具支持LUN显示。


简单修改ipmitool代码,让工具支持LUN显示。

主要影响两个命令ipmitool sdr elist 和ipmitool sel elist

--- ipmitool-1.8.18/lib/ipmi_sdr.c      2016-05-30 03:56:30.000000000 +0800
+++ ipmitool-1.8.18x2/lib/ipmi_sdr.c    2021-05-28 13:41:11.000000000 +0800
@@ -1655,8 +1655,8 @@ ipmi_sdr_print_sensor_fc(struct ipmi_int
                /*
                 * print sensor name, number, state, entity, reading
                 */
-               printf("%-16s | %02Xh | ",
-                      sr->s_id, sensor->keys.sensor_num);
+               printf("%-16s | %02X.%02Xh | ",
+                      sr->s_id, sensor->keys.sensor_num, sensor->keys.lun);

                if (IS_THRESHOLD_SENSOR(sensor)) {
                        /* Threshold Analog & Discrete */
@@ -2105,9 +2105,9 @@ ipmi_sdr_print_sensor_eventonly(struct i
                               sensor->keys.sensor_num,
                               sensor->entity.id, sensor->entity.instance);
                else if (sdr_extended)
-                       printf("%-16s | %02Xh | ns  | %2d.%1d | Event-Only\n",
+                       printf("%-16s | %02X.%02Xh | ns  | %2d.%1d | Event-Only\n",
                               sensor->id_code ? desc : "",
-                              sensor->keys.sensor_num,
+                              sensor->keys.sensor_num,sensor->keys.lun,
                               sensor->entity.id, sensor->entity.instance);
                else
                        printf("%-16s | Event-Only        | ns\n",
@@ -3230,6 +3230,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                case SDR_RECORD_TYPE_COMPACT_SENSOR:
                        if (e->record.common->keys.sensor_num == num &&
                            e->record.common->keys.owner_id == (gen_id & 0x00ff) &&
+                           e->record.common->keys.lun == ((gen_id & 0xff00)>>8) &&
                            e->record.common->sensor.type == type)
                                return e;
                        break;
@@ -3272,6 +3273,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                            (struct sdr_record_common_sensor *) rec;
                        if (sdrr->record.common->keys.sensor_num == num
                            && sdrr->record.common->keys.owner_id == (gen_id & 0x00ff)
+                           && sdrr->record.common->keys.lun == ((gen_id & 0xff00)>>8)
                            && sdrr->record.common->sensor.type == type)
                                found = 1;
                        break;

 


Read More

ipmitool lanplus编译需要openssl libssl-dev否则会报错undefined reference to RVP_CIPHER_CTX_reset


本文描述如何在ubuntu下编译lanplus,并描述可能遇到的问题。

1:下载ipmitool的最新版本,并查看如何安装文件INSTALL

2:根据INSTALL文件最简单的,要使用./configure; make; make install进行编译安装

3:如果在执行configure,查看接口如果不支持lanplus,则可能是缺少库文件,需要安装openssl和libssl-dev

可以使用以下命令进行安装。

# apt-get install openssl

# apt-get install libssl-dev

 

异常表现一:lanplus:no

# ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for rpmbuild... rpm
checking for sed... sed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/stat.h... (cached) yes
checking for unistd.h... (cached) yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/byteorder.h usability... no
checking sys/byteorder.h presence... no
checking for sys/byteorder.h... no
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for working strtod... yes
checking for alarm... yes
checking for gethostbyname... yes
checking for getaddrinfo... yes
checking for getifaddrs... yes
checking for socket... yes
checking for select... yes
checking for memmove... yes
checking for memset... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for getpassphrase... no
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for library containing gethostbyname... none required
checking for library containing getaddrinfo... none required
checking for library containing getifaddrs... none required
checking for library containing socket... none required
checking for EVP_aes_128_cbc in -lcrypto... no
checking for EVP_sha256 in -lcrypto... no
checking for MD5_Init in -lcrypto... no
checking for MD2_Init in -lcrypto... no
checking for linux/compiler.h... no
checking sys/ioccom.h usability... no
checking sys/ioccom.h presence... no
checking for sys/ioccom.h... no
checking linux/ipmi.h usability... yes
checking linux/ipmi.h presence... yes
checking for linux/ipmi.h... yes
checking for ipmi_open_inband in -lfreeipmi... no
checking for ipmi_ctx_open_inband in -lfreeipmi... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for OpenIPMI dual bridge support... no
checking sys/lipmi/lipmi_intf.h usability... no
checking sys/lipmi/lipmi_intf.h presence... no
checking for sys/lipmi/lipmi_intf.h... no
** Unable to build Solaris 9 x86 IPMI interface support!
checking for library containing tgetent... no
checking for library containing initscr... no
checking for library containing readline... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating contrib/Makefile
config.status: creating control/Makefile
config.status: creating control/pkginfo
config.status: creating control/prototype
config.status: creating control/rpmmacros
config.status: creating control/ipmitool.spec
config.status: creating lib/Makefile
config.status: creating include/Makefile
config.status: creating include/ipmitool/Makefile
config.status: creating src/Makefile
config.status: creating src/plugins/Makefile
config.status: creating src/plugins/lan/Makefile
config.status: creating src/plugins/lanplus/Makefile
config.status: creating src/plugins/open/Makefile
config.status: creating src/plugins/free/Makefile
config.status: creating src/plugins/imb/Makefile
config.status: creating src/plugins/bmc/Makefile
config.status: creating src/plugins/usb/Makefile
config.status: creating src/plugins/lipmi/Makefile
config.status: creating src/plugins/serial/Makefile
config.status: creating src/plugins/dummy/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

ipmitool 1.8.18

Interfaces
  lan     : yes
  lanplus : no
  open    : yes
  free    : no
  imb     : yes
  bmc     : no
  usb     : no
  lipmi   : no
  serial  : yes
  dummy   : no

Extra tools
  ipmievd   : yes
  ipmishell : no


异常表现2: undefined reference

 

undefined reference to RVP_CIPHER_CTX_reset


Read More

grep命令用法汇总


 

 

cat example.txt | grep "abcdef" 匹配字符串abcedf,匹配大小写
cat example.txt | grep -i "abcdef" 匹配字符串abcedf,忽略大小写
   
   

 

 

$ grep --help
用法: grep [选项]... PATTERN [FILE]...
在每个 FILE 或是标准输入中查找 PATTERN。
默认的 PATTERN 是一个基本正则表达式(缩写为 BRE)。
例如: grep -i 'hello world' menu.h main.c

正则表达式选择与解释:
  -E, --extended-regexp     PATTERN 是一个可扩展的正则表达式(缩写为 ERE)
  -F, --fixed-strings       PATTERN 是一组由断行符分隔的字符串。
  -G, --basic-regexp        PATTERN 是一个基本正则表达式(缩写为 BRE)
  -P, --perl-regexp         PATTERN 是一个 Perl 正则表达式
  -e, --regexp=PATTERN      用 PATTERN 来进行匹配操作
  -f, --file=FILE           从 FILE 中取得 PATTERN
  -i, --ignore-case         忽略大小写
  -w, --word-regexp         强制 PATTERN 仅完全匹配字词
  -x, --line-regexp         强制 PATTERN 仅完全匹配一行
  -z, --null-data           一个 0 字节的数据行,但不是空行

杂项:
  -s, --no-messages         不显示错误信息
  -v, --invert-match        选中不匹配的行
  -V, --version             显示版本信息并退出
      --help                显示此帮助并退出

输出控制:
  -m, --max-count=NUM       NUM 次匹配后停止
  -b, --byte-offset         输出的同时打印字节偏移
  -n, --line-number         输出的同时打印行号
      --line-buffered       每行输出清空
  -H, --with-filename       为每一匹配项打印文件名
  -h, --no-filename         输出时不显示文件名前缀
      --label=LABEL         将LABEL 作为标准输入文件名前缀
  -o, --only-matching       只显示匹配PATTERN 部分的行
  -q, --quiet, --silent     不显示所有常规输出
      --binary-files=TYPE   设定二进制文件的TYPE 类型;
                            TYPE 可以是`binary', `text', 或`without-match'
  -a, --text                等同于 --binary-files=text
  -I                        等同于 --binary-files=without-match
  -d, --directories=ACTION  读取目录的方式;
                            ACTION 可以是`read', `recurse',或`skip'
  -D, --devices=ACTION      读取设备、先入先出队列、套接字的方式;
                            ACTION 可以是`read'或`skip'
  -r, --recursive           等同于--directories=recurse
  -R, --dereference-recursive       同上,但遍历所有符号链接
      --include=FILE_PATTERN  只查找匹配FILE_PATTERN 的文件
      --exclude=FILE_PATTERN  跳过匹配FILE_PATTERN 的文件和目录
      --exclude-from=FILE   跳过所有除FILE 以外的文件
      --exclude-dir=PATTERN  跳过所有匹配PATTERN 的目录。
  -L, --files-without-match  只打印不匹配FILEs 的文件名
  -l, --files-with-matches  只打印匹配FILES 的文件名
  -c, --count               只打印每个FILE 中的匹配行数目
  -T, --initial-tab         行首tabs 分隔(如有必要)
  -Z, --null                在FILE 文件最后打印空字符

文件控制:
  -B, --before-context=NUM  打印文本及其前面NUM 行
  -A, --after-context=NUM   打印文本及其后面NUM 行
  -C, --context=NUM         打印NUM 行输出文本
  -NUM                      等同于 --context=NUM
      --color[=WHEN],
      --colour[=WHEN]       使用标记高亮匹配字串;
                            WHEN 可以是`always', `never'或`auto'
  -U, --binary              不要清除行尾的CR 字符(MSDOS/Windows)
  -u, --unix-byte-offsets   忽略CR 字符,报告字节偏移
                             (MSDOS/Windows)
 


Read More

ubuntu图形界面与命令行界面(终端)切换


ubuntu图形界面与命令行界面(终端)切换

1:   图形界面到命令行界面,使用快捷键命令   

ctrl+alt+f1 从图形界面切换到命令行界面tty1。

ctrl+alt+f2 从图形界面切换到命令行界面tty2。

ctrl+alt+f3 从图形界面切换到命令行界面tty3。

ctrl+alt+f4 从图形界面切换到命令行界面tty4。

ctrl+alt+f5 从图形界面切换到命令行界面tty5。

ctrl+alt+f6 从图形界面切换到命令行界面tty6。

2:命令行界面到图形界面,使用快捷键命令   

alt+F7 命令行界面到图形界面

ctrl+alt+F7 命令行界面到图形界面


Read More

ipmitool -b 6 -t 0x2c解释


ipmitool -b 6 -t 0x2c解释

 

Get Me Device Id

ipmitool -I lanplus -H IP -U xxx -P xxx -b 6 -t 2c raw 0x06 0x01


Read More

i2c相关问题核查方向


服务器BMC i2c相关问题核查方向

  • 首先确保链路是通的,当链路不通时,检查硬件。查看是否是对应的i2c线缆没有接上。检查是否 SCL SDA线接反了。
  • 如果链路能通,但数据返回异常,首先确认一下你发送的命令是否准确,换一下命令试试。
  • 数据返回异常时,看一下是都是异常还是部分异常,查看一下驱动能力,变更一下电阻阻值。
  • 如果数据前面正常,后面返回0xFF,修改一下或者去除buffer电路,是否电压导致变化。
  • 如果存在i2c挂死,访问正常一段时间后,无法访问。可以进行压力测试,看i2c挂死的频率,能否恢复。

Read More

server BMC firmware bring up test 服务器系统BMC固件启动(开机)测试


server BMC firmware bring up test 服务器系统BMC固件启动(开机)测试


Read More

中国公司MAC OUI申请数目统计


中国公司MAC OUI申请数目统计,只显示统计数目超过8的公司。

数据来源:1. MAC Address Block Large (MA-L)
http://standards-oui.ieee.org/oui/oui.csv
http://standards-oui.ieee.org/oui/oui.txt

HUAWEI TECHNOLOGIES CO.,LTD 华为 786
Huawei Device Co., Ltd. 华为 300
zte corporation 中兴 233
TP-LINK TECHNOLOGIES CO.,LTD. TPLINK 146
Hon Hai Precision Ind. Co.,Ltd. 鸿海精密 130
Fiberhome Telecommunication Technologies Co.,LTD 烽火通信 124
Xiaomi Communications Co Ltd 小米 114
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD OPPO 100
vivo Mobile Communication Co., Ltd. VIVO 86
Espressif Inc. 乐鑫科技 72
New H3C Technologies Co., Ltd H3C 56
TCT mobile ltd TCL 39
Sichuan Tianyi Comheart Telecom Co.,LTD 四川天一通信 39
China Mobile Group Device Co.,Ltd. 中国移动集团设备有限公司 33
Shenzhen YOUHUA Technology Co., Ltd 深圳市友华科技有限公司 31
Hangzhou Hikvision Digital Technology Co.,Ltd. 杭州海康威视 29
Hangzhou H3C Technologies Co., Limited 杭州华三科技有限公司 26
SHENZHEN GONGJIN ELECTRONICS CO.,LT 深圳共进电子有限公司 24
CHONGQING FUGUI ELECTRONICS CO.,LTD. 重庆富桂电子有限公司 24
COMPAL INFORMATION (KUNSHAN) CO., LTD. 康柏信息(昆山)有限公司 23
Taicang T&W Electronics 太仓市同维电子有限公司 22
FN-LINK TECHNOLOGY LIMITED 深圳市欧智通科技有限公司 21
Hui Zhou Gaoshengda Technology Co.,LTD 惠州高盛达科技有限公司 20
China Mobile IOT Company Limited 中国移动物联网有限公司 19
Zhejiang Dahua Technology Co., Ltd. 浙江大华科技有限公司 19
Beijing Xiaomi Mobile Software Co., Ltd 北京小米移动软件有限公司 18
Skyworth Digital Technology(Shenzhen) Co.,Ltd 深圳创维数字技术有限公司 17
Shenzhen TINNO Mobile Technology Corp. 深圳市天珑移动技术有限公司 16
SHENZHEN FAST TECHNOLOGIES CO.,LTD 深圳市迅准科技有限公司 15
WEIFANG GOERTEK ELECTRONICS CO.,LTD 潍坊高尔泰电子有限公司 14
SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LT... 深圳市美科星通信技术有限公司(水星) 13
SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LTD 深圳市创维 13
SHENZHEN BILIAN ELECTRONIC CO.,LTD 深圳市必联电子有限公司 13
Cambridge Industries(Group) Co.,Ltd.   12
Motorola (Wuhan) Mobility Technologies Communicati... 摩托罗拉(武汉)移动通信技术有限公司 12
SHENZHEN RF-LINK TECHNOLOGY CO.,LTD. 深圳市小瑞科技股份有限公司 12
LCFC(HeFei) Electronics Technology co., ltd 联宝(合肥)电子科技有限公司 12
Alcatel-Lucent Shanghai Bell Co., Ltd 阿尔卡特朗讯上海贝尔有限公司 12
Qingdao Hisense Communications Co.,Ltd. 青岛海信通信有限公司 11
Tenda Technology Co.,Ltd.Dongguan branch 腾达科技有限公司 11
Sichuan Changhong Electric Ltd. 四川长虹电气有限公司 11
Honor Device Co., Ltd. 荣誉设备有限公司 11
Zhejiang Tmall Technology Co., Ltd. 浙江天猫科技有限公司 11
Realme Chongqing Mobile Telecommunications Corp.,L...   10
GD Midea Air-Conditioning Equipment Co.,Ltd. 广东美的空调设备有限公司 10
Sichuan AI-Link Technology Co., Ltd. 四川爱联科技有限公司 10
Nokia Shanghai Bell Co., Ltd. 诺基亚上海贝尔有限公司 10
Beijing Xiaomi Electronics Co., Ltd. 北京小米电子有限公司 9
China Mobile (Hangzhou) Information Technology Co.... 中移(杭州)信息技术有限公司 9
OnePlus Technology (Shenzhen) Co., Ltd 一加手机 9
Sichuan AI-Link Technology Co., Ltd. 四川爱联科技有限公司 9
Shenzhen SuperElectron Technology Co.,Ltd. 深圳市兆能讯通科技有限公司 8
MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD. 深圳市美科星通信技术有限公司 8
Shenzhen Jingxun Software Telecommunication Techno... 深圳市晶讯软件通讯技术有限公司 8
XIAOMI Electronics,CO.,LTD 小米电子有限公司 8
Ruijie Networks Co.,LTD 锐捷网络 8
Sunitec Enterprise Co.,Ltd   8
CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD.   8
Quectel Wireless Solutions Co., Ltd. 上海移远通信技术股份有限公司 8

Read More


© 2008-2020 CunYouLu存有录博客 村友录 存游录 鲁ICP备08005943号