getScripts method
This commit is contained in:
@@ -37,6 +37,21 @@ export interface ZabbixRequestResponse {
|
||||
data?: JSONRPCResponse<any>;
|
||||
}
|
||||
|
||||
export type ZabbixAPIResponse<T> = T;
|
||||
export type ZabbixAPIResponse<T> = Promise<T>;
|
||||
|
||||
export type APILoginResponse = string;
|
||||
|
||||
export interface ZBXScript {
|
||||
scriptid: string;
|
||||
name?: string;
|
||||
command?: string;
|
||||
host_access?: string;
|
||||
usrgrpid?: string;
|
||||
groupid?: string;
|
||||
description?: string;
|
||||
confirmation?: string;
|
||||
type?: string;
|
||||
execute_on?: string;
|
||||
}
|
||||
|
||||
export type APIScriptGetResponse = ZabbixAPIResponse<ZBXScript[]>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as utils from '../../../utils';
|
||||
import { ZabbixAPICore } from './zabbixAPICore';
|
||||
import { ZBX_ACK_ACTION_NONE, ZBX_ACK_ACTION_ACK, ZBX_ACK_ACTION_ADD_MESSAGE, MIN_SLA_INTERVAL } from '../../../constants';
|
||||
import { ShowProblemTypes, ZBXProblem } from '../../../types';
|
||||
import { JSONRPCRequestParams } from './types';
|
||||
import { JSONRPCRequestParams, APIScriptGetResponse } from './types';
|
||||
|
||||
const DEFAULT_ZABBIX_VERSION = '3.0.0';
|
||||
|
||||
@@ -664,6 +664,15 @@ export class ZabbixAPIConnector {
|
||||
|
||||
return this.request('proxy.get', params);
|
||||
}
|
||||
|
||||
getScripts(hostids: string[], options?: any): APIScriptGetResponse {
|
||||
const params: any = {
|
||||
output: 'extend',
|
||||
hostids,
|
||||
};
|
||||
|
||||
return this.request('script.get', params);
|
||||
}
|
||||
}
|
||||
|
||||
function filterTriggersByAcknowledge(triggers, acknowledged) {
|
||||
|
||||
Reference in New Issue
Block a user