Fix handling value mappings for ItemID mode, fix #1148
This commit is contained in:
@@ -69,7 +69,7 @@ function downsample(datapoints, time_to, ms_interval, func) {
|
|||||||
* Detects interval between data points and aligns time series. If there's no value in the interval, puts null as a value.
|
* Detects interval between data points and aligns time series. If there's no value in the interval, puts null as a value.
|
||||||
*/
|
*/
|
||||||
export function align(datapoints: TimeSeriesPoints, interval?: number): TimeSeriesPoints {
|
export function align(datapoints: TimeSeriesPoints, interval?: number): TimeSeriesPoints {
|
||||||
if (interval) {
|
if (!interval) {
|
||||||
interval = detectSeriesInterval(datapoints);
|
interval = detectSeriesInterval(datapoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ export function convertZabbixUnit(zabbixUnit: string): string {
|
|||||||
|
|
||||||
export function getValueMapping(item, valueMappings: any[]): ValueMapping[] | null {
|
export function getValueMapping(item, valueMappings: any[]): ValueMapping[] | null {
|
||||||
const { valuemapid } = item;
|
const { valuemapid } = item;
|
||||||
const mapping = valueMappings.find(m => m.valuemapid === valuemapid);
|
const mapping = valueMappings?.find(m => m.valuemapid === valuemapid);
|
||||||
if (!mapping) {
|
if (!mapping) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,11 +204,15 @@ export class ZabbixAPIConnector {
|
|||||||
const params = {
|
const params = {
|
||||||
itemids: itemids,
|
itemids: itemids,
|
||||||
output: [
|
output: [
|
||||||
'name', 'key_',
|
'name',
|
||||||
|
'key_',
|
||||||
'value_type',
|
'value_type',
|
||||||
'hostid',
|
'hostid',
|
||||||
'status',
|
'status',
|
||||||
'state'
|
'state',
|
||||||
|
'units',
|
||||||
|
'valuemapid',
|
||||||
|
'delay'
|
||||||
],
|
],
|
||||||
webitems: true,
|
webitems: true,
|
||||||
selectHosts: ['hostid', 'name']
|
selectHosts: ['hostid', 'name']
|
||||||
|
|||||||
Reference in New Issue
Block a user