cannot add graph in weathermap was working fine

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Author
Message
anmomin1
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

cannot add graph in weathermap was working fine

#1 Post by anmomin1 » Tue Oct 23, 2018 7:23 am

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: 5327
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

#2 Post by Howie » Tue Oct 23, 2018 7:39 am

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.98 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: 2667
Joined: Sun Aug 27, 2017 12:05 am

Re: cannot add graph in weathermap was working fine

#3 Post by netniV » Tue Oct 23, 2018 10:31 am

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.

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

Re: cannot add graph in weathermap was working fine

#4 Post by Howie » Tue Oct 23, 2018 11:10 am

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.98 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
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#5 Post by anmomin1 » Tue Oct 23, 2018 2:20 pm

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
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#6 Post by anmomin1 » Tue Oct 23, 2018 2:29 pm

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 787 times
weathermap-add-map-issue-screenshoot.png
weathermap-add-map-issue-screenshoot.png (99.33 KiB) Viewed 787 times

anmomin1
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#7 Post by anmomin1 » Tue Oct 23, 2018 3:25 pm

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: 5327
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

#8 Post by Howie » Tue Oct 23, 2018 4:26 pm

They need to have permission in Cacti to see the graphs too. Do they?
Weathermap 0.98 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: 5327
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

#9 Post by Howie » Tue Oct 23, 2018 4:27 pm

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.98 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: 5327
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cannot add graph in weathermap was working fine

#10 Post by Howie » Tue Oct 23, 2018 4:29 pm

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.98 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
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#12 Post by anmomin1 » Wed Oct 24, 2018 11:03 am

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
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#13 Post by anmomin1 » Wed Oct 24, 2018 1:58 pm

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 769 times
Weathermap-forotheruser-permission.png
Weathermap-forotheruser-permission.png (10.07 KiB) Viewed 769 times

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

Re: cannot add graph in weathermap was working fine

#14 Post by Howie » Wed Oct 24, 2018 3:19 pm

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.98 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
Posts: 41
Joined: Mon May 29, 2017 4:14 pm

Re: cannot add graph in weathermap was working fine

#15 Post by anmomin1 » Wed Oct 24, 2018 4:41 pm

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