Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Post general support questions here that do not specifically fall into the Linux or Windows categories.
Moderators: Developers , Moderators
Superfly
Posts: 5 Joined: Mon Feb 20, 2006 9:05 am
Post
by Superfly » Thu Feb 23, 2006 1:05 am
After upgrading to version 0.8.6h. I was no longer able to get results for my CPU's or Drive/Mem info from my windows workstation. After a while of troubleshooting I discovered that PHP did not like the following include statements. I modified them to the absolute path and everything worked fine.
I turned on error reporting for "ss_host_cpu.php" and got the following message:
Code: Select all
PHP Warning: main(/var/lib/cacti/scripts/../lib/snmp.php): failed to open stream: No such file or directory in /var/lib/cacti/scripts/ss_host_cpu.php on line 7
I should also mention that I updated Cacti via Yum on fedora core 4. And that it creates sym links to the scripts directory which it places in a "/var/lib/cati/" directory. So this may be an issue in the Yum RPM build.
Before:
Code: Select all
include_once(dirname(__FILE__) . "/../lib/snmp.php");
if (!isset($called_by_script_server)) {
include_once(dirname(__FILE__) . "/../include/config.php");
array_shift($_SERVER["argv"]);
print call_user_func_array("ss_host_disk", $_SERVER["argv"]);
}
After:
Code: Select all
include_once("/usr/share/cacti/lib/snmp.php");
if (!isset($called_by_script_server)) {
include_once("/usr/share/cacti/include/config.php");
array_shift($_SERVER["argv"]);
print call_user_func_array("ss_host_disk", $_SERVER["argv"]);
}
BSOD2600
Cacti Moderator
Posts: 12171 Joined: Sat May 08, 2004 12:44 pm
Location: USA
Post
by BSOD2600 » Thu Feb 23, 2006 2:33 am
You must have something not properly configured. I'm using the following (which is basically the same as yours) in my PHP script server scripts.
Code: Select all
<?php
$no_http_headers = true;
/* display No errors */
error_reporting(E_ERROR);
include_once(dirname(__FILE__) . "/../include/config.php");
include_once(dirname(__FILE__) . "/../lib/snmp.php");
if (!isset($called_by_script_server)) {
array_shift($_SERVER["argv"]);
print call_user_func_array("ss_protocol_ip", $_SERVER["argv"]);
}
Being that you're on linux, not sure how to troublshoot... but I'm sure others do.
Superfly
Posts: 5 Joined: Mon Feb 20, 2006 9:05 am
Post
by Superfly » Thu Feb 23, 2006 6:58 am
Like I stated above, I think it is because the "scripts" directory is not located inside of the "cacti" directory. For some reason the Yum RPM puts it in "/var/lib/cacti/scripts/" while the main cacti program directory is in "/usr/share/cacti". So it is most likely an issue with the installer itself.
gandalf
Developer
Posts: 22383 Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:
Post
by gandalf » Thu Feb 23, 2006 8:49 am
Yes. Perhaps a symlink helps?
Reinhard
Superfly
Posts: 5 Joined: Mon Feb 20, 2006 9:05 am
Post
by Superfly » Thu Feb 23, 2006 8:56 am
lvm wrote: Yes. Perhaps a symlink helps?
Reinhard
There is a symlink, but when the script runs it is looking at the absolute path not the symlink path.
Here is what the directory structure looks like:
Code: Select all
-rw-r--r-- 1 apache apache 5892 Feb 7 23:24 about.php
-rw-r--r-- 1 apache apache 4773 Feb 7 23:24 auth_changepassword.php
-rw-r--r-- 1 apache apache 6189 Feb 7 23:24 auth_login.php
-rw-r--r-- 1 apache apache 13108 Feb 7 23:24 cdef.php
-rwxr-xr-x 1 apache apache 16569 Feb 7 23:24 cmd.php
-rw-r--r-- 1 apache apache 5917 Feb 7 23:24 color.php
-rw-r--r-- 1 apache apache 2753 Feb 7 23:24 copy_cacti_user.php
-rw-r--r-- 1 apache apache 17536 Feb 7 23:24 data_input.php
-rw-r--r-- 1 apache apache 28164 Feb 7 23:24 data_queries.php
-rw-r--r-- 1 apache apache 43802 Feb 7 23:24 data_sources.php
-rw-r--r-- 1 apache apache 30344 Feb 7 23:24 data_templates.php
-rw-r--r-- 1 apache apache 6110 Feb 7 23:24 gprint_presets.php
-rw-r--r-- 1 apache apache 3423 Feb 7 23:24 graph_image.php
-rw-r--r-- 1 apache apache 10498 Feb 7 23:24 graph.php
-rw-r--r-- 1 apache apache 6319 Feb 7 23:24 graph_settings.php
-rw-r--r-- 1 apache apache 11945 Feb 7 23:24 graphs_items.php
-rw-r--r-- 1 apache apache 30752 Feb 7 23:24 graphs_new.php
-rw-r--r-- 1 apache apache 46835 Feb 7 23:24 graphs.php
-rw-r--r-- 1 apache apache 10097 Feb 7 23:24 graph_templates_inputs.php
-rw-r--r-- 1 apache apache 17367 Feb 7 23:24 graph_templates_items.php
-rw-r--r-- 1 apache apache 22578 Feb 7 23:24 graph_templates.php
-rw-r--r-- 1 apache apache 23122 Feb 7 23:24 graph_view.php
-rw-r--r-- 1 apache apache 33450 Feb 7 23:24 host.php
-rw-r--r-- 1 apache apache 14236 Feb 7 23:24 host_templates.php
drwxr-xr-x 2 apache apache 4096 Feb 22 04:17 images
drwxr-xr-x 5 apache apache 4096 Feb 22 04:17 include
-rw-r--r-- 1 apache apache 2271 Feb 7 23:24 index.php
drwxr-xr-x 2 apache apache 4096 Feb 22 04:17 install
drwxr-xr-x 3 cacti apache 4096 Feb 22 04:17 lib
lrwxrwxrwx 1 root root 15 Feb 22 19:05 log -> /var/log/cacti/
-rw-r--r-- 1 apache apache 1796 Feb 7 23:24 logout.php
-rw-r--r-- 1 apache apache 4673 Feb 7 23:24 poller_commands.php
-rw-r--r-- 1 apache apache 2325 Feb 7 23:24 poller_export.php
-rwxr-xr-x 1 apache apache 9441 Feb 7 23:24 poller.php
-rw-r--r-- 1 apache apache 4343 Feb 7 23:24 poller_reindex_hosts.php
-rw-r--r-- 1 apache apache 4170 Feb 7 23:24 rebuild_poller_cache.php
drwxr-xr-x 5 apache apache 4096 Feb 22 04:17 resource
lrwxrwxrwx 1 root root 18 Feb 22 04:17 rra -> /var/lib/cacti/rra
-rw-r--r-- 1 apache apache 6622 Feb 7 23:24 rra.php
lrwxrwxrwx 1 root root 22 Feb 22 04:17 scripts -> /var/lib/cacti/scripts
-rw-r--r-- 1 apache apache 6760 Feb 7 23:24 script_server.php
-rw-r--r-- 1 apache apache 4833 Feb 7 23:24 settings.php
-rw-r--r-- 1 apache apache 6813 Feb 7 23:24 templates_export.php
-rw-r--r-- 1 apache apache 5954 Feb 7 23:24 templates_import.php
-rw-r--r-- 1 apache apache 17463 Feb 7 23:24 tree.php
-rw-r--r-- 1 apache apache 27829 Feb 7 23:24 user_admin.php
-rw-r--r-- 1 apache apache 11388 Feb 7 23:24 utilities.php
gandalf
Developer
Posts: 22383 Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:
Post
by gandalf » Sat Feb 25, 2006 8:29 am
So, unfortunately, you'll have to copy/move them to the correct location
Reinhard
Users browsing this forum: No registered users and 1 guest