venerdì 23 febbraio 2024

UBUNTU - How do I mount shared folders in Ubuntu using VMware

Per condividere una directory tra host e VM occorre prima accedere a vmware "Virtual Machine Settings" e spostarsi su "Options". 

In questo tab accedere a "Shared Folders" e configurare una directory di cui fare lo share. 

Lato Ubuntu una volta configurato vmware effettuare la configurazione del file fstab. Ma prima occorre configurare i tools di vmware su Ubuntu.

Eseguire il seguente comando per abilitare i tools:

  • sudo apt-get install open-vm-tools open-vm-tools-desktop
A questo punto accedere al file fstab ed aggiungere la stringa che permette la mount della directory presente sull'host.

  • sudo vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=dad2f2d1-2c0a-4e88-831c-67a122f0572c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=DA2B-A740  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

A questo punto aggiungere al termine del file la stringa che permette di effettuare la mount della directory host:

.host:/ORACLE_PROJECT    /mnt/hgfs/ORACLE_PROJECT/    fuse.vmhgfs-fuse    defaults,allow_other,uid=1000     0    0

Salvare il file e creare la directory indicata sopra:
  • cd /mnt/hgfs
  • mkdir ORACLE_PROJECT
A questo punto fare un test eseguendo il comando :
  • mount -a
Se tutto ok allora avremo effettuato correttamente la mount.

orcl1521@orcl1521-virtual-machine:~$ ll /mnt/hgfs
total 28
drwxr-xr-x 3 root     root  4096 feb 23 17:44 ./
drwxr-xr-x 3 root     root  4096 feb 19 17:12 ../
drwxrwxrwx 1 orcl1521 root 20480 feb 23 17:42 ORACLE_PROJECT/
orcl1521@orcl1521-virtual-machine:~$ ll /mnt/hgfs/ORACLE_PROJECT/
total 9308
drwxrwxrwx 1 orcl1521 root   20480 feb 23 17:42  ./
drwxr-xr-x 3 root     root    4096 feb 23 17:44  ../
drwxrwxrwx 1 orcl1521 root    4096 mag 11  2022  001_ORACLE_BASE_DBA_Scripts/
drwxrwxrwx 1 orcl1521 root    4096 gen 11  2023  02_WORKDAY/
-rwxrwxrwx 1 orcl1521 root  974608 feb 19 18:32  report_export1.xml*
-rwxrwxrwx 1 orcl1521 root  211773 feb 19 18:33  report_export2.xml*
-rwxrwxrwx 1 orcl1521 root   91339 feb 19 18:33  report_export3.xml*
-rwxrwxrwx 1 orcl1521 root  601587 feb 19 18:33  report_export4.xml*
-rwxrwxrwx 1 orcl1521 root  148404 feb 19 18:33  report_export5.xml*
-rwxrwxrwx 1 orcl1521 root  160672 feb 19 18:34  report_export6.xml*
-rwxrwxrwx 1 orcl1521 root  137419 gen 15  2019  report_export.xml*
drwxrwxrwx 1 orcl1521 root       0 mag 11  2022  SAP/
-rwxrwxrwx 1 orcl1521 root    3205 feb  1  2019  SEQ_INS_UPD_ANA_EDW_INV2*
-rwxrwxrwx 1 orcl1521 root  109350 apr 30  2019  seq.xml*
-rwxrwxrwx 1 orcl1521 root 3167755 feb 28  2017  SmartExport_PRJ_ODI_AEI_SVIL.xml*
drwxrwxrwx 1 orcl1521 root   12288 mag 11  2022  SOGEI/
drwxrwxrwx 1 orcl1521 root   12288 feb 16 14:05  sw/
drwxrwxrwx 1 orcl1521 root    4096 mag 11  2022  TEST_AEI/
drwxrwxrwx 1 orcl1521 root    4096 mag 11  2022  TEST_EOC/
-rwxrwxrwx 1 orcl1521 root  152302 mar 25  2019  Text1.txt*
-rwxrwxrwx 1 orcl1521 root    7143 mag 10  2019  Text2*
-rwxrwxrwx 1 orcl1521 root     228 apr 30  2019  Text3*

giovedì 11 gennaio 2024

ODI 12c - Shell Unix for Test if Agent ODI is Up o Down

 Di seguito una semplice shell per verificare se un agent ODI sia o meno attivo.


#!/bin/bash

# Set the Oracle ODI Agent URL

AGENT_URL="http://localhost:25910/oraclediagent"


# Check the status of the ODI Agent

#echo "curl -so /dev/null -w "%{http_code}" $AGENT_URL"

STATUS_CODE=$(wget --server-response $AGENT_URL  2>&1 | awk '/^  HTTP/{print $2}' | grep 200 | awk '{print NR}')

echo $STATUS_CODE

# Check the HTTP status code of the ODI Agent

#if [ $STATUS_CODE == "200" ]; then

if [ $STATUS_CODE == "1" ]; then

    echo "Oracle ODI Agent is running."

     exit 0  # Exit with success status

else

    echo "Oracle ODI Agent is not running."

     exit 1  # Exit with failure status

fi


To use this script, follow these steps:

1. Open a text editor and paste the script.

2. Save the file with a `.sh` extension, for example `check_odi_agent.sh`.

3. Open a terminal and navigate to the directory where you saved the script.

4. Make the script executable with the command `chmod +x check_odi_agent.sh`.

5. Run the script with the command `./check_odi_agent.sh`.

6. The script will display whether the Oracle ODI Agent is running or not.