Description of problem: After commenting out the error suppression: // error_reporting(E_ERROR); you can see that ss_host_disk.php script fails: /usr/bin/php /usr/share/cacti/scripts/ss_host_disk.php alexandria.cora.nwra.com 3 '2:161:500:cora0201:::MD5::[None]' query index PHP Warning: include_once(/var/lib/cacti/scripts/../include/config.php): failed to open stream: No such file or directory in /var/lib/cacti/scripts/ss_host_disk.php on line 8 PHP Warning: include_once(): Failed opening '/var/lib/cacti/scripts/../include/config.php' for inclusion (include_path='.:/usr/share/pear') in /var/lib/cacti/scripts/ss_host_disk.php on line 8 PHP Warning: include_once(/var/lib/cacti/scripts/../lib/snmp.php): failed to open stream: No such file or directory in /var/lib/cacti/scripts/ss_host_disk.php on line 10 PHP Warning: include_once(): Failed opening '/var/lib/cacti/scripts/../lib/snmp.php' for inclusion (include_path='.:/usr/share/pear') in /var/lib/cacti/scripts/ss_host_disk.php on line 10 PHP Fatal error: Call to undefined function cacti_snmp_walk() in /var/lib/cacti/scripts/ss_host_disk.php on line 59 This is because the scripts and the lib/include/rest of cacti are not in the same location. I think if you are going to split, you need links in /var/lib/cacti back to /usr/share/cacti. When I do that it works. Why the split? selinux labeling? Version-Release number of selected component (if applicable): cacti-0.8.6h-6.fc5
Was this an upgrade from a non-fedora to a fedora package?
At one point I had a different cacti, but the current install checks out: [root@wind ~]# rpm -V cacti S.5....T. c /etc/cacti/db.php S.5....T. c /etc/cron.d/cacti S.5....T. c /etc/httpd/conf.d/cacti.conf .......T. /usr/share/cacti/lib/rrd.php S.5....T. /var/lib/cacti/scripts/ss_host_disk.php S.5....T. /var/log/cacti/cacti.log My guess is that php has started resolving __FILE__ to the actual location on disk, not the name the program was started with.
The reason for the split is because of FHS standards. These files have all been properly linked back to /usr/share/cacti so they should work. I haven't been able to recreate this error. I'm guessing there was an upgrade issue from the other RPM. Is there any way you could try re-creating this on a fresh install?
The reason is simple - symlinks are used to break up the install, but some of the paths needed for these scripts to work are not symlinked. As an example, here's what happened when I executed lmsensors scripts I added: /usr/bin/php -q /usr/share/cacti/scripts/netsnmp_lmsensors.php fan ana.amantes, public, 1, , , 161, 500 query sensorDevice PHP Warning: include(/var/lib/cacti/scripts/../include/config.php): failed to open stream: No such file or directory in /var/lib/cacti/scripts/netsnmp_lmsensors.php on line 18 PHP Warning: include(): Failed opening '/var/lib/cacti/scripts/../include/config.php' for inclusion (include_path='.:/usr/share/pear') in /var/lib/cacti/scripts/netsnmp_lmsensors.php on line 18 PHP Warning: include(/var/lib/cacti/scripts/../lib/snmp.php): failed to open stream: No such file or directory in /var/lib/cacti/scripts/netsnmp_lmsensors.php on line 19 PHP Warning: include(): Failed opening '/var/lib/cacti/scripts/../lib/snmp.php' for inclusion (include_path='.:/usr/share/pear') in /var/lib/cacti/scripts/netsnmp_lmsensors.php on line 19 PHP Fatal error: Call to undefined function cacti_snmp_walk() in /var/lib/cacti/scripts/netsnmp_lmsensors.php on line 245 the lib and include dirs are in /usr/share/cacti/ and not symlinked to /var/lib/cacti like the scripts. [root@onzenbak cacti]# ln -sf /usr/share/cacti/include/ /var/lib/cacti/ [root@onzenbak cacti]# ln -sf /usr/share/cacti/lib /var/lib/cacti/ these two commands fixed it for now; it would be good to verify that the split was done correctly, and if any other mistakes were made, and an update made.
I meant to follow up but haven't had time to do a full report. Suffice to say that I can reproduce on a fresh install. I fully agree with comment #4.
Fresh install on what OS?
(In reply to comment #6) > Fresh install on what OS? FC5 with FC5 package.
Thanks, did the fix in comment #4 work for you?
The links fix part of the problems. Other issues: # /usr/bin/php -q /usr/share/cacti/scripts/ss_host_disk.php alexandria.cora.nwra.com 3 '2:161:500:cora0201:::MD5::[None]' index sh: /usr/bin/snmpbulkwalk: No such file or directory Looks like cacti should Require net-snmp-utils Also, selinux issues: Aug 31 10:48:26 scud kernel: audit(1157042906.500:325): avc: denied { read } for pid=4131 comm="sh" name="[1181676]" dev=eventpollfs ino=1181676 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=root:system_r:httpd_t:s0 tclass=file Aug 31 10:48:26 scud kernel: audit(1157042906.668:326): avc: denied { read } for pid=4131 comm="php" name="ss_host_disk.php" dev=dm-3 ino=360467 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file Changing the context of /var/lib/cacti/scripts (and contents) to httpd_sys_script_exec_t helps, but then I'm stuck on trying to get it to allow it to read the include and lib links: Aug 31 10:58:03 scud kernel: audit(1157043483.451:389): avc: denied { getattr } for pid=4451 comm="php" name="lib" dev=dm-3 ino=360620 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=root:object_r:httpd_sys_script_exec_t:s0 tclass=lnk_file Aug 31 10:58:03 scud kernel: audit(1157043483.451:390): avc: denied { read } for pid=4451 comm="php" name="lib" dev=dm-3 ino=360620 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=root:object_r:httpd_sys_script_exec_t:s0 tclass=lnk_file Aug 31 10:58:03 scud kernel: audit(1157043483.451:391): avc: denied { getattr } for pid=4451 comm="php" name="include" dev=dm-3 ino=360621 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=root:object_r:httpd_sys_script_exec_t:s0 tclass=lnk_file Aug 31 10:58:03 scud kernel: audit(1157043483.451:392): avc: denied { read } for pid=4451 comm="php" name="include" dev=dm-3 ino=360621 scontext=root:system_r:httpd_sys_script_t:s0 tcontext=root:object_r:httpd_sys_script_exec_t:s0 tclass=lnk_file
Sorry this has taken so long. I've added the symlinks as well as updated to release i. Please re-open this ticket if these issues are not fixed.