osquery-1/osquery/numeric_monitoring/plugin_interface.cpp
Jesse Kornblum 9f58f0cc0a Use Status::success throughout osquery (#5542)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5542

We replace deprecated calls to the Status class with newer ones. This will stop Lint from nagging me every time I open these files. There should be no change to functionality.

Specifically, we use a codemod on `.cpp` files to replace any instance of `return Status();` with `return Status::success();`.

Reviewed By: guliashvili

Differential Revision: D14652922

fbshipit-source-id: 243576195ed201d6b82fc942a785742c6b01cf83
2019-03-29 04:28:39 -07:00

65 lines
1.4 KiB
C++

/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed in accordance with the terms specified in
* the LICENSE file found in the root directory of this source tree.
*/
#include <osquery/plugins/plugin.h>
#include <osquery/registry_factory.h>
#include "osquery/numeric_monitoring/plugin_interface.h"
namespace osquery {
CREATE_REGISTRY(NumericMonitoringPlugin, monitoring::registryName());
namespace monitoring {
const char* registryName() {
static const auto name = "numeric_monitoring";
return name;
}
namespace {
RecordKeys createRecordKeys() {
auto keys = RecordKeys{};
keys.path = "path";
keys.value = "value";
keys.timestamp = "timestamp";
keys.pre_aggregation = "pre_aggregation";
keys.sync = "sync";
return keys;
};
HostIdentifierKeys createHostIdentifierKeys() {
auto keys = HostIdentifierKeys{};
keys.name = "<DEVICE_NAME>";
keys.scheme = "<DEVICE_HOSTNAME_SCHEME>";
return keys;
};
} // namespace
const RecordKeys& recordKeys() {
static const auto keys = createRecordKeys();
return keys;
}
const HostIdentifierKeys& hostIdentifierKeys() {
static const auto keys = createHostIdentifierKeys();
return keys;
}
} // namespace monitoring
Status NumericMonitoringPlugin::call(const PluginRequest& request,
PluginResponse& response) {
// should be implemented in plugins
return Status::success();
}
} // namespace osquery