>Synopsis: SNMPD : SNMP-FRAMEWORK-MIB::snmpEngineTime always return
>current unixtime instead uptime
>Category: system
>Environment:
System : OpenBSD 5.3
Details : OpenBSD 5.3 (GENERIC) #50: Tue Mar 12 18:35:23 MDT 2013
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC
Architecture: OpenBSD.i386
Machine : i386
>Description:
SNMPD snmpEngineTime return current unixtime instead uptime.
In RFC2574 snmpEngineTime described as:
- snmpEngineTime, which is the number of seconds since the
snmpEngineBoots counter was last incremented.
and
- snmpEngineBoots, which is a count of the number of times the
SNMP engine has re-booted/re-initialized since snmpEngineID
was last configured
In my system:
$ uptime
8:30PM up 5 days, 2:32, 1 user, load averages: 0.09, 0.09, 0.08
-------------
$ snmpget -v2c -c 'public' -m SNMP-FRAMEWORK-MIB -M
/opt/observium/mibs 'udp':'openbsd.test':'161' snmpEngineTime.0
SNMP-FRAMEWORK-MIB::snmpEngineTime.0 = INTEGER: 1379520217 seconds
-------------
$ snmpget -v2c -c 'public' -m HOST-RESOURCES-MIB -M
/opt/observium/mibs 'udp':'openbsd.test':'161' hrSystemUptime.0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (44131000) 5 days, 2:35:10.00
If use package Net-SNMPD instead system SNMPD, snmpEngineTime return
correct value as described in RFC.
>How-To-Repeat:
>Fix:
dmesg:
OpenBSD 5.3 (GENERIC) #50: Tue Mar 12 18:35:23 MDT 2013
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Common KVM processor ("GenuineIntel" 686-class) 3.01 GHz
cpu0:
FPU,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,LONG,SSE3,CX16,x2APIC
real mem = 1073270784 (1023MB)
avail mem = 1044750336 (996MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/23/99, BIOS32 rev. 0 @
0xfec3a, SMBIOS rev. 2.4 @ 0xfd9c0 (10 entries)
bios0: vendor Bochs version "Bochs" date 01/01/2011
bios0: Bochs Bochs
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC HPET
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
acpihpet0 at acpi0: 100000000 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
mpbios at bios0 function 0x0 not configured
bios0: ROM list: 0xc0000/0x8c00 0xc9000/0xa00 0xca000/0x2400 0xee800/0x1800!
cpu0 at mainbus0: (uniprocessor)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82441FX" rev 0x02
pcib0 at pci0 dev 1 function 0 "Intel 82371SB ISA" rev 0x00
pciide0 at pci0 dev 1 function 1 "Intel 82371SB IDE" rev 0x00: DMA,
channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <QEMU HARDDISK>
wd0: 16-sector PIO, LBA48, 32768MB, 67108864 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 1.4.> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 1 function 2 "Intel 82371SB USB" rev 0x01: irq 11
piixpm0 at pci0 dev 1 function 3 "Intel 82371AB Power" rev 0x03: irq 9
iic0 at piixpm0
iic0: addr 0x19 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words 00=0000
01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1b 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words 00=0000
01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1c 0f=00 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1d 0f=00 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words
00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1e 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words 00=0000
01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x1f 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words 00=0000
01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x29 00=d0 01=d0 02=d0 03=d0 04=d0 05=d0 06=d0 07=d0 08=d0
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x2b 00=d0 01=d0 02=d0 03=d0 04=d0 05=d0 06=d0 07=d0 08=d0
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x4c 00=d0 01=d0 02=d0 03=d0 04=d0 05=d0 06=d0 07=d0 08=d0
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x4e 00=d0 01=d0 02=d0 03=d0 04=d0 05=d0 06=d0 07=d0 08=d0
words 00=0000 01=0000 02=0000 03=0000 04=0000 05=0000 06=0000 07=0000
vga1 at pci0 dev 2 function 0 "Cirrus Logic CL-GD5446" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
virtio0 at pci0 dev 3 function 0 "Qumranet Virtio Memory" rev 0x00:
Virtio Memory Balloon Device
viomb0 at virtio0
virtio0: irq 11
em0 at pci0 dev 18 function 0 "Intel PRO/1000MT (82540EM)" rev 0x03:
irq 10, address 7e:62:ea:24:4a:19
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 1: density unknown
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
mtrr: Pentium Pro MTRR support
nvram: invalid checksum
uhidev0 at uhub0 port 1 configuration 1 interface 0 "QEMU QEMU USB
Tablet" rev 1.00/0.00 addr 2
uhidev0: iclass 3/0
uhid0 at uhidev0: input=6, output=0, feature=0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (42075f448b24da3a.a) swap on wd0b dump on wd0b
WARNING: / was not properly unmounted
clock: unknown CMOS layout
usbdevs:
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 addr 2: full speed, power 100 mA, config 1, QEMU USB
Tablet(0x0001), QEMU(0x0627), rev 0.00, iSerialNumber 42
port 2 powered
pcidump:
Domain /dev/pci0:
0:0:0: Intel 82441FX
0x0000: Vendor ID: 8086 Product ID: 1237
0x0004: Command: 0103 Status ID: 0000
0x0008: Class: 06 Subclass: 00 Interface: 00 Revision: 02
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR empty (00000000)
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
0x0000: 12378086 00000103 06000002 00000000
0x0010: 00000000 00000000 00000000 00000000
0x0020: 00000000 00000000 00000000 11001af4
0x0030: 00000000 00000000 00000000 00000000
0x0040: 00000000 00000000 00000000 00000000
0x0050: 00000000 80000000 11111000 33333333
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00020000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:1:0: Intel 82371SB ISA
0x0000: Vendor ID: 8086 Product ID: 7000
0x0004: Command: 0103 Status ID: 0200
0x0008: Class: 06 Subclass: 01 Interface: 00 Revision: 00
0x000c: BIST: 00 Header Type: 80 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR empty (00000000)
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
0x0000: 70008086 02000103 06010000 00800000
0x0010: 00000000 00000000 00000000 00000000
0x0020: 00000000 00000000 00000000 11001af4
0x0030: 00000000 00000000 00000000 00000000
0x0040: 00000000 00000000 00000000 0003004d
0x0050: 00000000 00000000 00000000 00000000
0x0060: 0b0b0a0a 00000000 00000200 00000000
0x0070: 00000080 0c0c0000 00000002 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000008 00000000 0000000f 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:1:1: Intel 82371SB IDE
0x0000: Vendor ID: 8086 Product ID: 7010
0x0004: Command: 0107 Status ID: 0280
0x0008: Class: 01 Subclass: 01 Interface: 80 Revision: 00
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR io addr: 0x0000c080/0x0010
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
0x0000: 70108086 02800107 01018000 00000000
0x0010: 00000000 00000000 00000000 00000000
0x0020: 0000c081 00000000 00000000 11001af4
0x0030: 00000000 00000000 00000000 00000000
0x0040: a307a307 00000000 00000000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:1:2: Intel 82371SB USB
0x0000: Vendor ID: 8086 Product ID: 7020
0x0004: Command: 0107 Status ID: 0000
0x0008: Class: 0c Subclass: 03 Interface: 00 Revision: 01
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR io addr: 0x0000c040/0x0020
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 04 Line: 0b Min Gnt: 00 Max Lat: 00
0x0000: 70208086 00000107 0c030001 00000000
0x0010: 00000000 00000000 00000000 00000000
0x0020: 0000c041 00000000 00000000 11001af4
0x0030: 00000000 00000000 00000000 0000040b
0x0040: 00000000 00000000 00000000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000010 00000000 00010000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00002000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:1:3: Intel 82371AB Power
0x0000: Vendor ID: 8086 Product ID: 7113
0x0004: Command: 0103 Status ID: 0280
0x0008: Class: 06 Subclass: 80 Interface: 00 Revision: 03
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR empty (00000000)
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 01 Line: 09 Min Gnt: 00 Max Lat: 00
0x0000: 71138086 02800103 06800003 00000000
0x0010: 00000000 00000000 00000000 00000000
0x0020: 00000000 00000000 00000000 11001af4
0x0030: 00000000 00000000 00000000 00000109
0x0040: 0000b001 00000000 00000000 00000000
0x0050: 00000000 00000000 02000000 10000000
0x0060: 60000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000001 00000000 00000000 00000000
0x0090: 0000b101 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00090000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:2:0: Cirrus Logic CL-GD5446
0x0000: Vendor ID: 1013 Product ID: 00b8
0x0004: Command: 0107 Status ID: 0000
0x0008: Class: 03 Subclass: 00 Interface: 00 Revision: 00
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR mem prefetchable 32bit addr: 0xfc000000/0x02000000
0x0014: BAR mem 32bit addr: 0xfebf0000/0x00001000
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR empty (00000000)
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 1100
0x0030: Expansion ROM Base Address: febe0000
0x0038: 00000000
0x003c: Interrupt Pin: 00 Line: 00 Min Gnt: 00 Max Lat: 00
0x0000: 00b81013 00000107 03000000 00000000
0x0010: fc000008 febf0000 00000000 00000000
0x0020: 00000000 00000000 00000000 11001af4
0x0030: febe0000 00000000 00000000 00000000
0x0040: 00000000 00000000 00000000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
0:3:0: Qumranet Virtio Memory
0x0000: Vendor ID: 1af4 Product ID: 1002
0x0004: Command: 0107 Status ID: 0000
0x0008: Class: 00 Subclass: ff Interface: 00 Revision: 00
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR io addr: 0x0000c060/0x0020
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
0x0020: BAR empty (00000000)
0x0024: BAR empty (00000000)
0x0028: Cardbus CIS: 00000000
0x002c: Subsystem Vendor ID: 1af4 Product ID: 0005
0x0030: Expansion ROM Base Address: 00000000
0x0038: 00000000
0x003c: Interrupt Pin: 01 Line: 0b Min Gnt: 00 Max Lat: 00
0x0000: 10021af4 00000107 00ff0000 00000000
0x0010: 0000c061 00000000 00000000 00000000
0x0020: 00000000 00000000 00000000 00051af4
0x0030: 00000000 00000000 00000000 0000010b
0x0040: 00000000 00000000 00000000 00000000
0x0050: 00000000 00000000 00000000 00000000
0x0060: 00000000 00000000 00000000 00000000
0x0070: 00000000 00000000 00000000 00000000
0x0080: 00000000 00000000 00000000 00000000
0x0090: 00000000 00000000 00000000 00000000
0x00a0: 00000000 00000000 00000000 00000000
0x00b0: 00000000 00000000 00000000 00000000
0x00c0: 00000000 00000000 00000000 00000000
0x00d0: 00000000 00000000 00000000 00000000
0x00e0: 00000000 00000000 00000000 00000000
0x00f0: 00000000 00000000 00000000 00000000
--
Mike Stupalov