在EMCC13c中部署agent的方法分兩種,一種是通過EMCC13c的控制台通過ssh直接把agent“推送”安裝到被管理端。這樣的方法在linux平台的OMS和被管理端比較簡單,由于Linux平台有自帶的ssh工具,不須要進行ssh工具的配置。
可是windows的平台的OMS和被管理端要進行安裝Cygwin工具(windows平台上運作的類UNIX模拟環境),前期的準備步驟比較多。另外一種方法是通過目标端手動安裝代理的方法,這樣的方法在windows的被管理端上安裝agent相對照較簡單一些。當然這樣的方法在Linux上也适用。
1,擷取Agent軟體
預設安裝完EMCC13c上面隻有一個13.3.0.0.0 Linuxx86_64版本的agent。但是其他作業系統平台的agent需要自行下載下傳。
1.1 離線模式獲得更新目錄
通過連結下載下傳最新的更新目錄:(需要mos賬号的權限)
https://updates.oracle.com/Orion/Download/download_patch/p9348486_112000_Generic.zip
将下載下傳的的檔案上傳到OMS主機
運作emcli 指令導入下載下傳的檔案到OMS伺服器執行個體
--指令的路徑
[[email protected] bin]$ pwd
/u01/app/weblogic/bin
--登入到EM
[[email protected] bin]$ ./emcli login -username=sysman -password=sysman12
Login successful
--同步emcli及OMS
[[email protected] bin]$ ./emcli sync
Synchronized successfully
--擷取所有的target資訊
[[email protected] bin]$ ./emcli get_targets
--導入更新目錄
[[email protected] bin]$ ./emcli import_update_catalog -file=/soft/p9348486_112000_Generic.zip -omslocal
Processing catalog for Agent Software
Processing update: Agent Software - Agent Software (12.1.0.5.0) for Microsoft Windows (32-bit)
…………
Successfully uploaded the Self Update catalog to Enterprise Manager. Use the Self Update Console to view and manage updates.
Time taken for import catalog is 02:32.146.
[[email protected] bin]$ ./emcli logout
Logout successful
這時在上面的頁面,可以看到新的可用代理
1.2 下載下傳agent軟體
通過該網址下載下傳windows 64位 13.3的agent軟體
https://updates.oracle.com/Orion/Services/download/p28239183_112000_Generic.zip?aru=22301228&patch_file=p28239183_112000_Generic.zip
如果使用“推送”的方式部署代理,需要完成下述操作。如果是在目标端手動安裝,請跳過。
[[email protected] ~]$ cd /u01/app/weblogic/bin
[[email protected] bin]$./emcli login -username=sysman
Enter password :
Login successful
[[email protected] bin]$ ./emcli sync
Synchronized successfully
[[email protected] bin]$ ./emcli import_update -omslocal -file=/soft/p28239183_112000_Generic.zip
Processing update: Agent Software - Agent Software (13.3.0.0.0) for Microsoft Windows x64 (64-bit)
Successfully uploaded the update to Enterprise Manager. Use the Self Update Console to manage this update.
這樣在添加目标的時候,可以看到如下的界面,代理軟體已經可用
2,Linux平台目标添加
EMCC13c平台包含Linux作業系統下agent代理,是以可以在EMCC13c web管理平台,使用“推送”的方式将agent代理安裝在遠端被監控的主機上。
2.1 目标端配置hosts以及sudo權限的授予
[[email protected] ~]$ su - root
Password:
[[email protected] ~]# vi /etc/hosts
10.3.2.206 gridcontrol
10.81.33.250 lsyf.jxjzt
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[[email protected] ~]# cp /etc/sudoers /etc/sudoers_bak
[[email protected] ~]# chmod 777 /etc/sudoers
[[email protected] ~]# vi /etc/sudoers
修改前:
Defaults requiretty
修改後:
Defaults !requiretty
修改前:
Defaults !visiblepw
修改後:
Defaults visiblepw
修改前:
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
修改後
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL --這裡加一行
[email protected] ~]# chmod 440 /etc/sudoers
--驗證
[[email protected] ~]# su - oracle
[[email protected] ~]$ sudo ls -l /root/
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for oracle:
total 120
-rw-------. 1 root root 2690 Apr 29 15:52 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Desktop
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Documents
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Downloads
-rw-r--r--. 1 root root 60932 Apr 29 15:52 install.log
-rw-r--r--. 1 root root 11186 Apr 29 15:49 install.log.syslog
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Music
-rw-r--r--. 1 root root 5355 Jul 4 22:00 ntpdate.log
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Pictures
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Public
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Templates
drwxr-xr-x. 2 root root 4096 Apr 29 15:59 Videos
2.2 監控服務端hosts配置
[[email protected] ~]# vi /etc/hosts
10.3.2.206 gridcontrol
10.81.33.250 lsyf.jxjzt --添加目标端ip和主機
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
2.3 推送agent代理到目标端并安裝
目标端建立存放agent目錄
[[email protected] ~]$ cd /u01
[[email protected] u01]$ mkdir agent
這時Linux平台的目标代理已經安裝成功。