SOLVE | Force On-demand RRD Updating | Weathermap issue

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
irocosta
Posts: 7
Joined: Thu Dec 05, 2019 10:14 am

SOLVE | Force On-demand RRD Updating | Weathermap issue

Post by irocosta »

Hello,

I would like to know if it's possible to force On-demand RRD Update for some specific graphic using CLI, I'm using cacti 1.2.7 with 3 remote pollers. I would like to put Weathermap working on this version, I got it working but sometimes I get the links in gray because the data is still on poller_output_boost.

I noticed that when I open a graphic using the browser the data is uploaded to the rrd, I already tried to curl, wget.. but doesn't work.

When I open all the graphics on the browser and then run "./weathermap --config x.conf --output x.png --htmloutput x.html" I got all the map's working perfectly

So I would like to do a script to simulate the "On-demand RRD Update" before run the Weathermap script.


ps: I'm a new cacti user
Last edited by irocosta on Mon Jan 27, 2020 9:57 am, edited 1 time in total.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by Osiris »

That' seems odd, it's as if the web user does not have write access to the RRDfiles. So long as weathermap uses the standard graphing API, the RRDfiles will be updated by Apache.

You may have either SELinux enabled, or you have mod_secure installed on your server, or finally, you may have the wrong permissions on the RRDfile. Generally I do the following:

For mod secure:
rpm -qa | grep mod_secure (and if it's installed)
rpm -e `rpm -qa | grep "mod_secure"`
systemctl restart httpd
For SELinux:
cat /etc/selinux/config (if you find SELINUX=ENFORCING change to DISABLED and reboot)
For ownership:
ps -ef | grep httpd (find the account and then...)
chown -R apache:apache /var/www/html/cacti
Before history, there was a paradise, now dust.
irocosta
Posts: 7
Joined: Thu Dec 05, 2019 10:14 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by irocosta »

Hi,

I checked all the steps but I don't have any of the steps activate and the ownership I got cacti.apache, I don't know if the API works using the Weathermap script, every time I run "./weathermap --config x.conf --output x.png --htmloutput x.html" and is still data in "poller_output_boost" I got this error

./weathermap --config x.conf --output x.png --htmloutput x.html ERROR:

WARNING: x.conf: RRD ReadData: poller_output - Cacti environment is not right [WMRRD12]
WARNING: x.conf: ReadData: LINK xxx, target: /common/cacti/rra/1847/852330.rrd on config line 222 of BBNG.conf had no valid data, according to WeatherMapDataSource_rrd
WARNING: x.conf: RRD ReadData: poller_output - Cacti environment is not right [WMRRD12]
WARNING: x.conf: ReadData: LINK xxx, target: /common/cacti/rra/1848/852337.rrd on config line 230 of BBNG.conf had no valid data, according to WeatherMapDataSource_rrd
WARNING: x.conf: RRD ReadData: poller_output - Cacti environment is not right [WMRRD12]
WARNING: x.conf: ReadData: LINK xxx, target: /common/cacti/rra/1848/852338.rrd on config line 238 of BBNG.conf had no valid data, according to WeatherMapDataSource_rrd

Equipe info:

root@:/var/www/html# rpm -qa | grep mod_secure
root@:/var/www/html# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

root@:/common# ls -lah
total 533M
drwxr-xr-x 6 root root 94 Dec 5 19:16 .
dr-xr-xr-x. 19 root root 251 Sep 23 15:43 ..
drwxrwxrwx 23 cacti apache 4.0K Dec 5 18:23 cacti

root@:/common# cat /etc/group | grep cacti
cacti:x:1004:apache,root

note: I got chmod 777 for now to troubleshot


That is the reason I want to force the data to be written from poller_output_boost until I run ./weathermap --config x.conf --output x.png --htmloutput x.html
irocosta
Posts: 7
Joined: Thu Dec 05, 2019 10:14 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by irocosta »

Image
https://ibb.co/nkGpL0s
This is the graphic issue.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by Osiris »

It would make me surprised in Howies plugin did not know about the on-demand updating and take action before parsing the RRDfiles. I would consider that a bug.
Before history, there was a paradise, now dust.
irocosta
Posts: 7
Joined: Thu Dec 05, 2019 10:14 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by irocosta »

Is there any way to call this "standard graphing API" manually? For a workaround
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by Osiris »

You should grep weathermap for graph_image.php. if you find that, it's using the standard API's.
Before history, there was a paradise, now dust.
irocosta
Posts: 7
Joined: Thu Dec 05, 2019 10:14 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by irocosta »

root@x:/common/cacti/weathermap# cat weathermap | grep graph_image.php | wc -l
0
Doesn't call it, I solved the problem using selenium + phyton

Now I got my weathermap working again, with this workaround :D :D
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Force On-demand RRD Updating | Weathermap issue

Post by netniV »

That command looks wrong. just do grep "graph_image.php" * -R instead when you in the weathermaps folder.
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest