Cacti don't want to use data from SNMP

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Cacti don't want to use data from SNMP

Post by gandalf »

AllertGen wrote:Is de-install PHP-SNMP packet is enough for this?
Yes
R.
AllertGen
Posts: 37
Joined: Mon Mar 26, 2012 1:27 pm

Re: Cacti don't want to use data from SNMP

Post by AllertGen »

As I see it impossible to delete this packet. When I trying to delete this packet, apt-get want to delete cacti too. Is it possible to change way of getting SNMP information in cacti itself?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Cacti don't want to use data from SNMP

Post by gandalf »

You may want to edit the code in lib/snmp.php to force Cacti use not use php-snmp
R.
AllertGen
Posts: 37
Joined: Mon Mar 26, 2012 1:27 pm

Re: Cacti don't want to use data from SNMP

Post by AllertGen »

I've changed file in this way:

Code: Select all

function snmp_get_method($version = 1) {
        if ((function_exists("snmpget")) && ($version == 1)) {
                return SNMP_METHOD_BINARY;
        }else if ((function_exists("snmp2_get")) && ($version == 2)) {
                return SNMP_METHOD_BINARY;
        }else if ((function_exists("snmp3_get")) && ($version == 3)) {
                return SNMP_METHOD_BINARY;
        }else if ((($version == 2) || ($version == 3)) && (file_exists(read_config_option("path_snmpget")))) {
                return SNMP_METHOD_BINARY;
        }else if (function_exists("snmpget")) {
                /* last resort (hopefully it isn't a 64-bit result) */
                return SNMP_METHOD_BINARY;
        }else if (file_exists(read_config_option("path_snmpget"))) {
                return SNMP_METHOD_BINARY;
        }else{
                /* looks like snmp is broken */
                return SNMP_METHOD_BINARY;
        }
}
After this my system started working under hight load (it used 95% of system resourses). Is it normal for cacti with using snmp binary? By the way, cacti started to get information from this 2 devices...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Cacti don't want to use data from SNMP

Post by gandalf »

Well, the load issue depends on amount of SNMP requests. We therefor recommend using php-snmp. But we know, that this has some "issues". And your results show that you're facing those issues as well. So it seems to be a bug in php-snmp ...
R.
AllertGen
Posts: 37
Joined: Mon Mar 26, 2012 1:27 pm

Re: Cacti don't want to use data from SNMP

Post by AllertGen »

Well, I though "Maybe php-snmp got results in some strange way" and tryed to make a little php script:

Code: Select all

<?php
$Test = snmp3_get("10.XX.XX.XX:161", "user", authNoPriv, MD5, "pass", "", "", ".1.3.6.1.4.1.9.2.1.57.0", 3000000, 2);
print "<html><head><title>Test</title></head><body>Result is: " . $Test . " .</body></html>";
?>
But after running it got error: "Warning: snmp3_get(): An error occurred, quitting in /usr/share/cacti/site/test.php on line 3"
And I got this error from any device. Maybe I'm doing something wrong? Script has rights to be executed (+x).
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests