UNPKG

zabbix-utils

Version:

TypeScript port of zabbix-utils - Python library for working with Zabbix API, Sender, and Getter protocols

65 lines 2.54 kB
import * as tls from 'tls'; import { TrapperResponse, ItemValue } from './types'; export declare class AsyncSender { /** * Zabbix sender asynchronous implementation. * * @param server - Zabbix server address. Defaults to '127.0.0.1'. * @param port - Zabbix server port. Defaults to 10051. * @param useConfig - Specifying configuration use. Defaults to false. * @param timeout - Connection timeout value. Defaults to 10. * @param useIpv6 - Specifying IPv6 use instead of IPv4. Defaults to false. * @param sourceIp - IP from which to establish connection. Defaults to null. * @param chunkSize - Number of packets in one chunk. Defaults to 250. * @param clusters - List of Zabbix clusters. Defaults to null. * @param sslContext - Function to create SSL context. Defaults to null. * @param compression - Specifying compression use. Defaults to false. * @param configPath - Path to Zabbix agent configuration file. */ private timeout; private useIpv6; private tls; private sourceIp?; private chunkSize; private compression; private sslContext?; private clusters; constructor(options?: { server?: string; port?: number; useConfig?: boolean; timeout?: number; useIpv6?: boolean; sourceIp?: string; chunkSize?: number; clusters?: string[][]; sslContext?: (tlsConfig: Record<string, string>) => tls.SecureContext; compression?: boolean; configPath?: string; }); private readConfig; private loadConfig; private getResponse; private createRequest; private sendToCluster; private chunkSend; /** * Sends packets asynchronously and receives an answer from Zabbix. * * @param items - List of ItemValue objects. * @returns Response from Zabbix server/proxy. */ send(items: ItemValue[]): Promise<TrapperResponse>; /** * Sends one value asynchronously and receives an answer from Zabbix. * * @param host - Host name the item belongs to. * @param key - Item key to send value to. * @param value - Item value. * @param clock - Time in Unix timestamp format. Defaults to current time. * @param ns - Time expressed in nanoseconds. Defaults to undefined. * @returns Response from Zabbix server/proxy. */ sendValue(host: string, key: string, value: string, clock?: number, ns?: number): Promise<TrapperResponse>; } //# sourceMappingURL=aiosender.d.ts.map