Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[SOLVED] Inclusion Error when creating new device

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
next2you



Joined: 01 Feb 2008
Posts: 7

PostPosted: Fri Feb 08, 2008 5:08 am    Post subject: [SOLVED] Inclusion Error when creating new device Reply with quote

Hi,

just wanted to create a new device (a General SMTP) and got this error:


Code:


Notice: Undefined index: notes in /var/www/cacti.logicunited.com/htdocs/cacti/host.php on line 227

Notice: Undefined variable: snmp_auth in /var/www/cacti.logicunited.com/htdocs/cacti/lib/snmp.php on line 317

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti.logicunited.com/htdocs/cacti/host.php:227) in /var/www/cacti.logicunited.com/htdocs/cacti/host.php on line 231

Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Fri Feb 08, 2008 8:34 am    Post subject: Reply with quote

This is which version on SVN, please (main branch? Commit#?)
Reinhard
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Fri Feb 08, 2008 8:35 am    Post subject: Reply with quote

I have the same issue with 'main' revision 4475.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Fri Feb 08, 2008 8:40 am    Post subject: Reply with quote

Thx, Frederic. Will fix it this weekend
Reinhard
Back to top
next2you



Joined: 01 Feb 2008
Posts: 7

PostPosted: Fri Feb 08, 2008 9:44 am    Post subject: Reply with quote

Sorry, yes, 4475 main (trunk) revision.

Christian
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Fri Feb 08, 2008 12:28 pm    Post subject: Reply with quote

Which set of snmp parameters are you using? Either SNMP V1 or "no path to snmpbulkwalk used" or both?
Reinhard
Back to top
next2you



Joined: 01 Feb 2008
Posts: 7

PostPosted: Fri Feb 08, 2008 2:16 pm    Post subject: Reply with quote

The Generic SNMP enabled host was configured with "SNMP Version: Not used",
now it is configured with Version 1, but I still get an error when creating a device (even with no template)
Code:

Notice: Undefined index: notes in /var/www/cacti.logicunited.com/htdocs/cacti/host.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti.logicunited.com/htdocs/cacti/host.php:227) in /var/www/cacti.logicunited.com/htdocs/cacti/host.php on line 231


looks like the host_template should have a field called notes, but it is not in the database (at least not in mine)
Code:

                        $host_template["ping_retries"], $host_template["notes"],


Christian
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Fri Feb 08, 2008 3:06 pm    Post subject: Reply with quote

There is an error with host_template["notes"] not being initialized. This is fixed by now but not yet committed (will do asap).
There's an upgrade script in the install directory which performes some required database updates. But if your version already was 088 before the last changes, it will not be called. To cure this, set the version (table version has only one entry) back to 0.8.6j. Then, the upgrade will be called again. You may ignore messages for table updates that already were performed before.
Yet I'm concerned about the error related to $snmp_auth
Reinhard
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Mon Feb 11, 2008 3:08 am    Post subject: Reply with quote

Hello Reinhard

wow, lots ot commits to SVN this week-end

I still have this error on a clean installation of 'main' branch 4506 :
Quote:
Notice: Undefined index: notes in /home/cactiuser/cacti-svn/host.php on line 227

Warning: Cannot modify header information - headers already sent by (output started at /home/cactiuser/cacti-svn/host.php:227) in /home/cactiuser/cacti-svn/host.php on line 231

I've made this simple modification and it seems to work :
Code:
--- host.php.orig       2008-02-05 09:00:21.000000000 +0100
+++ host.php    2008-02-11 09:08:00.000000000 +0100
@@ -224,7 +224,7 @@
                        "",
                        $host_template["availability_method"], $host_template["ping_method"],
                        $host_template["ping_port"], $host_template["ping_timeout"],
-                       $host_template["ping_retries"], $host_template["notes"],
+                       $host_template["ping_retries"], "",
                        $host_template["snmp_auth_protocol"], $host_template["snmp_priv_passphrase"],
                        $host_template["snmp_priv_protocol"], $host_template["snmp_context"], $host_template["max_oids"]);

@@ -1387,4 +1387,4 @@
        draw_actions_dropdown($device_actions);
 }
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Mon Feb 11, 2008 3:21 am    Post subject: Reply with quote

Sorry, I was still using SVN 4475

It works fine with 4506
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Tue Feb 12, 2008 4:22 pm    Post subject: Reply with quote

Yep, again an initialization error ...
But I fixed it as you've seen by now.
But still I don't like it. When changing snmp parameters for a host after it has been created, you still have to re-index all data queries; ugly. This will have to be changed soon
Reinhard
Back to top
mag



Joined: 14 Feb 2008
Posts: 1

PostPosted: Thu Feb 14, 2008 2:34 pm    Post subject: Reply with quote

gandalf wrote:
There is an error with host_template["notes"] not being initialized. This is fixed by now but not yet committed (will do asap).
There's an upgrade script in the install directory which performes some required database updates. But if your version already was 088 before the last changes, it will not be called. To cure this, set the version (table version has only one entry) back to 0.8.6j. Then, the upgrade will be called again. You may ignore messages for table updates that already were performed before.
Yet I'm concerned about the error related to $snmp_auth
Reinhard


It looks like there is no conditional case for when snmp_version == '0' in cacti_snmp_walk. snmp_auth is never declared, hence the warning when it is used to build the cli string on line 317.

I just did this:

Code:
*** /usr/local/src/cacti-0.8.7b/lib/snmp.php    2008-02-11 16:57:48.000000000 -0800
--- /usr/local/cacti/lib/snmp.php       2008-02-14 11:30:59.000000000 -0800
***************
*** 225,230 ****
--- 225,231 ----
  function cacti_snmp_walk($hostname, $community, $oid, $version, $username, $password, $auth_proto, $priv_pass, $priv_proto, $context, $port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER) {
        global $config;

+       $snmp_auth = '';
        $snmp_array = array();
        $temp_array = array();
[/code]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group