zabbix/templates/applications/minidlna/6.0/minidlna_by_http.yaml

341 lines
11 KiB
YAML
Raw Normal View History

2023-09-09 20:24:59 +03:00
zabbix_export:
version: '6.0'
date: '2023-09-09T17:00:00Z'
groups:
-
uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
name: Templates/Applications
templates:
-
uuid: d0ccd623f0534ff886bf14b4df9aef0e
template: 'MiniDLNA by HTTP'
name: 'MiniDLNA by HTTP'
groups:
-
name: Templates/Applications
items:
-
uuid: ac1b5ca61f114dd09961d763a601c53a
name: 'MiniDLNA: Audio files'
type: DEPENDENT
key: minidlna.audio_files
delay: '0'
description: 'Amount of audio files'
preprocessing:
-
type: JSONPATH
parameters:
- $.audio_files
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
uuid: b28dab5c0ea84f7a892e061dbd4b8f51
name: 'MiniDLNA: Clients amount'
type: DEPENDENT
key: minidlna.clients_num
delay: '0'
description: 'Amount of clients'
preprocessing:
-
type: JSONPATH
parameters:
- $.clients_num
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
uuid: eed1cf5217164710bc1c428fb6a0e193
name: 'MiniDLNA: Get status'
type: HTTP_AGENT
key: minidlna.get_status
history: 1h
trends: '0'
value_type: TEXT
description: 'Converted MiniDLNA status to JSON'
preprocessing:
-
type: JAVASCRIPT
parameters:
- |
// Convert MiniDLNA status to JSON
var clients_raw = [];
var clients_arr = [];
var clients_num = 0;
// Get all clients
clients_raw = value.split('<tr><td>ID</td><td>Type</td><td>IP Address</td><td>HW Address</td><td>Connections</td></tr>')[1].split('</table>')[0].split(/<tr><td>\d<\/td><td>/);
clients_raw.shift()
// Parse clients
for (var i = 0; i < clients_raw.length; i++) {
if (clients_raw[i] !== null) {
var client_raw = clients_raw[i].split('</td></tr>')[0]
var client = {
ip_address: client_raw.split('</td><td>')[1],
hw_address: client_raw.split('</td><td>')[2],
connections: parseInt(client_raw.split('</td><td>')[3])
};
clients_arr.push(client);
clients_num++;
}
}
// Prepare output
var output = {
bin_version: value.split('<TITLE>')[1].split('</TITLE>')[0].split(' ')[1],
audio_files: parseInt(value.split('<tr><td>Audio files</td><td>')[1].split('</td></tr>')[0]),
video_files: parseInt(value.split('<tr><td>Video files</td><td>')[1].split('</td></tr>')[0]),
image_files: parseInt(value.split('<tr><td>Image files</td><td>')[1].split('</td></tr>')[0]),
clients_num: parseInt(clients_num),
data: clients_arr
};
// Return JSON string
return JSON.stringify(output);
url: '{$MINIDLNA.STATUS.SCHEME}://{HOST.CONN}:{$MINIDLNA.STATUS.PORT}'
tags:
-
tag: Application
value: minidlna
-
tag: component
value: raw
-
uuid: e05aae11c3d74157a78422733da21486
name: 'MiniDLNA: Image files'
type: DEPENDENT
key: minidlna.image_files
delay: '0'
description: 'Amount of image files'
preprocessing:
-
type: JSONPATH
parameters:
- $.image_files
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
uuid: b4de3ddd3b9347fd9496bcb11d6abd6c
name: 'MiniDLNA: Version'
type: DEPENDENT
key: minidlna.version
delay: '0'
history: 7d
trends: '0'
value_type: CHAR
description: 'Service version'
preprocessing:
-
type: JSONPATH
parameters:
- $.bin_version
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
uuid: 58d98974b2164f1ab9c9db8b5dd4e235
name: 'MiniDLNA: Video files'
type: DEPENDENT
key: minidlna.video_files
delay: '0'
description: 'Amount of video files'
preprocessing:
-
type: JSONPATH
parameters:
- $.video_files
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
uuid: 08f1de5f34584f99a3d4f4672f0f6459
name: 'MiniDLNA: Service ping'
type: SIMPLE
key: 'net.tcp.service[{$MINIDLNA.STATUS.SCHEME},"{HOST.CONN}","{$MINIDLNA.STATUS.PORT}"]'
history: 7d
tags:
-
tag: Application
value: minidlna
-
tag: component
value: health
triggers:
-
uuid: a0d3475de9004a98aee62338a881656e
expression: 'last(/MiniDLNA by HTTP/net.tcp.service[{$MINIDLNA.STATUS.SCHEME},"{HOST.CONN}","{$MINIDLNA.STATUS.PORT}"])=0'
name: 'MiniDLNA: Service is down'
priority: AVERAGE
manual_close: 'YES'
tags:
-
tag: Application
value: minidlna
-
tag: scope
value: availability
discovery_rules:
-
uuid: 4cb5ba7f8f114923a40e9329f70cd398
name: 'Clients discovery'
type: DEPENDENT
key: minidlna.clients.discovery
delay: '0'
description: 'The discovery of clients'
item_prototypes:
-
uuid: 80f0a4c297124d0daa0f8aa8a67da8b0
name: 'MiniDLNA client "{#MINIDLNA_CLIENT_IPADDR}" connections'
type: DEPENDENT
key: 'minidlna.client.connections[{#MINIDLNA_CLIENT_IPADDR}]'
delay: '0'
history: 14d
description: 'Number of connections from client'
preprocessing:
-
type: JSONPATH
parameters:
- '$.data.[?(@.ip_address=="{#MINIDLNA_CLIENT_IPADDR}")].connections.first()'
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
tag: 'MiniDLNA client'
value: '{#MINIDLNA_CLIENT_IPADDR}'
-
uuid: 4b17636e80314c689375d07ee400be87
name: 'MiniDLNA client "{#MINIDLNA_CLIENT_IPADDR}" MAC address'
type: DEPENDENT
key: 'minidlna.client.hw_address[{#MINIDLNA_CLIENT_IPADDR}]'
delay: '0'
history: 14d
trends: '0'
value_type: CHAR
preprocessing:
-
type: JSONPATH
parameters:
- '$.data.[?(@.ip_address=="{#MINIDLNA_CLIENT_IPADDR}")].hw_address.first()'
master_item:
key: minidlna.get_status
tags:
-
tag: Application
value: minidlna
-
tag: 'MiniDLNA client'
value: '{#MINIDLNA_CLIENT_IPADDR}'
graph_prototypes:
-
uuid: 0ae432fabda0492cb27e946614d13d2d
name: 'MiniDLNA client "{#MINIDLNA_CLIENT_IPADDR}" connections'
graph_items:
-
color: 0080FF
item:
host: 'MiniDLNA by HTTP'
key: 'minidlna.client.connections[{#MINIDLNA_CLIENT_IPADDR}]'
master_item:
key: minidlna.get_status
lld_macro_paths:
-
lld_macro: '{#MINIDLNA_CLIENT_IPADDR}'
path: $..ip_address.first()
-
lld_macro: '{#MINIDLNA_CLIENT_HWADDR}'
path: $..hw_address.first()
-
lld_macro: '{#MINIDLNA_CLIENT_CONNECTIONS}'
path: $..connections.first()
tags:
-
tag: Application
value: minidlna
macros:
-
macro: '{$MINIDLNA.STATUS.PORT}'
value: '8200'
-
macro: '{$MINIDLNA.STATUS.SCHEME}'
value: http
dashboards:
-
uuid: 2f2247d32fc34e8ab9a9911175f40933
name: MiniDLNA
auto_start: 'NO'
pages:
-
widgets:
-
type: ITEM
width: '4'
hide_header: 'YES'
fields:
-
type: ITEM
name: itemid
value:
host: 'MiniDLNA by HTTP'
key: minidlna.audio_files
-
type: ITEM
x: '4'
width: '4'
hide_header: 'YES'
fields:
-
type: ITEM
name: itemid
value:
host: 'MiniDLNA by HTTP'
key: minidlna.image_files
-
type: ITEM
x: '8'
width: '4'
hide_header: 'YES'
fields:
-
type: ITEM
name: itemid
value:
host: 'MiniDLNA by HTTP'
key: minidlna.video_files
-
type: GRAPH_PROTOTYPE
x: '12'
width: '12'
height: '5'
fields:
-
type: INTEGER
name: columns
value: '1'
-
type: GRAPH_PROTOTYPE
name: graphid
value:
host: 'MiniDLNA by HTTP'
name: 'MiniDLNA client "{#MINIDLNA_CLIENT_IPADDR}" connections'