Ad Widget

Collapse

Dashboard doesn't show number of CPUs but item key does retrieve value

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

    #1

    Dashboard doesn't show number of CPUs but item key does retrieve value

    My default Linux System Load dashboard contains an item that reads "Number of CPUs" with value "No data":

    Click image for larger version

Name:	image.png
Views:	103
Size:	278.7 KB
ID:	501895


    However when I get that value from the same host:

    Click image for larger version

Name:	image.png
Views:	75
Size:	35.3 KB
ID:	501896
    Click image for larger version

Name:	image.png
Views:	74
Size:	143.7 KB
ID:	501897

    How can I amend this?

  • Answer selected by marianogedisman at 23-04-2025, 00:16.
    ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    marianogedisman so, you save duplicate value only once in 24 hours. Let us say it was saved at 13:00. Then at 20:00 you open a graph which will show you all the value over last 2 hours, so from 18:00 till 20:00. Are there any value saved in that time frame? No! Value was saved at 13:00! So Zabbix has no values to show in between 18:00 - 20:00.

    Edit: Let me expand even more. The "Discard unchanged" preprocessing is intended to help you ration the disk space of your DB. If number of CPUs not expected to change often then why to save this value to database every minute? Instead you instruct Zabbix to keep 1 value in memory cache and compare it against the new incoming value. If they are saame - the value will be discarded, not saving it to DB (if you using "with heartbeat" you also set some interval at which to save duplicate value, in this case it's 24 hours). But it also means on graphs, if you want this value to be plotted, you need to set interval equal or bigger to that of heartbeat value. So if you have heartbeat of 24 hours, set graph to 24 hours, and you will always see your value. On other hand, if database space is not an issue for you - just remove "discard unchanged" from preprocessing. Or if all your graphs are set to 2h timescope - set heartbeat value for item to 2 hours.



    Last edited by ISiroshtan; 21-04-2025, 08:21.

    Comment


    • marianogedisman
      marianogedisman commented
      Editing a comment
      Clear as water! Thank you so much for taking the time for such a detailed and fantastic explanation!
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    You have "discard unchanged with heartbeat" there... whats the heartbeat length? Increase your grpaph length beyond that, and it should show some values also...

    Comment

    • marianogedisman
      Member
      • Oct 2021
      • 78

      #3
      cyber: Heartbeat settings:

      Click image for larger version

Name:	image.png
Views:	73
Size:	124.0 KB
ID:	501952


      the odd part is that I had to redo my zabbix DB and now I am showing the CPU number value:

      Click image for larger version

Name:	image.png
Views:	66
Size:	275.2 KB
ID:	501953

      So I guess it was something wrong with my DB. Thanks anyway for the help! I will mark you as an answer, thanks!

      Comment

      • ISiroshtan
        Senior Member
        • Nov 2019
        • 324

        #4
        "discard unchanged with heartbeat 1d" means you will only save one value per 24h (unless reported value changes) and graphs you set is "last 2 hours". Check the same graph again in 3 hours, when saved value will move past your data selection tiem window and value will be "no_data" again.
        For such values you need to set time selector equal or bigger then the heartbeat. Or be lucky to open 2 hours view close to when new heartbeat value is saved

        Comment


        • marianogedisman
          marianogedisman commented
          Editing a comment
          Interesting! I still don't understand why my value was "no data" if when testing the item the number of CPUs is 24.
      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #5
        Originally posted by ISiroshtan
        "discard unchanged with heartbeat 1d" means you will only save one value per 24h (unless reported value changes) and graphs you set is "last 2 hours". Check the same graph again in 3 hours, when saved value will move past your data selection tiem window and value will be "no_data" again.
        For such values you need to set time selector equal or bigger then the heartbeat. Or be lucky to open 2 hours view close to when new heartbeat value is saved
        Correct answer is this one...

        Comment

        • ISiroshtan
          Senior Member
          • Nov 2019
          • 324

          #6
          marianogedisman so, you save duplicate value only once in 24 hours. Let us say it was saved at 13:00. Then at 20:00 you open a graph which will show you all the value over last 2 hours, so from 18:00 till 20:00. Are there any value saved in that time frame? No! Value was saved at 13:00! So Zabbix has no values to show in between 18:00 - 20:00.

          Edit: Let me expand even more. The "Discard unchanged" preprocessing is intended to help you ration the disk space of your DB. If number of CPUs not expected to change often then why to save this value to database every minute? Instead you instruct Zabbix to keep 1 value in memory cache and compare it against the new incoming value. If they are saame - the value will be discarded, not saving it to DB (if you using "with heartbeat" you also set some interval at which to save duplicate value, in this case it's 24 hours). But it also means on graphs, if you want this value to be plotted, you need to set interval equal or bigger to that of heartbeat value. So if you have heartbeat of 24 hours, set graph to 24 hours, and you will always see your value. On other hand, if database space is not an issue for you - just remove "discard unchanged" from preprocessing. Or if all your graphs are set to 2h timescope - set heartbeat value for item to 2 hours.



          Last edited by ISiroshtan; 21-04-2025, 08:21.

          Comment


          • marianogedisman
            marianogedisman commented
            Editing a comment
            Clear as water! Thank you so much for taking the time for such a detailed and fantastic explanation!
        Working...