|
It is currently Tue Feb 07, 2012 4:41 pm
|
View unanswered posts | View active topics
:::SOLVED::: Cacti Plugin Arch Problems - Ubuntu Server 8.04
| Author |
Message |
|
simualcra
New User
Joined: Tue Aug 05, 2008 9:27 am Posts: 7
|
 :::SOLVED::: Cacti Plugin Arch Problems - Ubuntu Server 8.04
Greetings,
I wanted to try my hand at the Cacti Plugin Architecture and use the Nagios plugin. I have noticed that there are issues around the board regarding Ubuntu 8.04 installations.
Using prepatched files I receive this error in browser:
Invalid PHP_SELF Path
When I go through the process of patching I receive a different error:
Fatal error: Call to undefined function api_plugin_hook() in /usr/share/cacti/site/include/global_arrays.php on line 620
Each case that references these errors in the forum is running Ubuntu. I pray that someone can help track down the source of this issue. Thanks in advance.
Brian
Last edited by simualcra on Thu Aug 14, 2008 6:50 pm, edited 1 time in total.
|
| Thu Aug 07, 2008 10:01 pm |
|
 |
|
diagnostix
New User
Joined: Thu Aug 14, 2008 2:29 am Posts: 2
|
Not sure if this helps...
I had the same problem with the Invalid PHP_SELF Path problem after I did the pre-patch method.
I solved it by changing some lines in the global.php file.
See this article: http://www.askaboutphp.com/tutorials/42/cacti-ubuntu-cacti-plugin-invalid-php_self-path.html
but i didn't do the patch method.
|
| Thu Aug 14, 2008 2:50 am |
|
 |
|
simualcra
New User
Joined: Tue Aug 05, 2008 9:27 am Posts: 7
|
 Almost there...
I followed the instructions very closely. The site does come back up, but I lose most of the functionality. The links are no longer pointing to my /cacti/ directory, but attempting to link directly from the root of the site. I think I can track that down. I'll let you know if I'm successful.
Thanks for the heads up!
Brian
|
| Thu Aug 14, 2008 6:32 pm |
|
 |
|
simualcra
New User
Joined: Tue Aug 05, 2008 9:27 am Posts: 7
|
 Solved
Once all of the files have been loaded into the appropriate directories there are a few needed edits to the /usr/share/cacti/site/include/global.php file.
Choose your favorite editor and make these changes:
At line 56:
$config[’url_path’] = ‘/’;
change it to:
$config[’url_path’] = ‘/cacti/’;
At line 104:
$config["rra_path"] = $config["base_path"]."/rra";
change it to:
$config["rra_path"] = "/var/lib/cacti/rra";
At line 128 where it says:
$_SERVER["PHP_SELF"]
change it to:
basename($_SERVER["PHP_SELF"])
At line 201:
include($config["library_path"]."/adodb/adodb.inc.php");
change it to:
include("/usr/share/php/adodb/adodb.inc.php");
Thank you 'diagnostix' for the link, and thanks to whoever wrote the fix at:
http://www.askaboutphp.com/tutorials/42 ... -path.html
Sincerely,
Brian
|
| Thu Aug 14, 2008 6:48 pm |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
 patch err
I do this:
Code: install Ubuntu 8.04 server with ssh sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install mysql-server sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install php5-mysql sudo apt-get install php5-gd sudo apt-get install phpmyadmin sudo apt-get install patch sudo apt-get install cacti-cactid but : Code: sudo patch -p1 -N --dry-run < /home/patrick/cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff patching file auth_changepassword.php patching file auth_login.php patching file data_sources.php patching file graph_image.php patching file graph.php patching file graphs_new.php patching file graphs.php patching file host.php patching file include/auth.php patching file include/global_arrays.php patching file include/global_form.php patching file include/global.php Hunk #3 FAILED at 194. 1 out of 4 hunks FAILED -- saving rejects to file include/global.php.rej patching file include/global_settings.php Hunk #1 succeeded at 1084 (offset 1 line). patching file include/plugins.php patching file include/top_graph_header.php patching file include/top_header.php patching file index.php patching file lib/api_device.php patching file lib/functions.php patching file lib/html_form.php patching file lib/html.php patching file lib/html_tree.php patching file lib/plugins.php patching file lib/poller.php patching file lib/rrd.php patching file lib/variables.php patching file plugins/index.php patching file plugins.php patching file poller.php patching file user_admin.php patching file utilities.php
How?
|
| Mon Aug 25, 2008 8:12 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
 Using the Patch
if I am Using the Patch anyway.
Code: sudo patch -p1 -N < /home/patrick/cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff Code: sudo vi ./include/global.php change Code: $config['url_path'] = '/'; to Code: $config['url_path'] = '/cacti/'; but, http://cacti_IP/cacti/Code: Fatal error: Call to undefined function api_plugin_hook() in /usr/share/cacti/site/include/global_arrays.php on line 620
Last edited by nationals on Mon Aug 25, 2008 9:36 am, edited 1 time in total.
|
| Mon Aug 25, 2008 9:12 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
 Using the Pre-Patched Files
If I Using the Pre-Patched Files.
Code: sudo cp -rf /home/patrick/cacti-plugin-arch/files-0.8.7b/* /usr/share/cacti/site/ Code: sudo vi ./include/global.php change Code: $config['url_path'] = '/'; to Code: $config['url_path'] = '/cacti/'; but, http://cacti_IP/cacti/ Code: Invalid PHP_SELF Path edits the /usr/share/cacti/site/include/global.php file.
Choose your favorite editor and make these changes:
At line 56: $config[’url_path’] = ‘/’; change it to: $config[’url_path’] = ‘/cacti/’;
At line 104: $config["rra_path"] = $config["base_path"]."/rra"; change it to: $config["rra_path"] = "/var/lib/cacti/rra";
At line 128 where it says: $_SERVER["PHP_SELF"] change it to: basename($_SERVER["PHP_SELF"])
At line 201: include($config["library_path"]."/adodb/adodb.inc.php"); change it to: include("/usr/share/php/adodb/adodb.inc.php"); It is the same show. Code: Invalid PHP_SELF Path
|
| Mon Aug 25, 2008 9:19 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
 diff
I have modify the cacti-plugin-0.8.7b-PA-v2.1.diff for the cacti 0.87b on ubuntu.
pls download at :
http://forums.cacti.net/viewtopic.php?t ... highlight=
Last edited by nationals on Thu Oct 09, 2008 10:38 pm, edited 1 time in total.
|
| Tue Aug 26, 2008 10:53 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
Code: sudo patch -p1 -N --dry-run < cacti-plugin-0.8.7b-PA-v2.1.diff if no ERR, Code: sudo patch -p1 -N < cacti-plugin-0.8.7b-PA-v2.1.diff then Code: vi /usr/share/cacti/site/include/global.php $database_username = " cacti"; $database_password = " cactipwd"; and don't forget to import the pa.sql. Code: sudo mysql cacti -u cacti -p < pa.sql
and then go on with the plugins install.
just tar the plugins file to ./plugins/
but I have 2 err.
when I login or logoff the system.
It show as the attechment:
Attachments:
Err-0.JPG [ 77.68 KiB | Viewed 7486 times ]
|
| Tue Aug 26, 2008 10:59 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
after run for a long time, the err missing.
|
| Tue Aug 26, 2008 11:38 pm |
|
 |
|
jimmy
Site Admin
Joined: Thu Nov 11, 2004 11:12 am Posts: 2007
|
Are you using the RPM / APT-Get / Packaged version of Cacti that does not come from the Cacti site? If so it is not supported by the Plugin Architecture.
|
| Sun Sep 07, 2008 10:35 am |
|
 |
|
nationals
New User
Joined: Mon Aug 25, 2008 8:06 am Posts: 12
|
I used the apt-get,
and I have fix the problem. have a look with my other post.
thanks.
updated file.
|
| Sun Sep 07, 2008 8:12 pm |
|
 |
|
incudie
New User
Joined: Fri Oct 24, 2008 12:48 pm Posts: 3
|
Hey Nationals,
Thank you very much for the patch, I was able to install it on my Ubuntu 8.04 Server (Apt-get Cacti edition) without any problems.
I am trying to track down a plugin permission problem I have had since then and was curious if you have had the same problem.
When you create a limited user in Cacti and give them realm permissions of only "View Graphs" and "Monitor". Do you have a problem with that user seeing extra tabs?
In this case the new users see some of my other plugins tabs even though they don't have realm permissions to it. They can not access it, they only see the tab on top.
The other issue is, if I had a new plugin (in this case, "Superlinks") I can not add it for the limited users to see.
Just wanted to check if you have a similar problem.
For kicks, here is my server info:
Quote: Cacti Version - 0.8.7b Plugin Architecture - 2.1 Poller Type - Cactid v Server Info - Linux 2.6.24-19-server Web Server - Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch PHP - 5.2.4-2ubuntu5.3 PHP Extensions - zip, xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, SimpleXML, sockets, soap, SPL, shmop, standard, Reflection, posix, mime_magic, mbstring, json, iconv, hash, gettext, ftp, filter, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, snmp MySQL - 5.0.51a-3ubuntu5.1 RRDTool - 1.2.19 SNMP - 5.4.1 PluginsRead-only Devices Tab (devices - v0.4) Host Info (hostinfo - v0.2) logininfo Login Page Mod (loginmod - v1.0) Device Monitoring (monitor - v0.8.2) Global Plugin Settings (settings - v0.5) SuperLinks (superlinks - v0.72) Network Tools (tools - v0.3)
Thanks and Regards,
Incudie
|
| Fri Oct 24, 2008 12:54 pm |
|
 |
|
runlikeanantelope
New User
Joined: Thu Feb 22, 2007 2:37 pm Posts: 6
|
I have Ubuntu 8.04 Server and install using:
apt-get install cacti
I downloaded your patch it and it works. I then downloaded the monitor plugin and I have the option to "monitor host" now, but when I click save, at the top, I get:
Error: Save Failed.
Does this point to a permissions error? I updated the global.php file after doing the patch.
I should also note that even if I uncheck the monitor option, it still says the error about save failed. Its not until I comment out that plugin in the global.php file that I can add or update a host again.
|
| Fri Oct 24, 2008 2:58 pm |
|
 |
|
incudie
New User
Joined: Fri Oct 24, 2008 12:48 pm Posts: 3
|
If it helps, here are my permissions and I do not have that issue.
Code: $ ls -l total 776 -rw-r--r-- 1 root root 6387 2008-02-13 14:07 about.php -rw-r--r-- 1 root root 4703 2008-10-21 15:57 auth_changepassword.php -rw-r--r-- 1 root root 11868 2008-10-21 15:57 auth_login.php -rw-r--r-- 1 root root 12960 2008-02-13 14:07 cdef.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 cli -rwxr-xr-x 1 root root 18369 2008-02-13 14:07 cmd.php -rw-r--r-- 1 root root 5765 2008-02-13 14:07 color.php -rw-r--r-- 1 root root 23279 2008-02-13 14:07 data_input.php -rw-r--r-- 1 root root 33923 2008-02-13 14:07 data_queries.php -rw-r--r-- 1 root root 49345 2008-10-21 15:57 data_sources.php -rw-r--r-- 1 root root 31304 2008-02-13 14:07 data_templates.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 docs -rw-r--r-- 1 root root 5958 2008-02-13 14:07 gprint_presets.php -rw-r--r-- 1 root root 3446 2008-10-21 15:57 graph_image.php -rw-r--r-- 1 root root 12106 2008-10-21 15:57 graph.php -rw-r--r-- 1 root root 7716 2008-02-13 14:07 graph_settings.php -rw-r--r-- 1 root root 13828 2008-02-13 14:07 graphs_items.php -rw-r--r-- 1 root root 37183 2008-10-21 15:57 graphs_new.php -rw-r--r-- 1 root root 50907 2008-10-21 15:57 graphs.php -rw-r--r-- 1 root root 9945 2008-02-13 14:07 graph_templates_inputs.php -rw-r--r-- 1 root root 18482 2008-02-13 14:07 graph_templates_items.php -rw-r--r-- 1 root root 25042 2008-02-13 14:07 graph_templates.php -rw-r--r-- 1 root root 29052 2008-02-13 14:07 graph_view.php -rw-r--r-- 1 root root 5758 2008-02-13 14:07 graph_xport.php -rw-r--r-- 1 root root 50696 2008-10-21 15:57 host.php -rw-r--r-- 1 root root 18045 2008-02-13 14:07 host_templates.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 images drwxr-xr-x 5 root root 4096 2008-10-21 15:57 include -rw-r--r-- 1 root root 2313 2008-10-21 15:57 index.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 install drwxr-xr-x 2 root root 4096 2008-10-21 15:57 lib -rw-r--r-- 1 root root 2451 2008-02-13 14:07 logout.php drwxr-xr-x 11 root root 4096 2008-10-24 09:40 plugins -rw-r--r-- 1 root root 14967 2008-10-21 15:57 plugins.php -rw-r--r-- 1 root root 4306 2008-02-13 14:07 poller_commands.php -rw-r--r-- 1 root root 2243 2008-02-13 14:07 poller_export.php -rwxr-xr-x 1 root root 15178 2008-10-21 15:57 poller.php lrwxrwxrwx 1 root root 11 2008-10-21 14:09 resource -> ../resource -rw-r--r-- 1 root root 7084 2008-02-13 14:07 rra.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 scripts -rw-r--r-- 1 root root 7304 2008-02-13 14:07 script_server.php -rw-r--r-- 1 root root 4996 2008-02-13 14:07 settings.php -rw-r--r-- 1 root root 6667 2008-02-13 14:07 templates_export.php -rw-r--r-- 1 root root 6524 2008-02-13 14:07 templates_import.php -rw-r--r-- 1 root root 17835 2008-02-13 14:07 tree.php -rw-r--r-- 1 root root 42240 2008-10-21 15:57 user_admin.php -rw-r--r-- 1 root root 48973 2008-10-21 15:57 utilities.php
Code: $ ls -l total 40 drwxr-xr-x 3 root root 4096 2008-10-21 16:10 clog drwxr-xr-x 3 root root 4096 2006-03-17 01:02 devices drwxr-xr-x 2 root root 4096 2008-10-21 16:06 hostinfo -rw-r--r-- 1 root root 44 2008-10-21 15:57 index.php drwxr-xr-x 2 root root 4096 2008-10-21 16:12 loginmod drwxr-xr-x 4 root root 4096 2008-10-21 16:00 monitor drwxr-xr-x 3 root root 4096 2008-10-21 16:18 settings drwxr-xr-x 5 root root 4096 2008-01-16 15:57 superlinks drwxr-xr-x 3 root root 4096 2008-10-21 16:27 thold drwxr-xr-x 2 root root 4096 2008-10-21 16:35 tools
$ ls -l monitor/ total 96 drwxr-xr-x 2 root root 4096 2008-10-21 16:00 images -rw-rw-rw- 1 root root 44 2007-12-23 21:53 index.php -rw-rw-rw- 1 root root 15237 2007-12-23 21:53 LICENSE -rw-rw-rw- 1 root root 28660 2007-12-23 21:53 monitor.php -rw-rw-rw- 1 root root 196 2007-12-23 21:53 monitor.sql -rw-rw-rw- 1 root root 3067 2007-12-23 21:53 README -rw-rw-rw- 1 root root 10904 2007-12-23 21:53 setup.php drwxr-xr-x 2 root root 4096 2008-10-21 16:00 sounds -rw-rw-rw- 1 root root 17143 2007-12-23 21:53 wz_tooltip.js
Code: /usr/share/cacti/site/include$ ls -l total 208 -rw-r--r-- 1 root root 4340 2008-10-21 15:57 auth.php -rw-r--r-- 1 root root 1923 2008-02-13 14:07 bottom_footer.php -rw-r--r-- 1 root root 1798 2008-04-15 09:11 config.php -rw-r--r-- 1 root root 15843 2008-10-21 15:57 global_arrays.php -rw-r--r-- 1 root root 5852 2008-02-13 14:07 global_constants.php -rw-r--r-- 1 root root 37460 2008-10-21 15:57 global_form.php -rw-r--r-- 1 root root 7956 2008-10-24 10:45 global.php -rw-r--r-- 1 root root 40548 2008-10-21 15:57 global_settings.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 html drwxr-xr-x 3 root root 4096 2008-10-21 14:09 jscalendar -rw-r--r-- 1 root root 8460 2008-02-13 14:07 layout.js -rw-r--r-- 1 root root 7022 2008-02-13 14:07 main.css -rw-r--r-- 1 root root 824 2008-10-21 15:57 plugins.php -rw-r--r-- 1 root root 11263 2008-10-21 15:57 top_graph_header.php -rw-r--r-- 1 root root 5200 2008-10-21 15:57 top_header.php drwxr-xr-x 2 root root 4096 2008-10-21 14:09 treeview -rw-r--r-- 1 root root 22367 2008-02-13 14:07 zoom.js
|
| Fri Oct 24, 2008 4:32 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|