Adding distro and version to osquery_info

This commit is contained in:
Javier Marcos 2015-04-15 16:34:12 -07:00
parent 1e584c9b93
commit 7a2716b4b6
4 changed files with 15 additions and 1 deletions

View File

@ -128,6 +128,8 @@ endif()
add_definitions(
-DOSQUERY_BUILD_VERSION=${OSQUERY_BUILD_VERSION}
-DOSQUERY_BUILD_SDK_VERSION=${OSQUERY_BUILD_SDK_VERSION}
-DOSQUERY_BUILD_OS=${OSQUERY_BUILD_OS}
-DOSQUERY_BUILD_DISTRO=${OSQUERY_BUILD_DISTRO}
-D${OSQUERY_BUILD_OS}
-D${OSQUERY_BUILD_OS}_${OSQUERY_BUILD_DISTRO}
)

View File

@ -44,6 +44,14 @@ extern const std::string kSDKVersion;
#define OSQUERY_VERSION STR(OSQUERY_BUILD_VERSION)
#define OSQUERY_SDK_VERSION STR(OSQUERY_BUILD_SDK_VERSION)
//#ifdef OSQUERY_BUILD_OS
#define OSQUERY_BUILD_PLATFORM_DISTRO STR(OSQUERY_BUILD_OS)
//#endif
//#ifdef OSQUERY_BUILD_DISTRO
#define OSQUERY_BUILD_PLATFORM_VERSION STR(OSQUERY_BUILD_DISTRO)
//#endif
/**
* @brief A helpful tool type to report when logging, print help, or debugging.
*/

View File

@ -2,6 +2,8 @@ table_name("osquery_info")
description("Top level information about the running version of osquery.")
schema([
Column("version", TEXT),
Column("build_distro", TEXT),
Column("build_version", TEXT),
Column("config_md5", TEXT),
Column("config_path", TEXT),
Column("pid", INTEGER, "Process (or thread) ID"),

View File

@ -3,7 +3,7 @@
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
@ -111,6 +111,8 @@ QueryData genOsqueryInfo(QueryContext& context) {
Row r;
r["version"] = TEXT(OSQUERY_VERSION);
r["build_distro"] = TEXT(OSQUERY_BUILD_PLATFORM_DISTRO);
r["build_version"] = TEXT(OSQUERY_BUILD_PLATFORM_VERSION);
r["pid"] = INTEGER(getpid());
std::string hash_string;