So Tired !_! 逆水行舟, 不进则退!

31Jul/18

Install racadm on Ubuntu / Debian for Dell iDRAC

Posted by Nick Xu

http://linux.dell.com/repo/community/deb/latest/

dell-poweredge-drac7-1.50.50-command-line.pdf

Dell OpenManage 7.1 Ubuntu Repository

This is the community-supported Dell OpenManage 7.1 repository for 64-bit Ubuntu 10.04 or later versions, as well as Debian Squeeze and (pre-release) Wheezy. 32-bit packages are provided as well, which also have the srvadmin-megalib package, but are not tested; use the 32-bit packages at your own risk. Debian Wheezy users will need to get libssl0.9.8 from Debian Squeeze or unstable. For PowerEdge 12G servers, it is highly recommended that you are running Ubuntu 12.04 or later due to better driver coverage. Below, you will find instructions on how to install and setup OpenManage command-line and web interfaces.

IMPORTANT NOTE FOR UPGRADING:

If you are upgrading, in step 4, you must use apt-get install <meta-package name> or apt-get dist-upgrade. Do not use apt-get upgrade, as doing so will not upgrade all the necessary packages.

Installation/Upgrade:

1.  (Optional for Upgrade) Create a new file ending in 'sources.list' in the '/etc/apt/sources.list.d' directory. Cut and paste the command below. (If typing by hand, note carefully the spacing.)

echo 'deb http://linux.dell.com/repo/community/deb/latest /' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list

2.  To verify OMSA packages, add the repository key to apt. Note that you must re-do this step if upgrading from OMSA 6.5 because a new key is being used.

gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F

gpg -a --export 1285491434D8786F | sudo apt-key add -

If you are behind a firewall that only allows outbound traffic over port 80, you may need to use this instead:

gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-key 1285491434D8786F (possibly needing to add "--keyserver-options http-proxy=http://<user>:<password>@<proxy>:<port>")

gpg -a --export 1285491434D8786F | sudo apt-key add -

3.  Make apt aware of the new software repository by issuing the following command:

sudo apt-get update

4.  Install one of the following selection of meta-packages to install the OMSA functionality you require:

srvadmin-all:Install all OMSA components

srvadmin-base:Install only base OMSA, no web server

srvadmin-rac4:Install components to manage the Dell Remote Access Card 4

srvadmin-rac5:Install components to manage the Dell Remote Access Card 5

srvadmin-idrac:Install components to manage iDRAC

srvadmin-idrac7:Install components to manage iDRAC7

srvadmin-webserver:Install Web Interface

srvadmin-storageservices:Install RAID Management

For example, to install all of OMSA: sudo apt-get install srvadmin-all

If you are upgrading, you must use apt-get install or apt-get dist-upgrade. Do not use apt-get upgrade, as doing so will not upgrade all the necessary packages.

 

CLI:

dataeng service starts automatically at reboot. If you want to manually start the service, issue the command below.

  1. sudo service dataeng start
  2. Now, you can use omreportomconfig, and omhelp commands.
  3. For example, you can issue omreport system summary to get details about your system.
  4. You can use omconfig to configure component properties.
  5. omhelp provides help information for commands.
  6. See OpenManage CLI User's Guide for comprehensive documentation.

 

Web Interface:

To use web interface, users with appropriate permissions need to be added.

1.  Add users with appropriate permissions to /opt/dell/srvadmin/etc/omarolemap file. See detailed information in the User's Guide.

         Example:john_doe     *     Administrator

2.  Start the web server.

         sudo service dsm_om_connsvc start

3.  Go to https://<ip_address>:1311/ in your browser to access OMSA.

4.  If you want to start dsm_om_connvsc service at boot, issue sudo update-rc.d dsm_om_connsvc defaults command.

 

Removal

Uninstall all packages: sudo apt-get --auto-remove remove srvadmin-all

Uninstall all packages including config files: sudo apt-get --auto-remove purge srvadmin-all

 

Documentation:

OpenManage 7.1 Documentation

OMSA 7.1 Manuals

Server Administrator Readme

 

Filed under: Linux Comments Off
25Jul/18

H3C交换机 从console口配置 到设置远程访问(web/telnet)

Posted by Nick Xu

一、console口配置:

现在一般的电脑没有装配com的公口,所以,需要另外购买1根转换线。这里先说原装线的配置:

1、使用交换机自带的,rj45(及网线口)转com(RS232,9孔)线:
买了线才发现,台式服务器(IBM)后面是有这个接口的(机柜式服务器不确定)。
(1)插上线后,xp,打开超级终端;win7、win2008等等,推荐SecureCRT,比网上找的其他的软件好用多了!!
(2)随便写个名字,选择com1端口(!这个很重要!),具体的参数最好按照说明指导书设置,说明指导书可以通过搜索H3C网站相关型号找到。也可以直接点下“恢复默认设置”。
(3)我的经验是,如果只有光标在闪,那么按下回车键,就会出来信息了。

2、使用rj45(网口)转USB线:
(1)首先安装这条线的驱动;
(2)插上线后,xp,打开超级终端;win7、win2008等等,推荐SecureCRT,比网上找的其他的软件好用多了!!
(3)随便写个名字,选择的端口要看“设备管理器”中,“端口”项目中多出来的那个“service。。。”是com几,比如,我的就是“com3”(!这个很重要!),具体的参数最好按照说明指导书设置,说明指导书可以通过搜索H3C网站相关型号找到。也可以直接点下“恢复默认设置”。
(4)我的经验是,如果只有光标在闪,那么按下回车键,就会出来信息了。

二、配置远程访问,包括http和telnet访问:
(1)配置ip和http访问:
sys
[h3c]interface vlan 1  //进入vlan1进行配置
[h3c-vlan-interface1]ip address 192.168.1.1 255.255.255.0 //设置交换机的ip地址
[h3c-vlan-interface1]quit

(1) Device

# Web 用 名为 admin, 为 admin, 为 http,用 为 network-admin。 [Sysname] local-user admin

[Sysname-luser-manage-admin] service-type http
[Sysname-luser-manage-admin] authorization-attribute user-role network-admin

[Sysname-luser-manage-admin] password simple admin

[Sysname-luser-manage-admin] quit

# HTTP 。
[Sysname] ip http enable
(2) PC
在 PC 的 内 的 IP 并 , 示 Web 面。
在 Web 用 对 中 用 名、 及 , < > 可 , 示 Web 面。成 ,用 可以在 对 进行 。

 

(2)配置telnet访问:
sys
[h3c]telnet server enable  //设置允许telnet服务
[h3c]user-interface vty 0  //
[h3c-vty-0]authentication-mode scheme //设置访问模式,包括none(无账户无密码)、password(无账户有密码)、scheme(有账户有密码)
[h3c-vty-0]quit
[h3c]local-user 你的用户名
“[h3c-user-]password cipher 你的密码”//如果之前设置了可以不用写了
“[h3c-user-]anthorization-attribute level 3 “ //设置访问级别  //如果之前设置了可以不用写了
[h3c-user-]service-type telnet//设置该账户的访问模式
[h3c-user-]quit

(3)访问:
之后就可以通过网页访问交换机了,网页输入192.168.1.1,就会进入交换机的登录页面;
xp可以直接在运行里输入”telnet 192.168.1.1“,win7等系统,需要先安装telnet服务,在”程序“,”安装windows功能“里就可以安装了。

Filed under: Linux, Mac OS Comments Off
25Jul/18

rs232 for mac

Posted by Nick Xu

PL-2303芯片,Prolific公司的产品,到官网下载驱动!

打开网站 http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41下载最新的MAC串口驱动,下载完成后安装,安装完还要重启。

重启完成之后我们在“网络偏好设置”中,发现多了一项USB-SerialController

这说明我们的驱动安装成功了!

下面进行简单的测试,终端执行命令:

cd /dev

ls tty.*

你会发现输出中有一项为tty.usbserial,没错,这就是我们的串口设备。

首先配置minicom(minicom的安装非常简单,使用brew安装,终端输入sudo brew install minicom即可),终端输入

安装完了后需要配置,下面是我的配置过程

[root@sheryuan ~]# minicom -s

+-----[configuration]------+
≠ Filenames and paths      ≠
≠ File transfer protocols  ≠
≠ Serial port setup        ≠
≠ Modem and dialing        ≠
≠ Screen and keyboard      ≠
≠ Save setup as dfl        ≠
≠ Save setup as..          ≠
≠ Exit                     ≠
≠ Exit from Minicom        ≠
+--------------------------+

1、Serial port setup选项配置
选择配置项,这里我们主要配置Serial port setup选项,下面是基本配置

+-----------------------------------------------------------------------+
≠ A -    Serial Device      : /dev/ttyS0                                ≠
≠ B - Lockfile Location     : /var/lock                                 ≠
≠ C -   Callin Program      :                                           ≠
≠ D -  Callout Program      :                                           ≠
≠ E -    Bps/Par/Bits       : 115200 8N1                                ≠
≠ F - Hardware Flow Control : No                                        ≠
≠ G - Software Flow Control : No                                        ≠
≠                                                                       ≠
≠    Change which setting?                                              ≠
+-----------------------------------------------------------------------+
A选项Serial Device 根据我们的串口来,如果是COM1我们就选择ttyS0(不过后面说的出错也有例外),COM2口选择ttyS1等等

E选项Bps/Par/Bits串口波特率、数据位、奇偶校验未、停止位设置为115200 8N1

F选项一定要改为NO,不然终端只能打印从下位机发过来的信息,而不能接受键盘的输入

 

2、Modem and dialing选项配置

有些网上的资料都写到Modem and dialing的配置,不过这个可要可不要,因为不配置它和配置它没有感觉有啥区别,不过我每次都进行了配置。

下面是它的配置选项:

+--------------------[Modem and dialing parameter setup]---------------------+
≠                                                                            ≠
≠ A - Init string .........                                                  ≠
≠ B - Reset string ........                                                  ≠
≠ C - Dialing prefix #1.... ATDT                                             ≠
≠ D - Dialing suffix #1.... ^M                                               ≠
≠ E - Dialing prefix #2.... ATDP                                             ≠
≠ F - Dialing suffix #2.... ^M                                               ≠
≠ G - Dialing prefix #3.... ATX1DT                                           ≠
≠ H - Dialing suffix #3.... ;X4D^M                                           ≠
≠ I - Connect string ...... CONNECT                                          ≠
≠ J - No connect strings .. NO CARRIER            BUSY                       ≠
≠                           NO DIALTONE           VOICE                      ≠
≠ K - Hang-up string ......                                                  ≠
≠ L - Dial cancel string .. ^M                                               ≠
≠                                                                            ≠
≠ M - Dial time ........... 45      Q - Auto bps detect ..... No             ≠
≠ N - Delay before redial . 2       R - Modem has DCD line .. Yes            ≠
≠ O - Number of tries ..... 10      S - Status line shows ... DTE speed      ≠
≠ P - DTR drop time (0=no). 1       T - Multi-line untag .... No             ≠
≠                                                                            ≠
≠ Change which setting?       (Return or Esc to exit)                        ≠
+----------------------------------------------------------------------------+
这里A、B、K三个选项后面开始本来都有相应的参数,我们需要将他们删除,设置为无参数

 

这样,我们的minicom就基本配置完成了

 

三、minicom使用过程中遇到的问题

安装和配置minicom都很简单,不过使用中途会出现一些问题,也许这些问题也是安装过程会出现的

 

问题1、执行minicom时locked

[root@sheryuan ~]# minicom
Device /dev/ttyS0 is locked. 或者出现 Device /dev/ttyS0 lock failed: Operation not permitted.

解决方法:这个问题一般是上次直接关闭putty,而没有关闭minicom,或者是putty死机的情况重新打开putty后会出现这种情况,相当于minicom还在后台执行,只是我们没有发觉而已,这里我们执行ps -aux 查看一下是否有minicom进程,获取minicom的进程号,kill -9命令结束后台的minicom,然后启动minicom就会解决问题了

如果遮掩不能解决问题,可能是因为系统自动在目录/var/lock中生成了lockfile而导致,我们只要进入/var/lock,删除lockfile,那么minicom又可以正常启动了。

 

问题2、minicom只能打印下位机信息不能接受键盘的输入

解决方法:这里是由于我们minicom配置没有配置好,重新minicom -s进行Serial port setup配置,Hardware Flow Control : No ,Software Flow Control : No,将软硬控制流都设置为NO。

 

问题3、不能打开串口设备

minicom: cannot open /dev/ttyUSB0

这个问题是我当时重装系统后用,再次用虚拟机时候进入minicom后出现的

解决方法:断开相应的串口然再次连接(虚拟机的右下角操作),然后进入minicom看是否有效。如果实在解决不了问题。我们最好重启一下虚拟机,然后就应该没问题了

 

问题4、minicom运行缓慢,甚至进不去,出现minicom: cannot open /dev/ttyUSB0: Connection timed out的打印信息。

因为我用的是USB转串口线,前段时间在虚拟中用可以不把该端口当USB口用而是当物理串口用,不过安装完系统后不能把其当物理串口,只能把该端口作为USB口用,在/dev下也出现ttyUSB0设备。不过开始在minicom中配置端口为ttyUSB0也可以连接进入arm环境,不过运行很慢,ls命令出来成列文件就有问题,而且经常出现打印的错误,重启了虚拟机几次,换了minicom的版本,还是不行,后来干脆进入不了minicom,出现minicom: cannot open /dev/ttyUSB0: Connection timed out的错误,感觉与问题3相似,但他们完全是两码事情。

解决方法:后来无意中重启物理windows系统,然后运行虚拟机后,发现串口设置中可以将USB串口设置为实际的物理串口,这样我们就不用ttyUSB0而是直接用ttyS0串口,这样下来进入minicom很顺利,而且运行很流畅。

这个问题我思考了一下,可能是我刚装物理机后,USB转串口驱动安装后,最好要重启一下系统。具体问题我现在也数不清楚。

 

问题5、minicom环境下黑白屏显示问题

也是我解决完问题4进入minicom出现的问题,当时感觉很郁闷,因为文件显示没有颜色区分,文件夹、文件、可执行文件等都是一种颜色,白字黑底色。这样当然不行,所以网上搜了很长时间。

进入mincom时采用这个命令minicom -c on代替minicom就可以进入彩色界面了

具体原因我也了解了网上的说法,不过配置里面没有找到相关的设置。

有些终端(如Linux控制台)支持标准ANSI转义序列色彩,minicom硬性内置了这些转义 序列的代码,但是此选项缺省为off,需要使用‘-c on’打开此项。

不过每次都输入minicom -c on 有点烦哦。使用环境变量吧,export minicom="minicom -c on" 以后想要打开对色彩的支持就输入minicom 即可

 

问题先就写这么多,你出现的问题与我一样,但是用我的方法不能解决也是不足为奇的。大家可以到多了解minicom的设置,到网上搜索别人的解决方法进行对比都是可行的。希望能够给予大家帮助,如果以后出现其他的问题,还会继续添加到后面。

 

在Linux下退出minicom 按ctrl-a x 即可。
但是在Mac OS X这个方法失效了。后来找到方法是

http://osxdaily.com/2013/02/01/use-option-as-meta-key-in-mac-os-x-terminal/

把option键映射成 meta键。即打开终端的偏 好设置,把option键映射
这里写图片描述

设置后,按option(即alt)+ a x 即可退出。

 

 

Filed under: Mac OS Comments Off
4Jul/18

php-fpm for Windows?

Posted by Nick Xu

Here how to setup php-fpm on Windows:

  1. Download the .zip file from http://windows.php.net/download/. The .zip file should be VC9 which has the FastCGI file (php-cgi.exe). Don't download VC6, and don't download the .msi file because it requires that you have IIS setup already in order to install php-fpm. The zip file contains the php-cgi.exe which is what you need for php-fpm. I downloaded a slightly older version, php-5.3.10-Win32-VC9-x86.zip, from here http://windows.php.net/downloads/releases/archives/ because I wanted to match the version running on my production server.
  2. Unzip the file, e.g. unzip into C:\php-5.3.10-Win32-VC9-x86
  3. Edit the php.ini file as needed. What I did:
    # nginx security setting
    cgi.fix_pathinfo=0
    
    extension_dir = "C:\php-5.3.10-Win32-VC9-x86\ext"
    

    enable the following modules by uncommenting them:

    extension=php_curl.dll
    extension=php_mbstring.dll
    extension=php_mysqli.dll
    
  4. Create a .bat file somewhere, e.g. start-php-fcgi.bat in webserver directory or in the PHP directory:
    @ECHO OFF
    ECHO Starting PHP FastCGI...
    set PATH=C:\php-5.3.10-Win32-VC9-x86;%PATH%
    C:\php-5.3.10-Win32-VC9-x86\php-cgi.exe -b 127.0.0.1:9123 -c C:\php-5.3.10-Win32-VC9-x86\php.ini
    
  5. Double click the .bat file to start php-fpm. A window will popup and stay open while its running. Its kind of annoying, but just haven't looked into setting it up as service yet.
  6. Configure your webserver. If you wish to use it with nginx, here a config sample for 127.0.0.1:9123:
    location ~ \.php$ {
        fastcgi_pass    127.0.0.1:9123;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }
Filed under: php Comments Off
   
site
site