Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #39 from raffaelloferrari/master
Browse files Browse the repository at this point in the history
PSU parsing problem #93
  • Loading branch information
amreo authored Oct 30, 2019
2 parents 65c309b + 3902da8 commit 2146b6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions fetch/host
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ CHECK_TYPE_SERVER_OVM_DMESG=$(dmesg | grep OVM | wc -l)
CHECK_TYPE_SERVER_OVM_LOG=$(grep -i ovm /var/log/dmesg | wc -l)
CHECK_TYPE_SERVER_VMWARE=$(dmesg | grep VMware | wc -l)
CHECK_TYPE_SERVER_VMWARE_LOG=$(grep VMware /var/log/dmesg* | wc -l)
CHECK_TYPE_SERVER_HYPERV=$(dmesg | grep HyperV|wc -l)
CHECK_TYPE_SERVER_HYPERV_LOG=$(grep HyperV /var/log/dmesg* | wc -l)
# CHECK_TYPE_SERVER_AIX=$(uname -L | awk '{print $1}')
# TODO: HPUX has a specific server type, see original script
CHECK_TYPE_SERVER_HPUX=0
Expand All @@ -75,6 +77,9 @@ if [ "$CHECK_TYPE_SERVER_OVM_DMESG" -gt 0 ] || [ "$CHECK_TYPE_SERVER_OVM_LOG" -g
elif [ $CHECK_TYPE_SERVER_VMWARE -gt 0 ] || [ "$CHECK_TYPE_SERVER_VMWARE_LOG" -gt 0 ]; then
TYPE=VMWARE
VIRTUAL=Y
elif [ $CHECK_TYPE_SERVER_HYPERV -gt 0 ] || [ "$CHECK_TYPE_SERVER_HYPERV_LOG" -gt 0 ]; then
TYPE=HYPERV
VIRTUAL=Y
elif [ $CHECK_TYPE_SERVER_HYPERVISOR -gt 0 ]; then
TYPE=VMOTHER
VIRTUAL=Y
Expand Down
11 changes: 6 additions & 5 deletions sql/psu-2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ SELECT DBMS_DB_VERSION.VERSION || '.' || DBMS_DB_VERSION.RELEASE into :VERSION F
(
select
case
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '1' THEN TO_DATE('140114','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '2' THEN TO_DATE('150120','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '3' THEN TO_DATE('150414','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '4' THEN TO_DATE('150714','YYMMDD')
WHEN substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1) = '5' THEN TO_DATE('151020','YYMMDD')
WHEN length(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1)) = 6 THEN TO_DATE(substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,7),'YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '1' THEN TO_DATE('140114','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '2' THEN TO_DATE('150120','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '3' THEN TO_DATE('150414','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '4' THEN TO_DATE('150714','YYMMDD')
WHEN substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,1) = '5' THEN TO_DATE('151020','YYMMDD')
ELSE
TO_DATE(substr(substr(DESCRIPTION, - instr(reverse(DESCRIPTION), '.') + 1),1,7),'YYMMDD')
END as PSU_DATE
Expand Down

0 comments on commit 2146b6f

Please sign in to comment.