Skip to content

Commit

Permalink
Merge pull request #78 from afumagalli98/minor-change
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
afumagalli98 authored May 16, 2023
2 parents 367920c + 60f3357 commit b512be9
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ercole-agent
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ sub buildData {
}
$hostData{'location'} = $configuration{'location'};
$hostData{'environment'} = $configuration{'envtype'};
$hostData{'period'} = $configuration{'frequency'};
$hostData{'period'} = $configuration{'frequency'} + 0;
$hostData{'tags'}=[];
$hostData{'agentVersion'} = $version;
$hostData{'schemaVersion'} = $hostDataSchemaVersion;
Expand Down
2 changes: 1 addition & 1 deletion fetch/aix/dbstatus
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [ "$RUNNING" -eq "0" ]; then
exit 0
fi

DB_STATUS=$(sqlplus -S / as sysdba << EOF
DB_STATUS=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select open_mode from v\$database;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/aix/dbversion
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

DB_VERSION=$(sqlplus -S / as sysdba << EOF
DB_VERSION=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select version from v\$instance;
exit
Expand Down
8 changes: 4 additions & 4 deletions fetch/aix/license
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

fn() {
sqlplus -S / as sysdba << EOF
sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select (case when UPPER(banner) like '%EXTREME%' then 'EXE' when UPPER(banner) like '%ENTERPRISE%' then 'ENT' else 'EXE' end) as versione from v\$version where rownum=1;
exit
Expand All @@ -60,14 +60,14 @@ EOF

DB_VERSION=$(fn)

DB_NAME=$(sqlplus -S / as sysdba << EOF
DB_NAME=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select name from v\$database;
exit
EOF
)

DB_ONE=x$(sqlplus -S / as sysdba << EOF
DB_ONE=x$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
HOST srvctl config database -d $DB_NAME |grep -i One
exit
Expand Down Expand Up @@ -101,7 +101,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/license.sql $LICENSING_CPU_CORES $FACTOR $DB_ONE
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/aix/opt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/opt.sql
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/hpux/dbstatus
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [ "$RUNNING" -eq "0" ]; then
exit 0
fi

DB_STATUS=$(sqlplus -S / as sysdba << EOF
DB_STATUS=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select open_mode from v\$database;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/hpux/dbversion
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

DB_VERSION=$(sqlplus -S / as sysdba << EOF
DB_VERSION=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select version from v\$instance;
exit
Expand Down
8 changes: 4 additions & 4 deletions fetch/hpux/license
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ export PATH=$HOME/bin:$PATH

S_VERSION="select (case when UPPER(banner) like '%EXTREME%' then 'EXE' when UPPER(banner) like '%ENTERPRISE%' then 'ENT' else 'STD' end) as versione from v\$version where rownum=1;"

DB_VERSION=$(sqlplus -S / as sysdba << EOF
DB_VERSION=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
${S_VERSION}
exit
EOF
)

DB_NAME=$(sqlplus -S / as sysdba << EOF
DB_NAME=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select name from v\$database;
exit
EOF
)

DB_ONE=x$(sqlplus -S / as sysdba << EOF
DB_ONE=x$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
HOST srvctl config database -d $DB_NAME |grep -i One
exit
Expand Down Expand Up @@ -133,7 +133,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/license.sql $CPU_THREAD "$FACTOR" $DB_ONE
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/hpux/opt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/opt.sql
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/solaris/dbstatus
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [ "$RUNNING" -eq "0" ]; then
exit 0
fi

DB_STATUS=$(sqlplus -S / as sysdba << EOF
DB_STATUS=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select open_mode from v\$database;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/solaris/dbversion
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

DB_VERSION=$(sqlplus -S / as sysdba << EOF
DB_VERSION=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select version from v\$instance;
exit
Expand Down
8 changes: 4 additions & 4 deletions fetch/solaris/license
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

fn() {
sqlplus -S / as sysdba << EOF
sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select (case when UPPER(banner) like '%EXTREME%' then 'EXE' when UPPER(banner) like '%ENTERPRISE%' then 'ENT' else 'EXE' end) as versione from v\$version where rownum=1;
exit
Expand All @@ -60,14 +60,14 @@ EOF

DB_VERSION=$(fn)

DB_NAME=$(sqlplus -S / as sysdba << EOF
DB_NAME=$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
select name from v\$database;
exit
EOF
)

DB_ONE=x$(sqlplus -S / as sysdba << EOF
DB_ONE=x$(sqlplus -S "/ AS SYSDBA" << EOF
set pages 0 feedback off
HOST srvctl config database -d $DB_NAME |grep -i One
exit
Expand Down Expand Up @@ -105,7 +105,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/license.sql $CPU_THREAD $CORE_FACTOR $DB_ONE
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down
2 changes: 1 addition & 1 deletion fetch/solaris/opt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ elif [ $DBV == "11" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/opt.sql
else
IS_PDB=$(
sqlplus -S / as sysdba <<EOF
sqlplus -S "/ AS SYSDBA" <<EOF
set pages 0 feedback off timing off
SELECT CASE WHEN COUNT(*) > 0 THEN 1 WHEN count(*) = 0 THEN 0 END FROM v\$pdbs;
exit
Expand Down

0 comments on commit b512be9

Please sign in to comment.