cannot add graph in weathermap was working fine

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

cannot add graph in weathermap was working fine

Post by anmomin1 »

Hi Howie,

The savior... need help.. all of the sudden I can't add map .. and getting following error:

/var/log/httpd/error_log
[error] [client XXX.XXX.XXX.XXX] PHP Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 861, referer: http://XXX.XXX.XXX.XXX/cacti/plugins/we ... n-mgmt.php


Weathermap version 0.98
PHP Version 5.3.3
PHP OS Linux
Cacti Version 0.8.8h
Cacti OS unix
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.3.x

I had all graphs working don't want to recreate them again.. not sure what happened that caused above error.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

Post by Howie »

It thinks the file doesn't exist (or at least it couldn't open it).

What are the permissions for the file? Is it readable by the web server user?
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!)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cannot add graph in weathermap was working fine

Post by netniV »

Code should be checking for a false, but a false does normally mean that either the path is invalid or you have no access to that resource.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

Post by Howie »

Yep - the error checking could definitely be better (I thought it used is_readable() in the calling function actually), and so could the error message, but the cause seems to be either permissions (or possibly selinux).

If it's just for this one map, most likely permissions.
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!)
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

Thanks guys for response...
I have cacti cacti owning there directory
with chmod 777 ( i know it's not preferred) but that's the only way i can get my cacti to work...
Also I have added apache user to cacti group...
uid=48(apache) gid=48(apache) groups=48(apache),1000(cacti)

so that i don't need to change ownership...

It was working fine.. and current maps are update and working fine.. it's just when I try to add that's where it run into the issue...
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

JUst to clarify... when I click or ADD that's where I get hour glass it doesn't take me to list of maps at all...
and when I do tail -f error.log it crazy filling logs that eventually cacti died ..
then I need to remove error.log and restart httpd service to bring service back on...

Please check attached file...

Howie wrote:Yep - the error checking could definitely be better (I thought it used is_readable() in the calling function actually), and so could the error message, but the cause seems to be either permissions (or possibly selinux).

If it's just for this one map, most likely permissions.
Attachments
weathermap-add-map-issue-log-file.png
weathermap-add-map-issue-log-file.png (266.86 KiB) Viewed 4236 times
weathermap-add-map-issue-screenshoot.png
weathermap-add-map-issue-screenshoot.png (99.33 KiB) Viewed 4236 times
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

Issue resolved...
Thanks Guys...

I found ownership were changed for files in /configs folder... Not sure the reason...

I am running into another issue with weathermap ,, when other user (other than admin) access weathermap they can see map without any issue,,, but when they mouse over to see graph it doesn't load...
what I am missing now,,

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

Re: cannot add graph in weathermap was working fine

Post by Howie »

They need to have permission in Cacti to see the graphs too. Do they?
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!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

Post by Howie »

Are you saying you have a 300MB error log of just this message over and over?

Code: Select all

[error] [client XXX.XXX.XXX.XXX] PHP Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 861, referer: http://XXX.XXX.XXX.XXX/cacti/plugins/we ... n-mgmt.php
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!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

Post by Howie »

Also, it seems like you have found a bug if non-admin users can see the maps in the list above, since they are all accessible by admin only! :-)
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!)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cannot add graph in weathermap was working fine

Post by netniV »

Unless he was the admin?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

That got resolve after I fixed owndership on file under /configs .


Howie wrote:Are you saying you have a 300MB error log of just this message over and over?

Code: Select all

[error] [client XXX.XXX.XXX.XXX] PHP Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 861, referer: http://XXX.XXX.XXX.XXX/cacti/plugins/we ... n-mgmt.php
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

Hi Howie,,,

I have allowed user to view map..
they can see map.. but mouse over to see graph doesn't load..

Not sure what I am missing,, Please check attached file
Attachments
Weathermap-forotheruser-load.png
Weathermap-forotheruser-load.png (537.42 KiB) Viewed 4219 times
Weathermap-forotheruser-permission.png
Weathermap-forotheruser-permission.png (10.07 KiB) Viewed 4219 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

Post by Howie »

Does the user have permission in Cacti to view those graphs?

That is, if they clicked on the Graphs tab, can they see the same graphs?

All weathermap does is put an <IMG> tag in a box, with the Cacti graph URL in 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!)
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

Post by anmomin1 »

Thanks Howie you the man,,
I deleted and recreate user.. and issue got fixed.. I made sure that user has graph access...

I have one graph that is 187% and I am getting following in my logs also warning sign on that map:

WEATHERMAP: Poller[0] WARNING: [Map 10] DMVPN110.conf: NewColourFromPercent: Clipped 182.798538264% to 100% for item DMVPN110-rrr3-4 [WMWARN33]

I have right bandwidth but would I need to add color for 101 - 999KEYPOS DEFAULT 1 1 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0 0 192 192 192
SCALE DEFAULT 0 1 102 102 102
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 55 0 240 0
SCALE DEFAULT 55 70 240 240 0
SCALE DEFAULT 70 85 255 192 0
SCALE DEFAULT 85 100 255 0 0
SCALE DEFAULT 101 999 240 255 192


I did that but still same warning and logs
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests