Ad Widget

Collapse

monitor the Memory and CPU of my ubuntu server with SNMP

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vaibhav Ubale
    Junior Member
    • Mar 2021
    • 9

    #1

    monitor the Memory and CPU of my ubuntu server with SNMP

    Hi ,
    I want to monitor the Memory and CPU of my ubuntu server with SNMP but only getting uptime and some basic information.
    Item for SNMP template attached shows the error "no such object against OID for Agent" for memory and CPU.
    Can some expert help me with this

    I have already installed the MIB downloader but no luck.

    Thanks in advance.

    Vaibhav​
  • Answer selected by Vaibhav Ubale at 16-04-2024, 13:03.
    ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    You need to allow the agent to provide data in OID trees needed for monitoring. I would start with simple test of adding
    view systemonly included .1.3.6.1
    After that restart snmpd and check again if data starts flowing in. If all works - you can then work on hardening allowed tree (if you really want/need to do it).

    To explain:
    In configuration
    view systemonly included .1.3.6.1.2.1.1
    you define "view" (a collection of OID trees that SNMP user using that view will be able to access) with the name "systemonly" to "include" (add to allowed to view trees) all oids that start with .1.3.6.1.2.1.1 .
    Because OID requested by Zabbix starts with 1.3.6.1.4, it does not match any currently included trees. By allowing pretty high level OID .1.3.6.1 I hope it will include all you need to your monitoring
    Last edited by ISiroshtan; 27-11-2023, 09:09. Reason: Expanded the answer

    Comment

    • vijayk
      Senior Member
      • May 2023
      • 305

      #2
      Did you check with snmpwalk command? Does it returns the value?

      Comment

      • Vaibhav Ubale
        Junior Member
        • Mar 2021
        • 9

        #3
        Hi Yes!!
        I have checked the snmp walk and i dont see the OID in it ...

        This is my snmpd.conf ...


        sudo cat /etc/snmp/snmpd.conf |grep -v '^#\|^$'

        [sudo] password for gargi:

        sysLocation Sitting on the Dock of the Bay

        sysContact Me <[email protected]>

        sysServices 72

        master agentx

        agentaddress 192.168.0.110,127.0.0.1,[::1]

        view systemonly included .1.3.6.1.2.1.1

        view systemonly included .1.3.6.1.2.1.25.1

        rocommunity Dpublic default -V systemonly

        rouser authPrivUser authpriv -V systemonly

        includeDir /etc/snmp/snmpd.conf.d


        and
        snmp walk out put is as below

        snmpwalk -v2c -cDpublic 192.168.0.110

        Timeout: No Response from 192.168.0.110

        [root@pczbcl1 ~]# snmpwalk -v2c -cDpublic 192.168.0.110

        SNMPv2-MIB::sysDescr.0 = STRING: Linux BlackJack 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64

        SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10

        DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (574) 0:00:05.74

        SNMPv2-MIB::sysContact.0 = STRING: Me <[email protected]>

        SNMPv2-MIB::sysName.0 = STRING: BlackJack

        SNMPv2-MIB::sysLocation.0 = STRING: Sitting on the Dock of the Bay

        SNMPv2-MIB::sysServices.0 = INTEGER: 72

        SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance

        SNMPv2-MIB::sysORID.2 = OID: SNMP-MPD-MIB::snmpMPDCompliance

        SNMPv2-MIB::sysORID.3 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance

        SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB

        SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup

        SNMPv2-MIB::sysORID.6 = OID: TCP-MIB::tcpMIB

        SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB

        SNMPv2-MIB::sysORID.8 = OID: IP-MIB::ip

        SNMPv2-MIB::sysORID.9 = OID: SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance

        SNMPv2-MIB::sysORID.10 = OID: NOTIFICATION-LOG-MIB::notificationLogMIB

        SNMPv2-MIB::sysORDescr.1 = STRING: The SNMP Management Architecture MIB.

        SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.

        SNMPv2-MIB::sysORDescr.3 = STRING: The management information definitions for the SNMP User-based Security Model.

        SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities

        SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Control Model for SNMP.

        SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing TCP implementations

        SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations

        SNMPv2-MIB::sysORDescr.8 = STRING: The MIB module for managing IP and ICMP implementations

        SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.

        SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.

        SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.7 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.8 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.9 = Timeticks: (0) 0:00:00.00

        SNMPv2-MIB::sysORUpTime.10 = Timeticks: (0) 0:00:00.00

        HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (462507) 1:17:05.07

        HOST-RESOURCES-MIB::hrSystemDate.0 = STRING: 2023-11-25,11:21:47.0,+5:30

        HOST-RESOURCES-MIB::hrSystemInitialLoadDevice.0 = INTEGER: 393216

        HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0 = STRING: "BOOT_IMAGE=/boot/vmlinuz-6.2.0-37-generic root=UUID=72cc58d1-7d2b-4993-b412-49b9460f5031 ro quiet splash vt.handoff=7

        "

        HOST-RESOURCES-MIB::hrSystemNumUsers.0 = Gauge32: 2

        HOST-RESOURCES-MIB::hrSystemProcesses.0 = Gauge32: 282

        HOST-RESOURCES-MIB::hrSystemMaxProcesses.0 = INTEGER: 0

        HOST-RESOURCES-MIB::hrSystemMaxProcesses.0 = No more variables left in this MIB View (It is past the end of the MIB tree)







        Error I am getting

        Click image for larger version

Name:	image.png
Views:	2132
Size:	134.5 KB
ID:	474724


        and OID which is missing

        Click image for larger version

Name:	image.png
Views:	2012
Size:	49.9 KB
ID:	474725




        Comment

        • vijayk
          Senior Member
          • May 2023
          • 305

          #4
          Did you check this link?
          https://techexpert.tips/zabbix/zabbi...ux-using-snmp/

          Comment

          • Vaibhav Ubale
            Junior Member
            • Mar 2021
            • 9

            #5
            Hi Thanks for your quick reply . Only diffrencei could spot is the "Template OS LINUX SNMPv2" vs "Template OS LINUX SNMP" that I have used.
            I am unable to find this Template OS LINUX SNMPv2 in my templates. I will try to find and assigne.

            Comment

            • vijayk
              Senior Member
              • May 2023
              • 305

              #6
              Might be OID is different. I'm not sure for that.

              Comment

              • vijayk
                Senior Member
                • May 2023
                • 305

                #7
                Try this tool. It will help you to browse the correct OID.

                How Can We Help You? Should you have any issues with our software, any questions or suggestions, feel free to contact technical support. Please be as complete

                Comment

                • ISiroshtan
                  Senior Member
                  • Nov 2019
                  • 324

                  #8
                  In your config snmpd.conf on Ubuntu you limit the OID trees exposed
                  view systemonly included .1.3.6.1.2.1.1
                  view systemonly included .1.3.6.1.2.1.25.1​
                  Then from Zabbix you try to request 1.3.6.1.4.1.2021.11.66.0 (from screenshot) which is outside of allowed trees. As SNMP Agent on your Ubuntu does not expose said tree it replies to Zabbix with info that no such oid exist.

                  Fix permissions from Ubuntu side and all should work fine.

                  Comment

                  • Vaibhav Ubale
                    Junior Member
                    • Mar 2021
                    • 9

                    #9
                    Thanks @vijayk​ and @ISiroshtan​ for your reply ,

                    @ISiroshtan​, so i need to allow other tree's in my snmpd.conf . is that right or should i remove systemonly?
                    I will try to find and fix this. Thanks .

                    Comment

                    • ISiroshtan
                      Senior Member
                      • Nov 2019
                      • 324

                      #10
                      You need to allow the agent to provide data in OID trees needed for monitoring. I would start with simple test of adding
                      view systemonly included .1.3.6.1
                      After that restart snmpd and check again if data starts flowing in. If all works - you can then work on hardening allowed tree (if you really want/need to do it).

                      To explain:
                      In configuration
                      view systemonly included .1.3.6.1.2.1.1
                      you define "view" (a collection of OID trees that SNMP user using that view will be able to access) with the name "systemonly" to "include" (add to allowed to view trees) all oids that start with .1.3.6.1.2.1.1 .
                      Because OID requested by Zabbix starts with 1.3.6.1.4, it does not match any currently included trees. By allowing pretty high level OID .1.3.6.1 I hope it will include all you need to your monitoring
                      Last edited by ISiroshtan; 27-11-2023, 09:09. Reason: Expanded the answer

                      Comment

                      Working...