Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysUpTime looks incorrct. #27

Open
MaurUppi opened this issue Dec 26, 2023 · 0 comments
Open

sysUpTime looks incorrct. #27

MaurUppi opened this issue Dec 26, 2023 · 0 comments

Comments

@MaurUppi
Copy link

MaurUppi commented Dec 26, 2023

I'm using EdgeMAX EdgeRouter 4 v2.0.9-hotfix.2

Here is the uptime showing on the device.
image

Your Grafana's Dashborad Uptime section query result is 1882461 by below SQL inquiry.

`SELECT "sysUpTime"  / 100 FROM "snmp.EdgeOS" WHERE ("agent_host" =~ /^$host$/) AND $timeFilter

image

So, which part is going wrong to caused this issue?

telegraf related config

  [[inputs.snmp.field]]
     name = "sysUpTime"
     oid = "HOST-RESOURCES-MIB::hrSystemUptime.0"

The HOST-RESOURCES-MIB.txt file in telegraf docker was copied from EdgeRouter /usr/share/snmp/mibs folder

hrSystemUptime OBJECT-TYPE
    SYNTAX     TimeTicks
    MAX-ACCESS read-only
    STATUS     current
    DESCRIPTION
        "The amount of time since this host was last
        initialized.  Note that this is different from
        sysUpTime in the SNMPv2-MIB [RFC1907] because
        sysUpTime is the uptime of the network management
        portion of the system."
    ::= { hrSystem 1 }

I also tried inquiry SNMP OID

below OID comes from https://github.com/grafana/jsonnet-libs/tree/master/ubnt-edgerouter-mixin

https://github.com/grafana/jsonnet-libs/blob/02db06f540086fa3f67d487bd01e1b314853fb8f/ubnt-edgerouter-mixin/snmp_generator/snmp.yml#L1036C25-L1036C25

  - name: hrSystemUptime
    oid: 1.3.6.1.2.1.25.1.1
    type: gauge
    help: The amount of time since this host was last initialized - 1.3.6.1.2.1.25.1.1

OID 1.3.6.1.2.1.25.1.1 corresponds to HOST-RESOURCES-MIB::hrSystemUptime.
hrSystemUptime is similar to sysUpTime in the SNMP MIB-II, but it's part of the Host Resources MIB. It represents the amount of time since the host was last initialized.

telegraf@abf4573b2ca9:/$ snmpget -v2c -c ouzycn 192.168.1.253 1.3.6.1.2.1.25.1.1.0
iso.3.6.1.2.1.25.1.1.0 = Timeticks: (188642200) 21 days, 20:00:22.00

telegraf@abf4573b2ca9:/$ snmpget -v2c -c ouzycn 192.168.1.253 HOST-RESOURCES-MIB::hrSystemUptime.0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (188642537) 21 days, 20:00:25.37

  - name: sysUpTime
    oid: 1.3.6.1.2.1.1.3
    type: gauge
    help: The time (in hundredths of a second) since the network management portion
      of the system was last re-initialized. - 1.3.6.1.2.1.1.3

iso.3.6.1.2.1.1.3.0 is the full OID for the sysUpTime object, representing the time since the last system start-up.

telegraf@abf4573b2ca9:/$ snmpget -v2c -c ouzycn 192.168.1.253 1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (6095747) 16:55:57.47

According to the below info, I think what you were using hrSystemUptime is correct.

The difference between the OIDs 1.3.6.1.2.1.25.1.1 and 1.3.6.1.2.1.1.3.0 in SNMP lies in their origin and specific use cases:

  1. OID 1.3.6.1.2.1.1.3.0 (sysUpTime):
  • This OID comes from the SNMP MIB-II (Management Information Base II) standard.
  • sysUpTime represents the time since the network management portion of the system was last re-initialized.
  • It is widely used for general network management purposes.
  • The uptime reported by sysUpTime resets to zero whenever the SNMP agent (the network management part) is restarted, which can happen independently of the host system's restarts or reboots.
  • It is a part of the System group in the MIB-II.
  1. OID 1.3.6.1.2.1.25.1.1 (hrSystemUptime):
  • This OID is from the Host Resources MIB.
  • hrSystemUptime provides the amount of time since the host (the entire system) was last initialized.
  • It's more host-centric and is often used for tracking the uptime of the actual computing device (server, workstation, etc.) rather than just the network management aspect.
  • The uptime reported by hrSystemUptime resets only when the host system is rebooted or restarted.
  • It belongs to the Host Resources MIB, which includes more detailed information about the host's resources like storage, installed software, and device performance.
  • In summary, while both OIDs report uptime, sysUpTime is specific to the network management subsystem and can reset independently of the host system, whereas hrSystemUptime is specific to the host system's uptime and resets only when the entire system restarts. This distinction is important when monitoring the uptime for network devices vs. the actual hosts/servers they are part of.

In summary, while both OIDs report uptime, sysUpTime is specific to the network management subsystem and can reset independently of the host system, whereas hrSystemUptime is specific to the host system's uptime and resets only when the entire system restarts. This distinction is important when monitoring the uptime for network devices vs. the actual hosts/servers they are part of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant