Ad Widget

Collapse

Cannot pull printer uptime from SNMP.

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marianogedisman
    Member
    • Oct 2021
    • 78

    #1

    Cannot pull printer uptime from SNMP.

    (Running Zabbix 6.0 from Docker)

    Hello! I am monitoring a HP LaserJet M15w printer with SNMPv3, however I am having issues when trying to create an item for the system uptime using this OID

    Code:
    DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1871274) 5:11:52.74
    However, when setting the up the item as per https://www.zabbix.com/documentation...fig/items/item:
    Special processing is used if the following time-related units are used:
    unixtime - translated to "yyyy.mm.dd hh:mm:ss". To translate correctly, the received value must be a Numeric (unsigned) type of information.
    uptime - translated to "hh:mm:ss" or "N days, hh:mm:ss"
    For example, if you receive the value as 881764 (seconds), it will be displayed as "10 days, 04:56:04"
    s - translated to "yyy mmm ddd hhh mmm sss ms"; parameter is treated as number of seconds.
    For example, if you receive the value as 881764 (seconds), it will be displayed as "10d 4h 56m"​
    I set the item in the following way:

    Click image for larger version  Name:	image.png Views:	0 Size:	138.8 KB ID:	451687

    But I get this value in return:

    Click image for larger version  Name:	image.png Views:	0 Size:	35.9 KB ID:	451688


    NOTE: I did notice that the item preprocessing needed to be set to "Change per second", as per the documentation, but this might actually be the issue?

    Any help would be greatly appreciated!
    Attached Files
    Last edited by marianogedisman; 22-09-2022, 03:48. Reason: edit
  • Answer selected by marianogedisman at 26-09-2022, 00:28.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    Your printer is busy answering your previous request, while you hit it with another one.. polling in 3s interval does not do any good...
    As you mention snmpv3, then that one really needs all the times being in sync.

    Comment


    • marianogedisman
      marianogedisman commented
      Editing a comment
      Thank you! I will look into this and let you know how it goes. Thanks again!

    • marianogedisman
      marianogedisman commented
      Editing a comment
      What about the preprocessing cyber ? Is it really necessary as stated on the documentation?
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    The subject for this thread seems to not match the problem you're having, which might be why you haven't received any responses until now. You are collecting system uptime, but at least sometimes it seems like the value you're getting isn't correct.

    A few thoughts:

    1) every 3 seconds? Is that really necessary? Do you get better results if you change it to every 30s or every 60s?
    2) are you using bulk queries?
    3) is the printer synchronizing its time to an accurate source?
    4) is the printer running the latest firmware? Zabbix may just be getting garbage data occasionally because the printer is providing garbage data.
    5) have you tried running an 'snmpget' for that particular oid from the Zabbix server, on the command line, in a loop, to see if you ever see values that decrease, rather than monotonically increasing?

    Comment


    • marianogedisman
      marianogedisman commented
      Editing a comment
      Hello tim.mooney! Thanks for your reply! Sorry for the typo on the Update Interval, I meant to type 30s but missed the zero.

      I did run 'snmpget' in a loop and I get the correct uptime increase.
      The printer is syncing to an accurate time source.
      Last edited by marianogedisman; 26-09-2022, 00:53.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #3
    Your printer is busy answering your previous request, while you hit it with another one.. polling in 3s interval does not do any good...
    As you mention snmpv3, then that one really needs all the times being in sync.

    Comment


    • marianogedisman
      marianogedisman commented
      Editing a comment
      Thank you! I will look into this and let you know how it goes. Thanks again!

    • marianogedisman
      marianogedisman commented
      Editing a comment
      What about the preprocessing cyber ? Is it really necessary as stated on the documentation?
  • marianogedisman
    Member
    • Oct 2021
    • 78

    #4
    Also cyber tim.mooney, does zabbix_get work with snmp agent? The documentation page only mentions examples with port 10051; how do I do to pull an item key value from the server cli? Thanks!


    EDIT: I just answered my question :P

    Click image for larger version

Name:	image.png
Views:	406
Size:	63.1 KB
ID:	451853

    Comment

    • marianogedisman
      Member
      • Oct 2021
      • 78

      #5

      Alright, so I'm a dork... the very obvious thing I didn't notice is that the printer is sending back the timeticks through snmp (it was right there under my nose):

      snmpget -v 3 -l authPriv -c set -a MD5 -A authproto -n Jetdirect -u username -x DES -X privctrl -On 192.168.0.28 DISMAN-EVENT-MIB::sysUpTimeInstance
      .1.3.6.1.2.1.1.3.0 = Timeticks: (734008) 2:02:20.08
      And Zabbix actually sees it correctly:

      Click image for larger version  Name:	image.png Views:	0 Size:	127.3 KB ID:	451855


      Now, the deal would be to convert these timeticks into actual time and date. I'm googling some formulas and heck, that sounds difficult! Anyone care to lend a hand on how to achieve this on Zabbix item config? Much appreciated in advance!


      EDIT: Oooohhh, I think I found what I'm looking for! https://www.zabbix.com/forum/zabbix-...cks-conversion


      RESOLUTION: Getting read of the "change per second" preprocessing step and simply adding a multiplier by 0.01 worked!

      Thanks everyone who chipped in.
      Last edited by marianogedisman; 26-09-2022, 03:12.

      Comment

      Working...