configuration problem in example.conf and cannot display MAP

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

configuration problem in example.conf and cannot display MAP

Post by dfortin0918 »

When i try to configure my file example.conf in the config file in cacti->console->management->weathermap->example.conf
I get strange notice and warning!
The result is that i cannot view my map i just get the small png view and when i click on the tumbnail maip i get a red X

Here is the error code i get when i click on example.conf:

Notice: Constant URL_PATH already defined in /usr/share/cacti/site/include/config.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 159

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 160

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 161

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 163

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /usr/share/cacti/site/include/config.php:132) in /usr/share/cacti/site/include/config.php on line 166


Tried to google and search on this forum but with non success??
Last edited by dfortin0918 on Wed Jul 02, 2008 4:14 pm, edited 1 time in total.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

It looks more like an issue with your Cacti config.php/global.php

Weathermap doesn't define or redefine URL_PATH.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

Is it normal that i do not have a global.php. I have done a search for global.php and i cannot find it!

Thanks for the help by the way :-)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

How can i validate my configuration file config.php. Is it possible to cross check with one that is working or is it "os/system specific"
Since i am running cacti 8.0.6h i am running config.php and not global.php.
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

I can see the tumbnail in weathermap tab but i cannot see the full map.
If i run php weathermap --debug --config configs/example.conf i always get 2 error that bugs me:
1- error :
configs/example.conf: Your background image file could not be read. Check the filename, and permissions, for background.png
2- error:
configs/example.conf: Using a non-existent special font (101) - falling back to internal GD fonts [WMWARN03]

1- error: the error on my background is probably the reason i cannot see the map in the weathermap tab under the tumbnail.
So i have check the permission for the configs/ folder and i have changed them to 777 and cacti www-data for the folder. still not working
question: do i have to copy all the content of the docs/example/* in the /configs/ folder and if not where should i copy them?

2 error- I assume that the same reason my background.png is not accessible will apply to the font not accessible.


Thanks for your help
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dfortin0918 wrote:I can see the tumbnail in weathermap tab but i cannot see the full map.
If i run php weathermap --debug --config configs/example.conf i always get 2 error that bugs me:
1- error :
configs/example.conf: Your background image file could not be read. Check the filename, and permissions, for background.png
2- error:
configs/example.conf: Using a non-existent special font (101) - falling back to internal GD fonts [WMWARN03]

1- error: the error on my background is probably the reason i cannot see the map in the weathermap tab under the tumbnail.
So i have check the permission for the configs/ folder and i have changed them to 777 and cacti www-data for the folder. still not working
question: do i have to copy all the content of the docs/example/* in the /configs/ folder and if not where should i copy them?

2 error- I assume that the same reason my background.png is not accessible will apply to the font not accessible.


Thanks for your help
If you use filenames without a path, then put those files in the main weathermap folder.

If you specify a background image and it can't be loaded, you should still get a map, but with a white background. The 'permissions' part of that error is talking about the permissions for the background image file, not the config file, but it's most likely just in the wrong place, by the sound of it.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

I have transferd all docs/example/* in the main weathermap dir but i still have problem.
I have check in the error log of apache2 and i see a problem:
[Thu Jul 03 09:58:56 2008] [error] [client xx.xx.xx.xx] File does not exist: /var/www/usr, referer: http://xx.xx.xx.xx/cacti/plugins/weathe ... 6c640ee6ea

I do not have any thing in the "var/www/usr !!
Should i have a symbolic link pointing to the weathermap/output/ folder??

Thanks
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Are you using a pathname somewhere where a URL is expected?

OVERLIBGRAPH and INFOURL should be URLs...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

thanks for your help by the way very apreciated..
I have solved one of my problem...
Now i can see the map when i click on the thumbnail...
When i started looking in the error log of apache i saw immediatly the error /var/www/usr not found
so i created a sym link to /usr in my /var/www/ folder
now my map is showned.

If i refer to your previous post you were talking of :
-----------
+Are you using a pathname somewhere where a URL is expected?
+OVERLIBGRAPH and INFOURL should be URLs...
------------
i found those variables in example.conf and they point to a url:
OVERLIBGRAPH http://support.mynet.net/cacti/graph_im ... aph_width=


now i will attack the error i have when i try to configure the example.conf every time i click on example.conf i get multiple warning and notice you have refered as cacti error file config.php not correct.
question: how can i correct the config.php file and can you point me to a correct one if possible.

Thanks
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dfortin0918 wrote: Now i can see the map when i click on the thumbnail...
When i started looking in the error log of apache i saw immediatly the error /var/www/usr not found
so i created a sym link to /usr in my /var/www/ folder
now my map is showned.
You should not have to do this.

Have you made some change in config.php or plugins.php to do with url_path or similar when you installed the Plugin Architecture? I think you might have a put a file path in there where you should have put a URL.

Weathermap uses the url_path to construct URLs for the thumbnail view. It sounds like those links contains "/usr", which must be coming from somewhere like an incorrect change in the Cacti config.

I think that if you fix this, all your problems will go away, and you won't need that symlink. Besides, you have just made your whole /usr available on your webserver, which is a pretty bad security problem.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

Ok one step further...
after looking in the outputs/f638375cc847e905a3d6.html we realized that the file was pointing to
-----
src="/usr/share/cacti/site/plugins/weathermap/weathermap-cacti-plugin.php?action=viewimage&id=f638375cc847e905a3d6&time=1215026705"
------------

if i modify this file and put /cacti insted on /usr/share/cacti/site it works without adding a symbolic link in /var/www/

I have tried to find the source that was creating the base_dir (/usr/share/cacti/site/plugins/weathermap) and i realize that i cannot find it...

I have followed fron the beginning the process from the creation with php weathermap --debug --config configs/example.conf looking for base_dir in example.conf then looking in weathermap.php but without success

Can you please point me where this is happeinig I think i am close!!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

dfortin0918 wrote: Can you please point me where this is happeinig I think i am close!!
I already did!

Look in includes/config.php or includes/plugins.php

Somewhere, you have set a variable called url_path to a file path and it should be a URL. Either that, or the PA is getting it wrong for you. So something has "/usr/share/cacti/site/" where it should have "http://yourserver/cacti/" (or whatever it is), and that's not weathermap.

It's been a while since I used 0.8.6, but didn't you set a path in config.php when you first set up the plugin architecture?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

ok newflash...
now we have found where the image_src is taken in the dd6a91efd42aab9fdb2f.html file!
seems like when we execute the php poller.php from a location like /usr/share/cacti/site/plugins/weathermap the img src execute from this location.
<img src="../../plugins/weathe
rmap/weathermap-cacti-plugin.php?action=viewimage&id=dd6a91efd42aab9fdb2f

So we have put a bandade in the crontab for the cacti user
*/5 * * * * cd /usr/share/cacti/site/plugins/weathermap ; ../../poller.php >/dev/null 2>/var/log/cacti/poller-error.log

and this fixed the issue!
IS THIS NORMAL ....
Does someone have a clue???
dfortin0918
Posts: 9
Joined: Wed Jun 25, 2008 1:44 pm

Post by dfortin0918 »

This is my path in the include/config.php

$config['url_path'] = implode('/', array_slice($a, 0, $i)) . '/';
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest