Skip to main content
Question

How To get OS/kernel version in Vertica catalog tables

  • September 17, 2019
  • 2 replies
  • 15 views

Vertiguy
Forum|alt.badge.img+2

Create an external table:
dbadmin=> create external table os_version (ver varchar(255)) as copy from '/etc/issue'; -- add node name to copy if you want it from any specific node . or any node
CREATE TABLE
dbadmin@node_1:~$ cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
vsql
dbadmin=> select * from os_version;

ver

Ubuntu 18.04.2 LTS n l
(1 row)

2 replies

Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • October 14, 2019

The above works on Debian/Ubuntu. For CentOS/RHEL, it's copy from '/etc/redhat-release'
For kernel build, try copy from '/proc/version'


ChuckB
Forum|alt.badge.img
  • Participating Frequently
  • November 8, 2019

It's already in the system tables.

select kernel_release, kernel_version from dc_startups;
kernel_release | kernel_version
----------------------------+-------------------------------------
3.10.0-327.36.1.el7.x86_64 | #1 SMP Sun Sep 18 13:04:29 UTC 2016

I would caution that a file like /etc/redhat-release is just a text file that can be contrived to say pretty much anything, and is therefore not as useful as the kernel release from /proc... and the kernel release from /proc is already captured in dc_startups.