zabbix-utils
Version:
TypeScript port of zabbix-utils - Python library for working with Zabbix API, Sender, and Getter protocols
65 lines • 2.51 kB
TypeScript
import * as net from 'net';
import { TrapperResponse, ItemValue } from './types';
export declare class Sender {
/**
* Zabbix sender synchronous 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 socketWrapper - Function to wrap socket. 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 socketWrapper?;
private clusters;
constructor(options?: {
server?: string;
port?: number;
useConfig?: boolean;
timeout?: number;
useIpv6?: boolean;
sourceIp?: string;
chunkSize?: number;
clusters?: string[][];
socketWrapper?: (conn: net.Socket, tls: Record<string, string>) => net.Socket;
compression?: boolean;
configPath?: string;
});
private readConfig;
private loadConfig;
private getResponse;
private createRequest;
private sendToCluster;
private chunkSend;
/**
* Sends packets 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 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=sender.d.ts.map