Documentation ¶
Index ¶
Constants ¶
const ( // MsgNotSupported - error message from zabbix agent MsgNotSupported = "ZBX_NOTSUPPORTED" // UserDefault is a default username wich set as UID UserDefault = "zabbix" // GroupDefault is a default group wich set as GID GroupDefault = "zabbix" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct { // This field indicates for ability to retrieve data from instance endpoint. // If true - data successfully retrieved from from cache file (if it's actual) or exeporter without any errors. // If false - some errors occurs while processing data retrieve (from cache or exporter) InstanceAlive bool `yaml:"instance_alive"` // This field contains data was obtained from cache (if it's actual) or exporter. Data []byte `yaml:"data"` }
Cache contains data cache
type CheckAliveFunc ¶
CheckAliveFunc defines the process to check alive for specified instance.
type CheckConfFunc ¶
CheckConfFunc defines the process to check config for syntax errors, instances duplicates, etc.
type DiscoveryFunc ¶
DiscoveryFunc defines the process to service discovery. This function must return the slice of elements to be sent to Zabbix server to automatically create items, triggers, and graphs for different entities.
type ExporterFunc ¶
ExporterFunc defines the process to obtain all the needed data from monitored service. Usually this function automatically called from cache process, when the cache data is outdated, or from `MetricFunc` when cache disabled.
type MetricFunc ¶
MetricFunc defines the process to obtain specified metric
type Settings ¶
type Settings struct { // Directory path to save instances cache CacheRoot string // Cache TTL in seconds CacheTTL float64 // Whether or not to check user and group of running application CheckGUIDDisable bool // User to SUID. Available only for root User string // Group to SGID. Available only for root Group string // See functions description above for details DiscoveryAction DiscoveryFunc CheckConfAction CheckConfFunc CheckAliveAction CheckAliveFunc MetricAction MetricFunc Exporter ExporterFunc // contains filtered or unexported fields }
Settings is struct to store settings
func (*Settings) CacheGet ¶
CacheGet retrieves data either from cache file if it's actual, or from exporter if cache rotted (in this case cache will be updated) If cache processing fails by any reasons, `InstanceAlive` field will be set to false. If `forceUpdate` argument is true, cache will be force updated.
func (*Settings) DebugPrint ¶
DebugPrint prints the message if debug toggle true