Sun Java System Web Server 7.0 Update 3 管理員指南

使用 CLI 配置 SNMP

Procedure在 Solaris 上啟動 SNMP

  1. 配置 SNMP 參數。

    設定配置的 SNMP 參數。


    wadm> enable-snmp --user=admin --password-file=../admin.passwd 
    --host=serverhost --port=8989 --ssl=true --no-prompt --rcfile=null 
    --config=config1 --loconfig1ion=india --master-host=hostname 
    --description=cli-snmp --organization=sun --contact=internal
  2. 部署配置。


    wadm> deploy-config --user=admin --password-file=admin.pwd 
    --host=serverhost --port=8989 config1
  3. 啟動伺服器實例。


    $ ./https-test/bin/startserv
  4. 以超級使用者身份執行主代理程式 (magt)。


    備註 –

    若要執行 magt,必須先停止本機 snmpd。



    $ cd /etc/init.d/
    		   $ init.dmi stop; init.snmpdx stop; init.sma stop

    移除檔案 https-admserv/config/logs/pid.masteragt (如果存在)。


    $ rm ./https-admserv/config/logs/pid.masteragt
        	   wadm>  start-snmp-master-agent --snmp-port 161 hostname
  5. 啟動子代理程式。

    移除檔案 https-admserv/config/logs/pid.httpagt (如果存在)。


    $ rm ./https-admserv/config/logs/pid.httpagt

    強制結束 httpagt (如果它已執行)。


    wadm> start-snmp-subagent hostname

Procedure在 Linux 上啟動 SNMP

  1. 配置 SNMP 參數。

    設定配置的 SNMP 參數。


    wadm> enable-snmp --user=admin --password-file=../admin.passwd 
    --host=serverhost --port=8989 --ssl=true --no-prompt --rcfile=null 
    --config=config1 --loconfig1ion=india --master-host=hostname 
    --description=cli-snmp --organization=sun --contact=internal
  2. 部署配置。


    wadm deploy-config --user=admin --password-file=admin.pwd 
    --host=serverhost --port=8989 config1
  3. 啟動伺服器實例。


    $ ./https-test/bin/startserv
  4. 以超級使用者身份執行本機主代理程式 (snmpd)。

    若要允許使用 snmpd 進行直接通訊,請在 /etc/snmp/snmpd.conf 中增加下一行,然後重新啟動 snmpd。

    smuxpeer 1.3.6.1.4.1.42.2.190.1

    view systemview included .1.3.6.1.4.1.42.2.190.1


    # cd /etc/init.d/
          # ./snmpd stop
          # ./snmpd start
  5. 啟動子代理程式。

    移除檔案 https-admserv/config/logs/pid.httpagt (如果存在)。


    $ rm ./https-admserv/config/logs/pid.httpagt

    強制結束 httpagt (如果它已執行)。


    wadm> start-snmp-subagent hostname

Procedure在 Windows 上啟動 SNMP

  1. 配置 SNMP 參數。

    設定配置的 SNMP 參數。


    wadm> enable-snmp --user=admin --password-file=../admin.passwd 
    --host=serverhost --port=8989 --ssl=true --no-prompt --rcfile=null 
    --config=config1 --loconfig1ion=india --master-host=hostname 
    --description=cli-snmp --organization=sun --contact=internal
  2. install-root/ lib 目錄增加至系統路徑環境變數。

  3. 重新啟動機器。

  4. 使用 Windows 服務選項啟動 Web 伺服器實例。

  5. 啟動 SNMP 服務。


    備註 –

    以非超級使用者的身份安裝管理伺服器時,您將無法透過管理介面啟動 SNMP 主代理程式。若要讓非超級使用者管理伺服器使用者能夠透過管理介面啟動主代理程式,非超級使用者使用者必須取得相關權限,才能使用 RBAC 連結至有特殊權限的連接埠,即 SNMP 主代理程式執行所在的連接埠。預設的 SMUX 連接埠為 199,而預設的 SNMP 連接埠為 161。

    另一個解決方法就是使用下列指令,以超級使用者身份手動啟動主代理程式:magt CONFIG INIT The magt command is located under server-root/lib/snmp/magt/


Procedure配置基於對等端的主代理程式 (magt)

藉由執行下列步驟,您可以配置基於對等端的主代理程式,以便與 Solaris 10 和 Linux 的作業系統本機主代理程式整合。


備註 –

Solaris 10 作業系統本機主代理程式為 snmpd。根據預設,它會在 SNMP 預設 UDP 連接埠 161 上執行。您可以使用 /etc/sma/snmp/snmpd.conf 檔案加以配置。還提供代理指令,用於將請求/回應轉寄至其他主代理程式或子代理程式。如需更多資訊,請參閱 snmpd.conf 線上手冊。

Solaris 8 和 9 沒有與作業系統本機主代理程式 snmpd 完全整合。對於 linux,httpagt 可直接與 snmpd 整合。在這種情況下,不需要執行 magt。對於 Windows,Sun Java System Web Server snmp 程式庫直接與 Windows SNMP 服務通訊。


  1. 啟動主代理程式,按上述備註所述指定 SNMP 連接埠 (11161)。

  2. 在 /etc/sma/snmp/snmpd.conf 中為 Solaris 10 增加下列內容。


    proxy -v 1 -c public myserver:11161 .1.3.6.1.4.1.42.2.190.1
  3. 重新啟動 snmpd。


    # cd /etc/init.d
    # init.dmi stop; init.snmpdx stop; init.sma stop
    # init.dmi start; init.snmpdx start; init.sma start
  4. 若要取得 SNMP 資料,請在連接埠上使用 snmpwalk:


    $ snmpwalk -c public -v 1 <host-name>:<port> 1.3.6.1.4.1.42.2.190.1