forked from luizluca/nut-snmpagent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnmp.nut
executable file
·2651 lines (2604 loc) · 106 KB
/
snmp.nut
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/ruby -w
#
# Wrapper to convert NUT information into SNMP
#
# Author: Luiz Angelo Daros de Luca <[email protected]>
# Created: 2009-12-10
#
# This is a script wrapper that translate the output of upsc
# comand into a SNMP agent (pass_persist). This code use
# The NUT.mib, converted into xml with (smidump -f xml) and
# a lot of metaprogramming to do the job.
#
# How to use:
#
# TODO: get a IANA number for NUT
#
# /etc/snmp/snmpd.conf
# pass_persist .1.3.6.1.4.1.26376.99 /my/path/to/snmp.nut
#
#
# What is missing:
# - I ignored the driver parameters.
#
# What I found of docs problem:
# - Missing field: driver.version.data
# - Wrong description of power.minimum Maximum seen apparent power (VA)
#
# MAYBE
# - use set for ups comands like load.off
#
require "thread"
require "snmppass"
require "cached_method"
require "orderedhash" if RUBY_VERSION<"1.9"
# I'm the first part specific to NUT. I implement the missing parts that GenericWithMib
# expects to call with upsc command results. I use a lot of metaprogramming for this job.
class Nut < SNMPPass::GenericWithMib
attr_reader :upsc
def initialize(mibxml)
super(mibxml)
implement_methods
@upsc=CachedUpsc.new
end
# Goes through the columns and implement the missing methods, if not
# already implemented "by hand"
def implement_methods
self.columns.each do|table_name,columns|
meta=""
if not self.respond_to? table_name
# Non-special tables just uses the same indexes as deviceTable
meta=<<-EOM
def #{table_name}
nutDeviceTable
end
EOM
end
columns.each do
|(column_name,_,_)|
if not self.respond_to? column_name
$DEBUG.puts "Defining #{column_name}(*indexes)"
meta+=<<-EOM
def #{column_name}(*indexes)
$DEBUG.puts "Running #{column_name}(\#{indexes.inspect})"
prop_names=mibname2prop("#{column_name}",*indexes)
prop_names=[prop_names] if not prop_names.kind_of? Array
nutDeviceIndex=indexes.first
prop_names.each { |prop_name|
value=upsc[nutDeviceName(nutDeviceIndex),prop_name]
return parse_property("#{column_name}",value) if not value==nil
}
return nil
end
EOM
end
end
eval meta
end
end
# Maps the mib object names into the upsc property.
# There is some hacks here in order to match the correct
# field. It also might receive indexes if the object is inside a table
def mibname2prop(name,*indexes)
name.sub!(/^nut/,"")
#parts=[name.sub(/([a-z]+).*/,"\\1")]
parts=[]
name.to_s.scan(/[A-Z][a-z]+/) {|tok| parts << tok.downcase }
case parts.first
when "outlet"
raise "Invalid outlet size. Should be 2, got: #{indexes.inspect}" if not indexes.size == 2
(deviceIndex, outletIndex)=indexes
# HACK: outlet.0. might also be outlet.
if outletIndex.to_s=="0"
props=[parts.join(".")]
parts.insert(1,"#{outletIndex}")
props << parts.join(".")
return props
end
parts.insert(1,"#{outletIndex}")
when "threephase"
raise "Invalid threephase size. Should be 4, got: #{indexes.inspect}" if not indexes.size == 4
(deviceIndex, threephaseDomain, threephaseSubDomain, threephaseContext)=indexes
domain=@enums["nutThreephaseDomain"].invert[threephaseDomain.to_s]
subdomain=@enums["nutThreephaseSubdomain"].invert[threephaseSubDomain.to_s]
context=@enums["nutThreephaseContext"].invert[threephaseContext.to_s]
context=mib_context2upsc_context(context)
parts[0]=domain
parts.insert(1,context) if not context=="NONE"
# HACK: input.mains. is input.
# HACK: output.load is output.
parts.insert(1,subdomain) if not ["mains","load"].include?(subdomain)
end
return parts.join(".")
end
def mib_context2upsc_context(context)
context.sub(/([0-9])([ln])/,"\\1-\\2").upcase
end
def upsc_context2mib_context(context)
context.sub(/-/,"").downcase
end
# Some values can come in a string form like (yes/no,on/off,
# servicebypass/bypass/...). Convert them using the MIB information
def parse_property(name,value)
return value if not @enums.include?(name) or not @enums[name].include?(value)
@enums[name][value]
end
SERVER="!"
def nutServerInfo
upsc[SERVER,"server.info"]
end
def nutServerVersion
upsc[SERVER,"server.version"]
end
# Device table depends on the number of ups returned bu upsc -L
def nutDeviceTable
(1..upsc.devices.size).to_a
end
def nutDeviceIndex(deviceIndex)
deviceIndex
end
def nutDeviceName(deviceIndex)
(name,_)=upsc.devices.to_a[deviceIndex-1]
name
end
def nutDeviceDesc(deviceIndex)
(_,desc)=upsc.devices.to_a[deviceIndex-1]
desc
end
# In order to the the amount of outlets, I need to parse the upsc command
def nutOutletTable
idx=nutDeviceTable.collect do
|dev_id|
dev_name = nutDeviceName(dev_id)
upsc.properties(dev_name).
collect {|prop| prop.split(".") }.
select {|parts| parts[0] == "outlet" }.
# HACK: outlet.0 is also outlet.
collect {|parts| parts[1]="0" if not parts[1] =~ /^[0-9]+$/; parts}.
collect {|parts| parts[1].to_i }.uniq.sort.
collect {|outlet_id| [dev_id, outlet_id] }
end.inject([],:+)
idx
end
def nutOutletIndex(deviceIndex, outletIndex)
outletIndex
end
# In order to the the threephase context and domains avaiable, I need to parse
# the upsc command
def nutThreephaseTable
nutDeviceTable.collect do
|dev_id|
indexes_for_device=[]
isInputThreephase=nutInputPhases(dev_id)=="3"
isOutputThreephase=nutOutputPhases(dev_id)=="3"
if isInputThreephase or isOutputThreephase
# Select only properties about domains
properties=upsc.properties(nutDeviceName(dev_id)).
collect{|prop| prop.split(".")}.
select {|prop| @enums["nutThreephaseDomain"].include?(prop.first) }.
reject {|prop| prop[1] == "phases"}
@enums["nutThreephaseDomain"].each do
|(domain, domain_id)|
domain_properties=properties.select {|prop| prop[0] == domain }
next if domain_properties.empty?
case domain
when "input"
absent_subdomain="mains"
when "output"
absent_subdomain="load"
end
domain_properties=domain_properties.
collect {|prop| @enums["nutThreephaseSubdomain"].include?(prop[1]) ? prop : prop.dup.insert(1,absent_subdomain) }
@enums["nutThreephaseSubdomain"].each do
|(subdomain, subdomain_id)|
subdomain_properties=domain_properties.
select {|prop| prop[1] == subdomain }.
collect{|prop| prop=prop.dup;prop[2]=upsc_context2mib_context(prop[2]);prop }.
collect{|prop| @enums["nutThreephaseContext"].include?(prop[2])? prop : (prop=prop.dup;prop.insert(2,"none");prop) }
next if subdomain_properties.empty?
@enums["nutThreephaseContext"].each do
|(context, context_id)|
any_context_property=subdomain_properties.
detect {|prop| prop[2] == context }
next if not any_context_property
#$stderr.puts "#{any_context_property.inspect} = #{[dev_id, domain_id, subdomain_id, context_id].inspect}"
indexes_for_device << [dev_id, domain_id.to_i, subdomain_id.to_i, context_id.to_i]
end
end
end
end
#$stderr.puts "#{indexes_for_device}"
indexes_for_device
end.inject([],:+)
end
def nutThreephaseDomain(deviceIndex, threephaseDomainIndex, threephaseSubDomainIndex, threephaseContext)
threephaseDomainIndex
end
def nutThreephaseSubdomain(deviceIndex, threephaseDomainIndex, threephaseSubdomainIndex, threephaseContext)
threephaseSubdomainIndex
end
def nutThreephaseContext(deviceIndex, threephaseDomainIndex, threephaseSubDomainIndex, threephaseContext)
threephaseContext
end
class Upsc
def upsc(args)
res=`upsc #{args}`
raise "Command 'upsc #{args}' failed with error code #{$?}" if not $?==0
return res
end
def split(txt)
# The order is kept only on ruby>1.9. Not the correct check but it will work
# raise "Order kept only in ruby>1.9" if RUBY_VERSION<"1.9"
if RUBY_VERSION<"1.9"
OrderedHash[*txt.split("\n").collect {|line| line.split(": ",2) }.flatten]
else
Hash[*txt.split("\n").collect {|line| line.split(": ",2) }.flatten]
end
end
def [](device_name,name)
property(device_name,name)
end
def property(device_name,name)
if not device_name
txt=upsc(name)
else
txt=upsc("#{device_name} #{name}")
end
txt.chomp! if txt
return txt
end
def devices
split(upsc("-L"))
end
def device(name)
split(upsc(name))
end
def properties(name)
device(name).keys
end
end
# Cache values for a given cache_lifetime seconds
class CachedUpsc < Upsc
include CachedMethod
extend CachedMethod
def initialize
@cache=Hash.new
end
cache_method :devices, 60
cache_method :device, 60
# Use the device cache instead
def property(device_name,name)
return super(device_name,name) if device_name == SERVER
found=device(device_name).detect {|(prop,_)| prop==name }
return found.last if found
end
end
end
class FakeNut < Nut
class FakeUpsc < Upsc
def upsc(args)
case args
when "-L"
#return "ups3: test3"
return "ups2: UPS2 10 KVA Lacerda Titan Black tri-mono 10KVA (220v) Serial A08823221\nxxx: Fictious\nupsoutlet: Example outlet\nups3p1: phases1\nups3p2: phases2\nups3: test3"
when "xxx"
return "battery.charge: 30\nbattery.voltage: 273.60\nbattery.voltage.high: 250\nbattery.voltage.low: 210\nbattery.voltage.nominal: 240.0\nbeeper.status: enabled\ndevice.mfr: Lacerda Sistemas de Energia\ndevice.model: Titan Black tri-mono 10KVA\ndevice.serial: A08823221\ndevice.type: ups\ndriver.name: blazer_ser\ndriver.parameter.pollinterval: 2\ndriver.parameter.port: /dev/ttyUSB0\ndriver.version: 2.6.2\ndriver.version.internal: 1.51\ninput.current.nominal: 27.0\ninput.frequency: 60.0\ninput.frequency.nominal: 60\ninput.voltage: 215.0\ninput.voltage.fault: 215.0\ninput.voltage.nominal: 220\noutput.voltage: 221.0\nups.delay.shutdown: 30\nups.delay.start: 180\nups.load: 43\nups.status: OL\nups.temperature: 47.0\nups.type: online\n"
when "ups2"
return "battery.charge: 100\nbattery.voltage: 274.60\nbattery.voltage.high: 250\nbattery.voltage.low: 210\nbattery.voltage.nominal: 240.0\nbeeper.status: enabled\ndevice.mfr: Lacerda Sistemas de Energia\ndevice.model: Titan Black tri-mono 10KVA\ndevice.serial: A08823221\ndevice.type: ups\ndriver.name: blazer_ser\ndriver.parameter.pollinterval: 2\ndriver.parameter.port: /dev/ttyUSB0\ndriver.version: 2.6.2\ndriver.version.internal: 1.51\ninput.current.nominal: 27.0\ninput.frequency: 60.0\ninput.frequency.nominal: 60\ninput.voltage: 215.0\ninput.voltage.fault: 215.0\ninput.voltage.nominal: 220\noutput.voltage: 221.0\nups.delay.shutdown: 30\nups.delay.start: 180\nups.load: 43\nups.status: OL\nups.temperature: 47.0\nups.type: online\n"
when "upsoutlet"
return "outlet.0.desc: Main Outlet\noutlet.0.id: 0\noutlet.0.switchable: 1\noutlet.1.autoswitch.charge.low: 0\noutlet.1.delay.shutdown: -1\noutlet.1.delay.start: -1\noutlet.1.desc: PowerShare Outlet 1\noutlet.1.id: 1\noutlet.1.switch: 1\noutlet.1.switchable: 1\noutlet.2.autoswitch.charge.low: 0\noutlet.2.delay.shutdown: -1\noutlet.2.delay.start: -1\noutlet.2.desc: PowerShare Outlet 2\noutlet.2.id: 2\noutlet.2.switch: 1\noutlet.2.switchable: 1"
when "ups3p1"
return "input.phases: 3\ninput.frequency: 50.0\ninput.L1.current: 133.0\ninput.bypass.L1-L2.voltage: 398.3\noutput.phases: 3\noutput.L1.power: 35700\noutput.powerfactor: 0.82"
when "ups3p2"
return "input.phases: 3\ninput.L2.current: 48.2\ninput.N.current: 3.4\ninput.L3-L1.voltage: 405.4\ninput.frequency: 50.1\noutput.phases: 1\noutput.current: 244.2\noutput.voltage: 120\noutput.frequency.nominal: 60.0"
when "ups3"
return "battery.charge: 100\nbattery.charge.low: 20\nbattery.runtime: 2525\nbattery.type: PbAc\ndevice.mfr: EATON\ndevice.model: Ellipse MAX 1100\ndevice.serial: ADKK22008\ndevice.type: ups\ndriver.name: usbhid-ups\ndriver.parameter.pollfreq: 30\ndriver.parameter.pollinterval: 2\ndriver.parameter.port: auto\ndriver.version: 2.4.1-1988:1990M\ndriver.version.data: MGE HID 1.12\ndriver.version.internal: 0.34\ninput.sensitivity: normal\ninput.transfer.boost.low: 185\ninput.transfer.high: 285\ninput.transfer.low: 165\ninput.transfer.trim.high: 265\ninput.voltage.extended: no\noutlet.1.desc: PowerShare Outlet 1\noutlet.1.id: 2\noutlet.1.status: on\noutlet.1.switchable: no\noutlet.desc: Main Outlet\noutlet.id: 1\noutlet.switchable: no\noutput.frequency.nominal: 50\noutput.voltage: 230.0\noutput.voltage.nominal: 230\nups.beeper.status: enabled\nups.delay.shutdown: 20\nups.delay.start: 30\nups.firmware: 5102AH\nups.load: 0\nups.mfr: EATON\nups.model: Ellipse MAX 1100\nups.power.nominal: 1100\nups.productid: ffff\nups.serial: ADKK22008\nups.status: OL CHRG\nups.timer.shutdown: -1\nups.timer.start: -1\nups.vendorid: 0463"
when /^#{Nut::SERVER} /
case args
when / server\.info$/
return "serverinfo example"
when / server\.version$/
return "test server version"
end
when /[[:alnum:]]+ [[:alnum:]\.]+/
(name,target_prop)=args.split(" ")
found=split(upsc(name)).detect{|(prop,_)| prop==target_prop }
return found.last if found
end
nil
end
end
def initialize(mibxml)
super(mibxml)
@upsc=FakeUpsc.new
end
end
#FakeNut.start_embebedmib(ARGV)
Nut.start_embebedmib(ARGV)
__END__
<?xml version="1.0"?>
<!DOCTYPE smi SYSTEM "http://www.ibr.cs.tu-bs.de/projects/nmrg/smi.dtd">
<!-- This module has been generated by smidump 0.4.8. Do not edit. -->
<smi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ibr.cs.tu-bs.de/projects/nmrg/smi.xsd">
<module name="NUT-MIB" language="SMIv2">
<organization>
Network UPS Tools
</organization>
<contact>
Luiz Angelo Daros de Luca
E-mail: [email protected]
</contact>
<description>
The MIB module list information about local configured UPS
managed by NUT.
</description>
<revision date="2012-06-11 00:00">
<description>
First release
</description>
</revision>
<identity node="nutMIB"/>
</module>
<imports>
<import module="SNMPv2-SMI" name="MODULE-IDENTITY"/>
<import module="SNMPv2-SMI" name="OBJECT-TYPE"/>
<import module="SNMPv2-SMI" name="Integer32"/>
<import module="SNMPv2-SMI" name="enterprises"/>
<import module="SNMPv2-TC" name="DisplayString"/>
<import module="SNMPv2-TC" name="TEXTUAL-CONVENTION"/>
<import module="SNMPv2-CONF" name="MODULE-COMPLIANCE"/>
<import module="SNMPv2-CONF" name="OBJECT-GROUP"/>
</imports>
<typedefs>
<typedef name="NutDeviceIndexType" basetype="Integer32" status="current">
<range min="1" max="2147483647"/>
<format>d</format>
<description>
A unique value, greater than zero, for each device. It is
recommended that values are assigned contiguously starting
from 1.
</description>
</typedef>
<typedef name="NutOutletIndexType" basetype="Integer32" status="current">
<range min="0" max="2147483647"/>
<format>d</format>
<description>
A unique value, greater than or equal to zero, for each outlet. It is
recommended that values are assigned contiguously starting
from 1.
</description>
</typedef>
<typedef name="TenthInteger32" basetype="Integer32" status="current">
<format>d-1</format>
<description>
A Integer32 that represents a real number, with one decimal case. I.e.: 123 for 12.3
</description>
</typedef>
<typedef name="HundredthInteger32" basetype="Integer32" status="current">
<format>d-2</format>
<description>
A Integer32 that represents a real number, with two decimal case. I.e.: 123 for 1.23
</description>
</typedef>
</typedefs>
<nodes>
<node name="tresc" oid="1.3.6.1.4.1.26376">
</node>
<node name="nutMIB" oid="1.3.6.1.4.1.26376.99" status="current">
</node>
<node name="nutMIBObjects" oid="1.3.6.1.4.1.26376.99.1">
</node>
<table name="nutDeviceTable" oid="1.3.6.1.4.1.26376.99.1.1" status="current">
<description>
A list of device.
</description>
<row name="nutDeviceEntry" oid="1.3.6.1.4.1.26376.99.1.1.1" status="current">
<linkage>
<index module="NUT-MIB" name="nutDeviceIndex"/>
</linkage>
<description>
An entry containing information about a particular device.
</description>
<column name="nutDeviceIndex" oid="1.3.6.1.4.1.26376.99.1.1.1.1" status="current">
<syntax>
<type module="NUT-MIB" name="NutDeviceIndexType"/>
</syntax>
<access>noaccess</access>
<description>
A unique value, greater than zero, for each device
</description>
</column>
<column name="nutDeviceName" oid="1.3.6.1.4.1.26376.99.1.1.1.2" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
The name of the device.
</description>
</column>
<column name="nutDeviceDesc" oid="1.3.6.1.4.1.26376.99.1.1.1.3" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
A textual string containing information about the device.
</description>
</column>
<column name="nutDeviceModel" oid="1.3.6.1.4.1.26376.99.1.1.1.4" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Device model. I.e. BladeUPS.
</description>
</column>
<column name="nutDeviceMfr" oid="1.3.6.1.4.1.26376.99.1.1.1.5" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Device manufacturer. I.e. Eaton.
</description>
</column>
<column name="nutDeviceSerial" oid="1.3.6.1.4.1.26376.99.1.1.1.6" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Device serial number (opaque string). I.e. WS9643050926.
</description>
</column>
<column name="nutDeviceType" oid="1.3.6.1.4.1.26376.99.1.1.1.7" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Device type (ups, pdu, scd). I.e. ups.
</description>
</column>
</row>
</table>
<table name="nutUpsTable" oid="1.3.6.1.4.1.26376.99.1.2" status="current">
<description>
A list of ups.
</description>
<row name="nutUpsEntry" oid="1.3.6.1.4.1.26376.99.1.2.1" status="current">
<linkage>
<index module="NUT-MIB" name="nutDeviceIndex"/>
</linkage>
<description>
An entry containing information about a particular ups.
</description>
<column name="nutUpsStatus" oid="1.3.6.1.4.1.26376.99.1.2.1.1" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS status. I.e. OL.
</description>
</column>
<column name="nutUpsAlarm" oid="1.3.6.1.4.1.26376.99.1.2.1.2" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS alarms. I.e. OVERHEAT.
</description>
</column>
<column name="nutUpsTime" oid="1.3.6.1.4.1.26376.99.1.2.1.3" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Internal UPS clock time (opaque string). I.e. 12:34.
</description>
</column>
<column name="nutUpsDate" oid="1.3.6.1.4.1.26376.99.1.2.1.4" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Internal UPS clock date (opaque string). I.e. 01-02-03.
</description>
</column>
<column name="nutUpsModel" oid="1.3.6.1.4.1.26376.99.1.2.1.5" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS model. I.e. SMART-UPS 700.
</description>
</column>
<column name="nutUpsMfr" oid="1.3.6.1.4.1.26376.99.1.2.1.6" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS manufacturer. I.e. APC.
</description>
</column>
<column name="nutUpsMfrDate" oid="1.3.6.1.4.1.26376.99.1.2.1.7" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS manufacturing date (opaque string). I.e. 10/17/96.
</description>
</column>
<column name="nutUpsSerial" oid="1.3.6.1.4.1.26376.99.1.2.1.8" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS serial number (opaque string). I.e. WS9643050926.
</description>
</column>
<column name="nutUpsVendorid" oid="1.3.6.1.4.1.26376.99.1.2.1.9" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Vendor ID for USB devices. I.e. 0463.
</description>
</column>
<column name="nutUpsProductid" oid="1.3.6.1.4.1.26376.99.1.2.1.10" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Product ID for USB devices. I.e. 0001.
</description>
</column>
<column name="nutUpsFirmware" oid="1.3.6.1.4.1.26376.99.1.2.1.11" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS firmware (opaque string). I.e. 50.9.D.
</description>
</column>
<column name="nutUpsFirmwareAux" oid="1.3.6.1.4.1.26376.99.1.2.1.12" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Auxiliary device firmware. I.e. 4Kx.
</description>
</column>
<column name="nutUpsTemperature" oid="1.3.6.1.4.1.26376.99.1.2.1.13" status="current">
<syntax>
<typedef basetype="Integer32">
<parent module="NUT-MIB" name="TenthInteger32"/>
<range min="-2730" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS temperature (in 0.1 degrees C). I.e. 427 (for 42.7oC).
</description>
</column>
<column name="nutUpsLoad" oid="1.3.6.1.4.1.26376.99.1.2.1.14" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="100"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Load on UPS (percent). I.e. 023.
</description>
</column>
<column name="nutUpsLoadHigh" oid="1.3.6.1.4.1.26376.99.1.2.1.15" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="100"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Load when UPS switches to overload condition ('OVER') (percent). I.e. 100.
</description>
</column>
<column name="nutUpsId" oid="1.3.6.1.4.1.26376.99.1.2.1.16" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS system identifier (opaque string). I.e. Sierra.
</description>
</column>
<column name="nutUpsDelayStart" oid="1.3.6.1.4.1.26376.99.1.2.1.17" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Interval to wait before restarting the load (seconds). I.e. 0.
</description>
</column>
<column name="nutUpsDelayReboot" oid="1.3.6.1.4.1.26376.99.1.2.1.18" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Interval to wait before rebooting the UPS (seconds). I.e. 60.
</description>
</column>
<column name="nutUpsDelayShutdown" oid="1.3.6.1.4.1.26376.99.1.2.1.19" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Interval to wait after shutdown with delay command (seconds). I.e. 20.
</description>
</column>
<column name="nutUpsTimerStart" oid="1.3.6.1.4.1.26376.99.1.2.1.20" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Time before the load will be started (seconds). I.e. 30.
</description>
</column>
<column name="nutUpsTimerReboot" oid="1.3.6.1.4.1.26376.99.1.2.1.21" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Time before the load will be rebooted (seconds). I.e. 10.
</description>
</column>
<column name="nutUpsTimerShutdown" oid="1.3.6.1.4.1.26376.99.1.2.1.22" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Time before the load will be shutdown (seconds). I.e. 20.
</description>
</column>
<column name="nutUpsTestInterval" oid="1.3.6.1.4.1.26376.99.1.2.1.23" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="-1" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Interval between self tests (seconds). I.e. 1209600 (two weeks).
</description>
</column>
<column name="nutUpsTestResult" oid="1.3.6.1.4.1.26376.99.1.2.1.24" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Results of last self test (opaque string). I.e. Bad battery pack.
</description>
</column>
<column name="nutUpsDisplayLanguage" oid="1.3.6.1.4.1.26376.99.1.2.1.25" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Language to use on front panel (* opaque). I.e. E.
</description>
</column>
<column name="nutUpsContacts" oid="1.3.6.1.4.1.26376.99.1.2.1.26" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS external contact sensors (* opaque). I.e. F0.
</description>
</column>
<column name="nutUpsEfficiency" oid="1.3.6.1.4.1.26376.99.1.2.1.27" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="100"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Efficiency of the UPS (ratio of the output current on the input current) (percent). I.e. 95.
</description>
</column>
<column name="nutUpsPower" oid="1.3.6.1.4.1.26376.99.1.2.1.28" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Current value of apparent power (Volt-Amps). I.e. 500.
</description>
</column>
<column name="nutUpsPowerNominal" oid="1.3.6.1.4.1.26376.99.1.2.1.29" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Nominal value of apparent power (Volt-Amps). I.e. 500.
</description>
</column>
<column name="nutUpsRealpower" oid="1.3.6.1.4.1.26376.99.1.2.1.30" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Current value of real power (Watts). I.e. 300.
</description>
</column>
<column name="nutUpsRealpowerNominal" oid="1.3.6.1.4.1.26376.99.1.2.1.31" status="current">
<syntax>
<typedef basetype="Integer32">
<range min="0" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Nominal value of real power (Watts). I.e. 300.
</description>
</column>
<column name="nutUpsBeeperStatus" oid="1.3.6.1.4.1.26376.99.1.2.1.32" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS beeper status (enabled, disabled or muted). I.e. enabled.
</description>
</column>
<column name="nutUpsType" oid="1.3.6.1.4.1.26376.99.1.2.1.33" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS type (* opaque). I.e. offline.
</description>
</column>
<column name="nutUpsWatchdogStatus" oid="1.3.6.1.4.1.26376.99.1.2.1.34" status="current">
<syntax>
<typedef basetype="OctetString">
<parent module="SNMPv2-TC" name="DisplayString"/>
<range min="0" max="255"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS watchdog status (enabled or disabled). I.e. disabled.
</description>
</column>
<column name="nutUpsStartAuto" oid="1.3.6.1.4.1.26376.99.1.2.1.35" status="current">
<syntax>
<typedef basetype="Enumeration">
<namednumber name="no" number="0"/>
<namednumber name="yes" number="1"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS starts when mains is (re)applied. I.e. yes.
</description>
</column>
<column name="nutUpsStartBattery" oid="1.3.6.1.4.1.26376.99.1.2.1.36" status="current">
<syntax>
<typedef basetype="Enumeration">
<namednumber name="no" number="0"/>
<namednumber name="yes" number="1"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Allow to start UPS from battery. I.e. yes.
</description>
</column>
<column name="nutUpsStartReboot" oid="1.3.6.1.4.1.26376.99.1.2.1.37" status="current">
<syntax>
<typedef basetype="Enumeration">
<namednumber name="no" number="0"/>
<namednumber name="yes" number="1"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
UPS coldstarts from battery (enabled or disabled). I.e. yes.
</description>
</column>
</row>
</table>
<table name="nutInputTable" oid="1.3.6.1.4.1.26376.99.1.3" status="current">
<description>
A list of input.
</description>
<row name="nutInputEntry" oid="1.3.6.1.4.1.26376.99.1.3.1" status="current">
<linkage>
<index module="NUT-MIB" name="nutDeviceIndex"/>
</linkage>
<description>
An entry containing information about a particular input.
</description>
<column name="nutInputVoltage" oid="1.3.6.1.4.1.26376.99.1.3.1.1" status="current">
<syntax>
<typedef basetype="Integer32">
<parent module="NUT-MIB" name="TenthInteger32"/>
<range min="0" max="2147483647"/>
</typedef>
</syntax>
<access>readonly</access>
<description>
Input voltage (0.1V). I.e. 1212 (121.2V).
</description>
</column>
<column name="nutInputVoltageMaximum" oid="1.3.6.1.4.1.26376.99.1.3.1.2" status="current">
<syntax>
<typedef basetype="Integer32">
<parent module="NUT-MIB" name="TenthInteger32"/>
<range min="0" max="2147483647"/>