Subject: [Pkg-cacti-maint] Bug#704011: cacti: Fails to execute PHP SNMP query scripts

From: Jaap Winius <[email-masked]>
Date: Tue, 26 Mar 2013 21:23:27 +0100

Package: cacti
Version: 0.8.8a+dfsg-3
Severity: important

Dear Maintainer,

After performing an in-place upgrade on my server from Debian squeeze to wheezy, Cacti was no longer able to gather any data. I tried executing some of Cacti's PHP scripts separately, but they could retrieve no SNMP data.

In an attempt to find the cause of the problem, I downgraded php5-snmp 5.4.4 to 5.3.3. This fixed the problem: the scripts worked again and Cacti worked again. However, it results in a serious dependency problem, so is not really a solution.

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages cacti depends on:
ii  dbconfig-common                          1.8.47+nmu1
ii  debconf [debconf-2.0]                    1.5.49
ii  libapache2-mod-php5                      5.4.4-14
ii  libphp-adodb                             5.15-1
ii  mysql-client-5.5 [virtual-mysql-client]  5.5.28+dfsg-1
ii  perl                                     5.14.2-20
ii  php5-cgi                                 5.4.4-14
ii  php5-cli                                 5.4.4-14
ii  php5-mysql                               5.4.4-14
ii  php5-snmp                                5.4.4-14
ii  rrdtool                                  1.4.7-2
ii  snmp                                     5.4.3~dfsg-2.7
ii  ucf                                      3.0025+nmu3

Versions of packages cacti recommends:
ii  apache2                      2.2.22-13
ii  apache2-mpm-prefork [httpd]  2.2.22-13
ii  iputils-ping                 3:20101006-1+b1
ii  libjs-jquery                 1.7.2+dfsg-1
ii  libjs-jquery-cookie          6-1
ii  logrotate                    3.8.1-4
ii  mysql-server                 5.5.28+dfsg-1

Versions of packages cacti suggests:
ii  moreutils  0.47
ii  php5-ldap  5.4.4-14

-- debconf information:
  cacti/password-confirm: (password omitted)
  cacti/app-password-confirm: (password omitted)
  cacti/mysql/admin-pass: (password omitted)
  cacti/mysql/app-pass: (password omitted)
* cacti/db/app-user: cacti
* cacti/mysql/admin-user: root
  cacti/upgrade-backup: true
  cacti/install-error: abort
* cacti/webserver: apache2
  cacti/internal/reconfiguring: false
* cacti/mysql/method: unix socket
  cacti/remote/host:
  cacti/upgrade-error: abort
  cacti/dbconfig-upgrade: true
  cacti/internal/skip-preseed: false
  cacti/remote/newhost:
  cacti/purge: false
  cacti/passwords-do-not-match:
  cacti/dbconfig-remove:
* cacti/dbconfig-install: true
  cacti/missing-db-package-error: abort
  cacti/database-type: mysql
  cacti/remove-error: abort
* cacti/db/dbname: cacti
  cacti/remote/port:
  cacti/dbconfig-reinstall: false

---

From: Paul Gevers <[email-masked]>
Date: Tue, 26 Mar 2013 22:32:44 +0100

Hi Jaap,

Could you please increase the Poller Logging Level in the General
Settings to Debug or High for at least one cacti run and post the
content of the relevant part of /var/log/cacti/cacti.log
/var/log/cacti/poller_error.log and /var/log/cacti/rrd.log ? Maybe there
is useful information there.

An other option might be to check what the output is of a manual run of
the poller:
php /usr/share/cacti/site/poller.php

Paul

---

From: Jaap Winius <[email-masked]>
Date: Wed, 27 Mar 2013 01:08:48 +0100

Quoting Paul Gevers <[email-masked]>:

> content of the relevant part of /var/log/cacti/cacti.log ...

See attachment, cacti.log.gz, for one cacti run at debug level.

> ... /var/log/cacti/poller_error.log ...

It just contains the following error, over and over again:

Mar 25 22:50:04 PHP Warning:  PHP Startup: Unable to load dynamic  
library '/usr/lib/php5/20100525+lfs/snmp.so' -  
/usr/lib/php5/20100525+lfs/snmp.so: cannot open shared object file: No  
such file or directory in Unknown on line 0

Yet this file is present, it's 46712 bytes in size, has owner root and  
permissions 644. It's also part of the php5-snmp package.

> ... and /var/log/cacti/rrd.log ? Maybe there is useful information there.

This file exists, but is empty.

> the poller: php /usr/share/cacti/site/poller.php

That usually gives no output, but sometimes says e.g.:

OK u:0.00 s:0.01 r:1.28
03/27/2013 01:04:19 AM - SYSTEM STATS: Time:1.4655 Method:cmd.php  
Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:106  
RRDsProcessed:1

Cheers,

Jaap

---

From: Paul Gevers <[email-masked]>
Date: Wed, 27 Mar 2013 20:25:49 +0100

retitle 704011 php5-snmp: php fails to load snmp.so (i386)
reassign 704011 php5-snmp 5.4.4-14
thanks

> permissions 644. It's also part of the php5-snmp package.

Clearly this is (part of) the issue. Something is going wrong during php
startu. I reassign this bug to php5-snmp, so some php experts can have a
look.

@php5-snmp maintainers: any hint on how to debug this properly? If you
think this is still a Cacti bug, don't hesitate to reassign back.

Paul

---

From: [email-masked] (Debian Bug Tracking System)
Date: Wed, 27 Mar 2013 19:27:20 +0000

> retitle 704011 php5-snmp: php fails to load snmp.so (i386)
Bug #704011 [cacti] cacti: Fails to execute PHP SNMP query scripts
Changed Bug title to 'php5-snmp: php fails to load snmp.so (i386)' from 'cacti: Fails to execute PHP SNMP query scripts'
> reassign 704011 php5-snmp 5.4.4-14
Bug #704011 [cacti] php5-snmp: php fails to load snmp.so (i386)
Bug reassigned from package 'cacti' to 'php5-snmp'.
No longer marked as found in versions cacti/0.8.8a+dfsg-3.
Ignoring request to alter fixed versions of bug #704011 to the same values previously set
Bug #704011 [php5-snmp] php5-snmp: php fails to load snmp.so (i386)
Marked as found in versions php5/5.4.4-14.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
704011: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704011
Debian Bug Tracking System
Contact [email-masked] with problems