Oracle 11g Grid : Using EMCLI to run Remote OS Commands

Posted By Sagar Patil

Here , I wish to locate disk space acquired by a Remote target Host using df command

Please read post Using EMCLI , A command line Grid Control Interface to understand how EMCLI is used

C:\EMCLI>emcli execute_hostcmd -cmd=”df -k”  -targets=”sagar-pc:host”
Error : Preferred Credentials do not exist for some targets.

The error indicates preferred user credentials are not set at Grid cntrol for this host.

Navigate to Grid -> Preferences -> Preferred Credentials -> Host ( I selected host as my target to run above command and not database)

One can set Default Credentials applied to all hosts or specific details for each individual Host

Test entered credentials by using “test button” and run  failed command again.

C:\EMCLI>emcli execute_hostcmd -cmd=”df -k”  -targets=”sagar-pc:host”
*******************************************************************************
* Target: Sagar-PC
* Execution Status: Succeeded
*******************************************************************************
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/System-Root
10063176   3090500   6461496  33% /
/dev/cciss/c0d0p1       194442     23285    161118  13% /boot
none                  16471340         0  16471340   0% /dev/shm
/dev/mapper/System-Home
2483488   2042464    314868  87% /home
/dev/mapper/System-Opt
4999260   4299264    446044  91% /opt
/dev/mapper/System-Tmp
2483488     36608   2320724   2% /tmp
*******************************************************************************
* Execution Summary
*     Targets Succeeded: 1
*     Targets Failed: 0
*******************************************************************************

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu