forked from prometheus/snmp_exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
generator.apc.yml
267 lines (246 loc) · 7.78 KB
/
generator.apc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# This is a configuration file for the
# https://github.com/jelmd/snmp-export/tree/main/generator
# (C) 2022 by Jens Elkner (jel+snmpex@cs.uni-magdeburg.de)
#
# To translate it into a YAML spec conforming file, you need to pass it through
# https://github.com/jelmd/snakeyaml - this is a modified YAML file parser,
# which allows duplicated keys and in turn does what most normal people would
# do: merge its contents into a single basket and throw away the now redundant
# basket.
# Queries:
# curl -s 'http://localhost:9116/snmp?module=surtxli_with_env&compact&target=surtxli-a'
# no iem query -> saves a lot of time (~0.5s)
# curl -s 'http://localhost:9116/snmp?module=surtxli_no_env&compact&target=surtxli-b'
# curl -s 'http://localhost:9116/snmp?module=ats&compact&target=ats'
modules:
global_vars:
prefix: &prefix apc
surtxli_template:
walk: &surtxli_walk
- sysObjectID # 1.3.6.1.2.1.1.2
- sysUpTime # 1.3.6.1.2.1.1.3
- snmpInPkts # 1.3.6.1.2.1.11.1
- snmpOutPkts # 1.3.6.1.2.1.11.2
#- upsConfigOutputVA # 1.3.6.1.2.1.33.1.9.5 unreliable
- upsAdvInputLineFailCause # # Last Battery Transfer
- upsBasicIdentModel
- upsBasicBatteryStatus
- upsBasicBatteryTimeOnBattery # [100 Hz]
- upsBasicInputPhase
- upsBasicOutputPhase
- upsBasicOutputStatus
- upsHighPrecBatteryCapacity # Capacity [%]
- upsHighPrecBatteryTemperature # Internal Temperature [°cC]
- upsHighPrecBatteryActualVoltage # Battery Voltage [VDC]
- upsHighPrecInputLineVoltage # Input Voltage [VAC]
- upsHighPrecInputFrequency # Input Frequency [Hz]
# evtl. raus - bzgl. letzter 1 min
- upsHighPrecInputMaxLineVoltage
- upsHighPrecInputMinLineVoltage
# 4a, 4b
- upsHighPrecInputBypassVoltage # Bypass Input Voltage [VAC]
- upsHighPrecInputBypassFrequency # Frequency [Hz]
- upsHighPrecOutputVoltage # Output Voltage [VAC]
- upsHighPrecOutputFrequency # Frequency [Hz]
- upsHighPrecOutputLoad # 1a,1b,3b,4a,4b: Apparent Load Power [% VA]
# 3a: Load Power [% W]
- upsHighPrecOutputCurrent # Load Current [cA]
- upsAdvConfigRatedOutputVoltage
- upsAdvConfigHighTransferVolt
- upsAdvConfigLowTransferVolt
lookups: &surtxli_lookups
- source_indexes: []
lookup: upsBasicIdentModel
mprefix: [upsBasicIdentModel]
rename: name
overrides: &surtxli_overrides
sysUpTime: &sysUpTime_override
type: uptime
regex_extracts:
.boot_time:
- regex: '(.*)'
value: '$1'
sysObjectID:
remap: # because upsConfigOutputVA is unreliable or n/a on some NMCs
'1.3.6.1.4.1.318.1.3.27': 8000 # smartUPS2
'1.3.6.1.4.1.318.1.3.2.19': 8000 # smartUPS8000
'1.3.6.1.4.1.318.1.3.2.15': 10000 # smartUPS10000
rename:
- sub_oids: '.*'
value: apc_upsConfigOutputVA
upsBasicIdentModel:
regex_extracts:
'':
- regex: '.*'
value: '1'
surtxli_no_env: # 4b
prefix: *prefix
walk: *surtxli_walk
lookups: *surtxli_lookups
overrides:
<<: *surtxli_overrides
surtxli_with_env: # 4a, 3a, 3b
prefix: *prefix
walk: *surtxli_walk
overrides:
<<: *surtxli_overrides
lookups: *surtxli_lookups
walk:
- iemStatusProbeCurrentTemp # Integrated Temp.: ca. 0.5+-0.1s !!! [°cC]
#- iemStatusProbeCurrentHumid
lookups:
- source_indexes: [iemStatusProbeNumber]
lookup: _dummy
drop_source_indexes: true
ats_template:
walk: &ats_gets # tables n/a
- sysUpTime # 1.3.6.1.2.1.1.3
- snmpInPkts # 1.3.6.1.2.1.11.1
- snmpOutPkts # 1.3.6.1.2.1.11.2
- atsIdentModelNumber # AP*
- atsConfigPreferredSource # SourceNum
- atsStatusSelectedSource # SourceNum
- atsStatusRedundancyState # [1:atsRedundancyLost,2:atsFullyRedundant]
- atsStatusSwitchStatus # [1:fail, 2:ok]
- atsStatusSourceAStatus # [1:fail, 2:ok]
- atsStatusSourceBStatus # [1:fail, 2:ok]
- atsStatusPhaseSyncStatus # [1:inSync, 2:outOfSync]
- atsStatusVoltageOutStatus # [1:fail, 2:ok]
- atsStatusHardwareStatus # [1:fail, 2:ok]
walk: &ats_walk
# atsInputTable
- atsInputFrequency # [Hz]
# atsInputPhaseTable
- atsInputVoltage # [VAC]
# atsOutputTable
- atsOutputFrequency # [Hz]
# atsOutputPhaseTable
- atsOutputVoltage # [V]
- atsOutputCurrent # [cA]
- atsOutputLoad # [VA]
- atsOutputPower # [W]
- atsOutputPercentLoad # [%]
- atsOutputPercentPower # [%]
- atsOutputPhaseState # [1:normal,2:lowload,3:nearoverld,4:overld]
lookups: &ats_lookups
- source_indexes: [atsInputTableIndex]
lookup: atsInputName
mprefix: [atsInputFreq]
rename: source
revalue:
regex: 'Source ([AB])'
value: '$1'
- source_indexes: [atsInputPhaseTableIndex]
lookup: atsInputName
mprefix: [atsInputVolt]
rename: source
revalue:
regex: 'Source ([AB])'
value: '$1'
- source_indexes: [atsOutputPhaseTableIndex]
lookup: _dummy
mprefix: [atsOutput]
drop_source_indexes: true
- source_indexes: []
lookup: atsIdentModelNumber
mprefix: [atsIdentModelNumber]
rename: name
overrides: &ats_overrides
sysUpTime:
<<: *sysUpTime_override
# atsInputTable
atsInputCurrent:
ignore: true
atsInputName:
ignore: true
atsInputTableIndex:
ignore: true
atsInputType:
ignore: true
atsInputVoltageOrientation:
ignore: true
atsNumInputPhases:
ignore: true
# atsInputPhaseTable
atsInputMaxCurrent:
ignore: true
atsInputMaxPower:
ignore: true
atsInputMaxVoltage:
ignore: true
atsInputMinCurrent:
ignore: true
atsInputMinPower:
ignore: true
atsInputMinVoltage:
ignore: true
atsInputPhaseIndex:
ignore: true
atsInputPhaseTableIndex:
ignore: true
atsInputPower:
ignore: true
# atsOutputTable
atsOutputTableIndex:
ignore: true
atsNumOutputPhases:
ignore: true
atsOutputVoltageOrientation:
ignore: true
# atsOutputPhaseTable
atsOutputPhaseTableIndex:
ignore: true
atsOutputPhaseIndex:
ignore: true
atsOutputMaxCurrent:
ignore: true
atsOutputMinCurrent:
ignore: true
atsOutputMaxLoad:
ignore: true
atsOutputMinLoad:
ignore: true
atsOutputMaxPercentLoad:
ignore: true
atsOutputMinPercentLoad:
ignore: true
atsOutputMaxPower:
ignore: true
atsOutputMinPower:
ignore: true
atsOutputMaxPercentPower:
ignore: true
atsOutputMinPercentPower:
ignore: true
# drop n/a stats
atsOutputLoad:
remap:
'-1': '@drop@'
atsOutputPercentLoad:
remap:
'-1': '@drop@'
# normalize Load
atsOutputCurrent:
regex_extracts:
'':
- regex: '([0-9])*([0-9])'
value: '$1.$2'
atsIdentModelNumber:
regex_extracts:
'':
- regex: '.*'
value: '1'
# ATS snmp is awefully slow, so pull intervall should be min. 2s, better 3+s
ats:
prefix: *prefix
walk: *ats_gets
walk: #*ats_walk
- atsInputTable
- atsInputPhaseTable
- atsOutputTable
- atsOutputPhaseTable
lookups: *ats_lookups
overrides:
<<: *ats_overrides
walk:
- _dummy