这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions templates/app/systemd/template_app_systemd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ zabbix_export:
tags:
- tag: scope
value: notice
- uuid: d411b9e00d3e4564b2f3bac714555028
name: '{#UNIT.NAME}: Inactive time'
type: DEPENDENT
key: 'systemd.service.downtime["{#UNIT.NAME}"]'
delay: '0'
value_type: FLOAT
units: s
description: 'Number of seconds since unit entered the inactive state.'
preprocessing:
- type: JAVASCRIPT
parameters:
- |
data = JSON.parse(value);
if (data.InactiveEnterTimestamp > data.InactiveExitTimestamp) {
return Math.floor(Date.now() / 1000) - Number(data.InactiveEnterTimestamp) / 1000000;
}
return null;
master_item:
key: 'systemd.unit.get["{#UNIT.NAME}"]'
tags:
- tag: component
value: service
- uuid: bdb94d1182114985a8734de7d5d92380
name: '{#UNIT.NAME}: Get unit info'
key: 'systemd.unit.get["{#UNIT.NAME}"]'
Expand Down