尤其又是漫遊的報表上必須要記載的溫度資訊
可是偏偏它是屬於即時的數值,並無法產出一整個月的紀錄
這時候只有想到使用HP本身的ILO 2管理介面去設定SNMP資訊
但當初廠商來施工的時候並沒有將ILO 2的網路線接上switch
而我又不知道他switch是怎麻設定的.......這個想法只好作罷
另外一個想法就是直接在VMWare ESX中新增一Server去監測資訊
但是當我把ip改成硬體設備的同段時是無法偵測到任何資訊的.....
同樣的也是因為我不知道他switch是怎麻設定的......
最爛的想法就是在vCenter的win 2008上安裝virtual box後
安裝一虛擬的nagios vm來監測所有的ESX
畢竟都是同一段,資訊一定拿得到的
可是預設的SNMP資訊並不會有LM_Sensor的資訊....那溫度怎麼辦?
爬了一個多禮拜的文,中間當然包含做了許多雜事耗費了不少時間
終於查到原來硬體廠商也有針對VMWare ESX去開發一類似HP ILO 2的網頁監測畫面 (原文)
可以透過這SNMP agent去設定相關的SNMP資訊
重點是這資訊中有溫度啦!!!!!
一開始的步驟是必需要到hp網頁去下載相關的套件 HP Management Agents for VMware ESX 4.x Only (Not for ESXi 4.x) ( 網頁 )
重點是要找到符合使用的版本
測試了幾個版本也一改一些刻板印象....舊得不會比較穩定 (因為根本就不相容.....)
下載後利用Browser Datasotre的方式將檔案上傳
然候登入ESX的SSH
將檔案複製到 /home 資料夾下
並且解壓縮
tar zvxf hpmgmt-8.5.1-vmware4x.tar.gz接著到hpgmt/851資料夾內編輯hpmgmt.conf
先將sample複製到hpmgmt.conf
cp hpmgmt.conf.sample hpmgmt.conf然後編輯裡面的snmp資訊
主要就是
# HP ProLiant Support software input file
#
# If you wish to have a custom configuration of System Management
# passwords or SNMP, modify the values and/or uncomment the lines below.
# Changing the values here can be useful in deploying multiple servers
# with the same custom configuration.
export CMASILENT="YES"
export CMANOSTARTINSTALL="hpasmd"
# export CMALOCALHOSTRWCOMMSTR - SNMP read/write community string for local
# host access.
# ex. export CMALOCALHOSTRWCOMMSTR=private
# export CMALOCALHOSTROCOMMSTR - SNMP read-only community string for local host
# access.
# ex. export CMALOCALHOSTROCOMMSTR=public
#export CMALOCALHOSTRWCOMMSTR=
#export CMALOCALHOSTROCOMMSTR=
# export CMAMGMTSTATIONRWIPORDNS - IP address or DNS host name of a system with
# read/write access to server as a management station.
# ex. export CMAMGMTSTATIONRWIPORDNS=192.168.1.1
# export CMAMGMTSTATIONRWCOMMSTR - SNMP read/write community string for a system
# with read/write access that serves as a management station.
# ex. export CMAMGMTSTATIONRWCOMMSTR=private
export CMAMGMTSTATIONRWIPORDNS=允許的來源IP
export CMAMGMTSTATIONRWCOMMSTR=使用的key
# export CMAMGMTSTATIONROIPORDNS - IP address or DNS host name of a system with
# read-only access to server as a management station.
# ex. export CMAMGMTSTATIONROIPORDNS=192.168.1.1
# export CMAMGMTSTATIONROCOMMSTR - SNMP read/write community string for a system
# with read-only access that serves as a management station.
# ex. export CMAMGMTSTATIONROCOMMSTR=private
export CMAMGMTSTATIONROIPORDNS=允許的來源IP
export CMAMGMTSTATIONROCOMMSTR=使用的key
# export CMADEFTRAPCOMMSTR - Default SNMP community string for traps.
# ex. export CMADEFTRAPCOMMSTR=private
# export CMATRAPDESTINATIONCOMMSTR - SNMP destination trap community string.
# ex. export CMATRAPDESTINATIONCOMMSTR=private
# export CMATRAPDESTINATIONIPORDNS - IP address or DNS hostname of a server to
# send SNMP traps.
# ex. export CMATRAPDESTINATIONIPORDNS=10.0.0.1
#export CMADEFTRAPCOMMSTR=
#export CMATRAPDESTINATIONCOMMSTR=
#export CMATRAPDESTINATIONIPORDNS=
# export CMASYSCONTACT & export CMASYSLOCATION - System contact and location information
# Must be in double quotes if contains spaces.
# ex. export CMASYSCONTACT="Joe Smith"
# ex. export CMASYSLOCATION="1234 Smith Lane, Building Admin #5"
#export CMASYSCONTACT=
#export CMASYSLOCATION=
# export CMAAGENTEXCLUDESTR - Agent exclusion on startup
# ex. export CMAAGENTEXCLUDESTR="cmaeventd cmaperfd"
#export CMAAGENTEXCLUDESTR=
# For accessing the System Management Homepage, the port for hpim service
# (2381) should be enabled in the firewall. Default is to enable this port.
# Set export ENABLEHPIMPORT=N if you don't want to enable the port for hpim
# service
# N = No
# Y = Yes
export ENABLEHPIMPORT=Y
# For allowing discovery by the System Inisght Manager, the port
# (2301) should be enabled in the firewall. Default is to enable this port.
# Set export ENABLEHP_SIMPORT=N if you don't want to enable the port 2301
# N = No
# Y = Yes
export ENABLEHP_SIMPORT=Y
# For the Insight Manager agents to communicate properly with HP Systems
# Insight Manager, the snmpd service should be enabled in the firewall.
# Default is to enable this service.
# Set export ENABLESNMPSERVICE=N if you don't want to enable snmpd service
# N = No
# Y = Yes
export ENABLESNMPSERVICE=Y
# For adding the HP Systems Insight Manager Certificate in SMH, the port [280]
# should be enabled in the firewall.
# Default is to enable this port.
# Set export ENABLESIMCERTPORT=N if you don't want to enable the port [280]
# N = No
# Y = Yes
export ENABLESIMCERTPORT=Y
接著就下指令安裝了
不過要記得先將ESX內的VM先轉移到其他ESX上
主要是因為會進入maintance模式中
./install851vibs.sh --silent --inputfile hpmgmt.conf會秀出以下的資訊
HP Insight Manager Agent 8.5.1-1 Installer for VMware ESX
Target System is VMware ESX 4.1.0 build-260247
Server: ProLiant DL360 G6
Putting system into maintenance mode
ESX host Maintenance Mode is SET.
Installing HP Insight Manager Agents bulletin [classic-mgmt-solution-851.1.0228]
....OK
/opt/hp/hp-agents-config /home/hpmgmt/851
==============================================================================
NOTE: New snmpd.conf entries were added to the top of /etc/snmp/snmpd.conf
==============================================================================
Following environment variables were used to configure snmpd/agents:
CMAMGMTSTATIONIPORDNS
CMAMGMTSTATIONRWCOMMSTR
CMAMGMTSTATIONROIPORDNS
CMAMGMTSTATIONROCOMMSTR
snmpd is started
Enabling port for hpim service (2381) in the firewall....OK
Enabling port for HP System Management (2301) in the firewall....OK
Enabling snmpd service in the firewall....OK
Enabling port [280] for adding the HP SIM Certificate in SMH....OK
Stopping System Management Homepage:....OK
Starting HP Insight Manager agents:....OK
Starting System Management Homepage:....OK
Stopping SNMP stack:
Stopping snmpd:....OK
Starting SNMP stack:
Starting snmpd:....OK
**********************************************************
* System Management Homepage installed successfully with *
* default configuration values. To change the default *
* configuration values, type the following command at *
* the root prompt: *
* *
* /opt/hp/hpsmh/sbin/smhconfig *
* *
**********************************************************
Please read the License Agreement for this software at
/opt/hp/hp-health/hp-health.license
By not removing this package, you are accepting the terms
of the "License for HP Value Added Software".
HP Insight Manager agents have been configured successfully!
/home/hpmgmt/851HP SNMP agents are installed and configured
Reboot the system to make the changes effective.
ESX host Maintenance Mode is UNSET.
ESX host Maintenance mode is reset to normal.
接著就重開機吧~~
重開機後可能會遇到vSphere上顯示ESX HA無法設定的錯誤資訊
有極大的可能是因為剛開機還沒穩定
等穩定後就對他Reconfigure for VMware HA就ok了
接著就可以在瀏覽器上輸入 https://ip:2381 ,帳號密碼就是ESX的Root帳號
然後就可以利用snmp去trap資訊了
使用的key就是剛剛在hpmgmt檔案中輸入的資訊囉
接下來頭痛的應該就是如何把資訊塞到Nagios中
0 意見:
張貼留言