Cacti not working for SNMP data sources

18,828

Could you try this command (OID is from Cacti log):

SNMPv1:

  $ snmpwalk -Cc -On -v 1 -c public 127.0.0.1 1.3.6.1.4.1.2021.11.52.0

SNMPv2c: Nowadays is very common SNMPv2c as default, so also try.

  $ snmpwalk -Cc -On -v 1 -c public 127.0.0.1 1.3.6.1.4.1.2021.11.52.0

Also, try changing COMMUNITY and/or IP ADDRESS to local network instead loopback.

If you don't get a result like .1.3.6.1.4.1.2021.11.52.0 = Counter32: 250038, then edit /etc/snmp/snmpd.conf adding or decommenting:

rocommunity public  localhost 

And restart snmpd using one of:

/etc/init.d/snmpd restart
service snmpd restart
Share:
18,828

Related videos on Youtube

lorenzo-s
Author by

lorenzo-s

I'm an italian web and Android developer. I'm a Javascript lover enthusiast about Node.js and React development, and a PHP/MySQL expert. I started working at D-One Software House (Carpi, Italy) after my degree in computer engineering. Look at my portfolio on my website, fork me on GitHub or follow me on Twitter.

Updated on September 18, 2022

Comments

  • lorenzo-s
    lorenzo-s over 1 year

    I installed packages cacti and snmpd on a Debian server. I'm able to display common graphs in Cacti (such as memory usage, load average, logged in users, etc) using the data templates listed as Unix. Now I want to replace these graphs with new ones using SNMP data sources, because I see there is also CPU usage and because it's not excluded I have to manage multiple hosts in the future.

    So, I installed snmpd on the machine and left the snmpd.conf as it is. In Cacti, I created three new data sources from SNMP templates for 127.0.0.1 host:

    • ucd/net - CPU Usage - Nice
    • ucd/net - CPU Usage - System
    • ucd/net - CPU Usage - User

    Then I created a new graph from template ucd/net - CPU Usage, and select the three data sources in the Graph Item Fields section. Graph is now enabled and running, but empty. No data have been collected.

    Under Console -> Devices my SNMP host is listed as up and running:

    System:Linux ip-xx-xx-xxx-xxx 3.2.0-23-virtual #36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012 x86_64
    Uptime: 929267 (0 days, 2 hours, 34 minutes)
    Hostname: ip-xx-xx-xxx-xxx
    Location: Sitting on the Dock of the Bay
    Contact: Me [email protected]
    

    In SNMP Options I left all as it is:

    • SNMP Version: Version 1
    • SNMP Community: public
    • SNMP Timeout: 500 ms
    • Maximum OID's Per Get Request: 10

    In Console -> Utilities -> Cacti Log I have multiple warning (two for each data source) every 5 minutes:

    10/29/2012 01:45:01 PM - CMDPHP: Poller[0] Host[2] DS[18] WARNING: Result from SNMP not valid. Partial Result: U
    10/29/2012 01:45:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'127.0.0.1', and OID:'.1.3.6.1.4.1.2021.4.15.0'
    10/29/2012 01:45:01 PM - CMDPHP: Poller[0] Host[1] DS[9] WARNING: Result from SNMP not valid. Partial Result: U
    10/29/2012 01:45:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'127.0.0.1', and OID:'.1.3.6.1.4.1.2021.11.52.0'
    10/29/2012 01:40:01 PM - CMDPHP: Poller[0] Host[2] DS[19] WARNING: Result from SNMP not valid. Partial Result: U
    10/29/2012 01:40:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'127.0.0.1', and OID:'.1.3.6.1.4.1.2021.4.6.0' 
    [...]
    

    I have the feeling I'm missing something, but I cannot get it...

    • Admin
      Admin over 11 years
      cat /etc/snmp/snmp.conf will give you serious hint. Also consider typing snmpwalk -Cc -On -v 1 -c public 127.0.0.1 .1.3.6.1.2.1.1
    • lorenzo-s
      lorenzo-s over 11 years
      @EricDANNIELOU snmp.conf is empty and says I have no MIB files; I'm not sure about what they are and if I need them... The output of the command you suggested me is here.
    • Admin
      Admin over 11 years
      MIB files are comfortable as they help translating numeric oids to text. It seems ucd snmp has been revomed from debian in 2006.
  • lorenzo-s
    lorenzo-s over 11 years
    Ok, I edited your answer removing non-needed parts. Thank you, now it works!
  • lorenzo-s
    lorenzo-s over 11 years
    Just succeeded in getting things works also for remote hosts! I just needed to remove local binding from agentAddress and specify an IP/Netmask in rocommunity definition instead of localhost (in the SNMPd.conf of these remote machines). Now Cacti is monitoring all my network! Thank you very much Eric!