Graphs Only Showin -nan Values

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Author
Message
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#16 Post by Erudes1991 » Fri Mar 01, 2019 3:49 pm

Hey! So we stepped each other again haha

So here's what I get on the main graph section.

Image

Everything's the same though, how do I check the timestamps on files? It looks like poll is still not running by itself :D

User avatar
camerabob
Cacti User
Posts: 297
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Graphs Only Showin -nan Values

#17 Post by camerabob » Fri Mar 01, 2019 3:54 pm

Not sure if you saw the addition I made to the last post so here it is again:

Added***
I see that the -nan- are related to the graphs that were not green. In the

Code: Select all

/usr/share/cacti/rra
folder, try the below command:

Code: Select all

# chmod +x *
This will allow the files to be executed. I see mine are while yours are not.

Not sure of your time zone, but is the time correct?
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.6-1.el7 @ CentOS 7-7.1908.0.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

User avatar
camerabob
Cacti User
Posts: 297
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Graphs Only Showin -nan Values

#18 Post by camerabob » Fri Mar 01, 2019 3:56 pm

How do I check the timestamps on files? It looks like poll is still not running by itself :D

Code: Select all

 # ls -l
The equivalent of Windoze 'dir' command.
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.6-1.el7 @ CentOS 7-7.1908.0.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#19 Post by Erudes1991 » Fri Mar 01, 2019 4:07 pm

Thanks again for following up!

This is what I have now:

Image

I additionally created another device, and graphs to be shown, another Windows 10 Host, configuring community and Cacti's server IP address as the main server:

Received this:

Image

Looks like apache is still having problems writing files to that directory even though they're all green now...could it be that it isn't Apache who's writing the files? :O

netniV
Cacti Guru User
Posts: 3049
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs Only Showin -nan Values

#20 Post by netniV » Fri Mar 01, 2019 4:09 pm

Right, several things here. 'admin' user is NOT the user that is running the poller. That is the website administrative user.

The poller is probably running as cacti not apache. It's rare that people have the poller configured to use the website user unless they have manually configured it and skipped most tutorials. Most package installations also user a specific user for the poller.

The poller user should be part of the web server's group (apache or www-data).

The folders above should be 775 and the files 664. Easy way to handle that with chmod these days is chmod g+w

If SELinux is enable (which it is by default in CentOS 7) then you also need to change the context of the cacti folders that need to be written to.

Code: Select all

semanage fcontext -a -t httpd_sys_content_t "/usr/share/cacti(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/usr/share/cacti/(.*)/((log|rra|resource|scripts|cache)(/.*)?)"
semanage fcontext -a -t httpd_sys_content_t "/usr/share/cacti/.*/.htaccess"
restorecon -R -v /usr/share/cacti

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#21 Post by Erudes1991 » Fri Mar 01, 2019 4:22 pm

netniV wrote:Right, several things here. 'admin' user is NOT the user that is running the poller. That is the website administrative user.

The poller is probably running as cacti not apache. It's rare that people have the poller configured to use the website user unless they have manually configured it and skipped most tutorials. Most package installations also user a specific user for the poller.

The poller user should be part of the web server's group (apache or www-data).

The folders above should be 775 and the files 664. Easy way to handle that with chmod these days is chmod g+w

If SELinux is enable (which it is by default in CentOS 7) then you also need to change the context of the cacti folders that need to be written to.

Code: Select all

semanage fcontext -a -t httpd_sys_content_t "/usr/share/cacti(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/usr/share/cacti/(.*)/((log|rra|resource|scripts|cache)(/.*)?)"
semanage fcontext -a -t httpd_sys_content_t "/usr/share/cacti/.*/.htaccess"
Hello thanks for joining and helping!

SELinux is permissive, so should I do that anyway?

How can I check the poller's not running under "apache"? I'm suspecting the same thing!

So usr/sbib/httpd should be chmod 775 and the rrd files should be 664? Should I change that?

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#22 Post by Erudes1991 » Mon Mar 04, 2019 8:46 am

Any thoughts? :cry:

netniV
Cacti Guru User
Posts: 3049
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs Only Showin -nan Values

#23 Post by netniV » Mon Mar 04, 2019 10:00 am

try running the poller interactively, see if there are any errors:

Code: Select all

sudo -u cacti /usr/bin/php /usr/share/cacti/poller.php

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#24 Post by Erudes1991 » Mon Mar 04, 2019 4:34 pm

Hey, thanks for getting back to this problem.

I tried the command provided, this is what I get:

Image

I'm guessing this is because Cacti as a user does not have permissions, now isn't it Apache the user that based on instructions and images above should have those permissions?

Thanks for reaching out again!

I'm guessing the SEManage command does not work as SELinux is already permissive, correct me if I'm wrong.

Edit: This is what I get when running it as Apache:

Image

netniV
Cacti Guru User
Posts: 3049
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs Only Showin -nan Values

#25 Post by netniV » Tue Mar 05, 2019 6:54 am

If you wish to run the poller as Apache, make sure the /etc/cron.d/cron file says apache not cacti.

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#26 Post by Erudes1991 » Tue Mar 05, 2019 9:37 am

Yes, it is Apache the user that's on the file.

Should we review other files maybe? such as Apache config? the database? Running out of ideas now.

I tried replicating the issue on another VM following another installation guide, and it's the same thing.

It's weird that these type of errors are not covered in any of the installation guides I've seen so far

netniV
Cacti Guru User
Posts: 3049
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs Only Showin -nan Values

#27 Post by netniV » Tue Mar 05, 2019 10:47 am

You might be better getting someone to provide some proper remote support on this. It shouldn't take too long to resolve and being on the server in question makes life a lot simplier.

It's not quite clear yet which part of the puzzle is slightly out of line given all the common stuff has been mentioned already above.

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

#28 Post by Erudes1991 » Tue Mar 05, 2019 12:07 pm

Sure, I'm willing to receive that type of help, how can I get in contact with someone?

Post Reply