Documentation ¶
Overview ¶
File Monitor Plugin Watches for changes to files in the interesting directories
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
File Monitor Plugin Watches for changes to files in the interesting directories
Index ¶
- Constants
- Variables
- func NewCloudSecurityGroupsPlugin(id ids.PluginID, ctx agent.AgentContext, harvester cloud.Harvester) agent.Plugin
- func NewDaemontoolsPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewDpkgPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewHostinfoPlugin(ctx agent.AgentContext, cloudHarvester cloud.Harvester) agent.Plugin
- func NewKernelModulesPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewRpmPlugin(ctx agent.AgentContext) agent.Plugin
- func NewSELinuxPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewSupervisorPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewSystemdPlugin(ctx agent.AgentContext) agent.Plugin
- func NewSysvInitPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewUpstartPlugin(id ids.PluginID, ctx agent.AgentContext) agent.Plugin
- func NewUsersPlugin(ctx agent.AgentContext) agent.Plugin
- type CloudSecurityGroup
- type CloudSecurityGroupsPlugin
- type DaemontoolsPlugin
- type DaemontoolsService
- type DpkgItem
- type DpkgPlugin
- type Facter
- type FacterClient
- type FacterItem
- type FacterPlugin
- type HostinfoData
- type HostinfoPlugin
- type KernelModule
- type KernelModulesPlugin
- type RpmItem
- type SELinuxConfigValue
- type SELinuxPlugin
- type SELinuxPolicyModule
- type SshdConfigPlugin
- type SshdConfigValue
- type Supervisor
- type SupervisorClient
- type SupervisorItem
- type SupervisorPlugin
- type SupervisorProcess
- type SysctlItem
- type SysctlPlugin
- type SysctlSubscriberPlugin
- type SystemdPlugin
- type SystemdService
- type SysvInitPlugin
- type SysvService
- type UpstartPlugin
- type UpstartService
- type User
- type UsersPlugin
Constants ¶
const ( DPKG_INFO_DIR = "/var/lib/dpkg/info" FSN_CLOSE_WRITE = 16 )
const ( WRITABLE_MASK = 0222 READABLE_MASK = 0444 )
const (
RpmPath = "/bin/rpm"
)
Paths
const (
SYSV_INIT_DIR = "/var/run"
)
Variables ¶
var ErrSELinuxDisabled = errors.New("SELinux status: disabled")
var (
PluginDisabledErr = errors.New("frequency disabled plugin")
)
Inventory plugin errors
var SELinuxConfigProperties = map[string]string{
"SELinux status": "Status",
"SELinuxfs mount": "FSMount",
"Current mode": "CurrentMode",
"Policy version": "PolicyVersion",
"Policy from config file": "PolicyLevel",
}
Output we care about - if the label from sestatus output matches a key, we'll return its value using this map's value as the ID for the inventory entity.
var SshdConfigConfigRegexp *regexp.Regexp
Functions ¶
func NewDaemontoolsPlugin ¶
func NewDpkgPlugin ¶
func NewHostinfoPlugin ¶
func NewKernelModulesPlugin ¶
func NewRpmPlugin ¶
func NewRpmPlugin(ctx agent.AgentContext) agent.Plugin
func NewSELinuxPlugin ¶
func NewSupervisorPlugin ¶
func NewSystemdPlugin ¶
func NewSystemdPlugin(ctx agent.AgentContext) agent.Plugin
func NewSysvInitPlugin ¶
func NewUpstartPlugin ¶
func NewUsersPlugin ¶
func NewUsersPlugin(ctx agent.AgentContext) agent.Plugin
Types ¶
type CloudSecurityGroup ¶
type CloudSecurityGroup struct {
SecurityGroup string `json:"id"`
}
func (CloudSecurityGroup) SortKey ¶
func (c CloudSecurityGroup) SortKey() string
type CloudSecurityGroupsPlugin ¶
type CloudSecurityGroupsPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*CloudSecurityGroupsPlugin) Run ¶
func (p *CloudSecurityGroupsPlugin) Run()
type DaemontoolsPlugin ¶
type DaemontoolsPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*DaemontoolsPlugin) Run ¶
func (self *DaemontoolsPlugin) Run()
type DaemontoolsService ¶
func (DaemontoolsService) SortKey ¶
func (self DaemontoolsService) SortKey() string
type DpkgItem ¶
type DpkgPlugin ¶
type DpkgPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*DpkgPlugin) Run ¶
func (self *DpkgPlugin) Run()
Run is the main processing loop that drives the logic for the plugin
type FacterClient ¶
type FacterClient struct {
// contains filtered or unexported fields
}
func (*FacterClient) Facts ¶
func (self *FacterClient) Facts() (map[string]FacterItem, error)
func (*FacterClient) Initialize ¶
func (self *FacterClient) Initialize() error
type FacterItem ¶
type FacterItem struct { Name string `json:"id"` Value interface{} `json:"value"` }
func (FacterItem) SortKey ¶
func (fi FacterItem) SortKey() string
type FacterPlugin ¶
type FacterPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func NewFacterPlugin ¶
func NewFacterPlugin(ctx agent.AgentContext) *FacterPlugin
func (*FacterPlugin) CanRun ¶
func (self *FacterPlugin) CanRun() bool
func (*FacterPlugin) Data ¶
func (self *FacterPlugin) Data() (agent.PluginInventoryDataset, error)
func (*FacterPlugin) Run ¶
func (self *FacterPlugin) Run()
type HostinfoData ¶
type HostinfoData struct { System string `json:"id"` Distro string `json:"distro"` KernelVersion string `json:"kernel_version"` HostType string `json:"host_type"` CpuName string `json:"cpu_name"` // Number of cores within a single CPU ('cpu cores' field in /proc/cpuinfo) // It is shown as 'coreCount' in New Relic UI CpuNum string `json:"cpu_num"` // Total number of cores in all the CPUs ('processor' entries in /proc/cpuinfo) // It is shown as 'processorCount' in New Relic UI TotalCpu string `json:"total_cpu"` Ram string `json:"ram"` UpSince string `json:"boot_timestamp"` AgentVersion string `json:"agent_version"` AgentName string `json:"agent_name"` AgentMode string `json:"agent_mode"` OperatingSystem string `json:"operating_system"` ProductUuid string `json:"product_uuid"` BootId string `json:"boot_id"` RegionAWS string `json:"aws_region,omitempty"` RegionAzure string `json:"region_name,omitempty"` RegionGCP string `json:"zone,omitempty"` RegionAlibaba string `json:"region_id,omitempty"` AWSAccountID string `json:"aws_account_id,omitempty"` AWSAvailabilityZone string `json:"aws_availability_zone,omitempty"` AWSImageID string `json:"aws_image_id,omitempty"` }
func (HostinfoData) SortKey ¶
func (self HostinfoData) SortKey() string
type HostinfoPlugin ¶
type HostinfoPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*HostinfoPlugin) Data ¶
func (self *HostinfoPlugin) Data() agent.PluginInventoryDataset
func (*HostinfoPlugin) Run ¶
func (self *HostinfoPlugin) Run()
type KernelModule ¶
type KernelModule struct { Name string `json:"id"` Version string `json:"version"` Description string `json:"description"` }
func (KernelModule) SortKey ¶
func (self KernelModule) SortKey() string
type KernelModulesPlugin ¶
type KernelModulesPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*KernelModulesPlugin) Run ¶
func (self *KernelModulesPlugin) Run()
type RpmItem ¶
type SELinuxConfigValue ¶
func (SELinuxConfigValue) SortKey ¶
func (self SELinuxConfigValue) SortKey() string
type SELinuxPlugin ¶
type SELinuxPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*SELinuxPlugin) Run ¶
func (self *SELinuxPlugin) Run()
type SELinuxPolicyModule ¶
func (SELinuxPolicyModule) SortKey ¶
func (self SELinuxPolicyModule) SortKey() string
type SshdConfigPlugin ¶
type SshdConfigPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func NewSshdConfigPlugin ¶
func NewSshdConfigPlugin(id ids.PluginID, ctx agent.AgentContext) *SshdConfigPlugin
func (*SshdConfigPlugin) Run ¶
func (self *SshdConfigPlugin) Run()
type SshdConfigValue ¶
func (SshdConfigValue) SortKey ¶
func (self SshdConfigValue) SortKey() string
type Supervisor ¶
type Supervisor interface {
Processes() ([]SupervisorProcess, error)
}
type SupervisorClient ¶
type SupervisorClient struct {
// contains filtered or unexported fields
}
func NewSupervisorClient ¶
func NewSupervisorClient(proto string, address string) (cl *SupervisorClient, err error)
func (*SupervisorClient) Processes ¶
func (self *SupervisorClient) Processes() ([]SupervisorProcess, error)
type SupervisorItem ¶
func (SupervisorItem) SortKey ¶
func (self SupervisorItem) SortKey() string
type SupervisorPlugin ¶
type SupervisorPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*SupervisorPlugin) CanRun ¶
func (self *SupervisorPlugin) CanRun() bool
func (*SupervisorPlugin) Data ¶
func (self *SupervisorPlugin) Data() (agent.PluginInventoryDataset, map[int]string, error)
func (*SupervisorPlugin) GetClient ¶
func (self *SupervisorPlugin) GetClient() (cl Supervisor, err error)
func (*SupervisorPlugin) Run ¶
func (self *SupervisorPlugin) Run()
type SupervisorProcess ¶
type SupervisorProcess struct { Name string `xmlrpc:"name"` Group string `xmlrpc:"group"` Start int64 `xmlrpc:"start"` Stop int64 `xmlrpc:"stop"` Now int64 `xmlrpc:"now"` State int `xmlrpc:"state"` StateName string `xmlrpc:"statename"` SpawnError string `xmlrpc:"spawnerr"` ExitStatus int `xmlrpc:"exitstatus"` StdOutLogFile string `xmlrpc:"stdout_logfile"` StdErrLogFile string `xmlrpc:"stderr_logfile"` Pid int64 `xmlrpc:"pid"` }
type SysctlItem ¶
func (SysctlItem) SortKey ¶
func (self SysctlItem) SortKey() string
type SysctlPlugin ¶
type SysctlPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func NewSysctlPollingMonitor ¶
func NewSysctlPollingMonitor(id ids.PluginID, ctx agent.AgentContext) *SysctlPlugin
NewSysctlPollingMonitor creates a /proc/sys parser polling on intervals
func (*SysctlPlugin) Run ¶
func (sp *SysctlPlugin) Run()
Run is where you implement your plugin logic
func (*SysctlPlugin) Sysctls ¶
func (sp *SysctlPlugin) Sysctls() (dataset agent.PluginInventoryDataset, err error)
type SysctlSubscriberPlugin ¶
type SysctlSubscriberPlugin struct { SysctlPlugin // contains filtered or unexported fields }
func NewSysctlSubscriberMonitor ¶
func NewSysctlSubscriberMonitor(id ids.PluginID, ctx agent.AgentContext) (*SysctlSubscriberPlugin, error)
NewSysctlSubscriberMonitor creates a /proc/sys parser, walking once the full path and then subscribing to changed FS events.
func (*SysctlSubscriberPlugin) EventsCh ¶
func (p *SysctlSubscriberPlugin) EventsCh() chan fsnotify.Event
deprecated, just for testing purposes
func (*SysctlSubscriberPlugin) Run ¶
func (p *SysctlSubscriberPlugin) Run()
Run is where you implement your plugin logic
type SystemdPlugin ¶
type SystemdPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*SystemdPlugin) Run ¶
func (self *SystemdPlugin) Run()
type SystemdService ¶
func (SystemdService) SortKey ¶
func (self SystemdService) SortKey() string
type SysvInitPlugin ¶
type SysvInitPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*SysvInitPlugin) Run ¶
func (self *SysvInitPlugin) Run()
type SysvService ¶
type SysvService struct { Name string `json:"id"` helpers.ServiceDetails }
func (SysvService) SortKey ¶
func (self SysvService) SortKey() string
type UpstartPlugin ¶
type UpstartPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*UpstartPlugin) Run ¶
func (up *UpstartPlugin) Run()
type UpstartService ¶
func (UpstartService) SortKey ¶
func (us UpstartService) SortKey() string
type UsersPlugin ¶
type UsersPlugin struct { agent.PluginCommon // contains filtered or unexported fields }
func (*UsersPlugin) Run ¶
func (self *UsersPlugin) Run()