Graphs Only Showin -nan Values

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

Moderators: Developers, Moderators

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

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Graphs Only Showin -nan Values

Post by camerabob »

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?
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
User avatar
camerabob
Cacti User
Posts: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Graphs Only Showin -nan Values

Post by camerabob »

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.
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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

Re: Graphs Only Showin -nan Values

Post by netniV »

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
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
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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

Post by Erudes1991 »

Any thoughts? :cry:
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphs Only Showin -nan Values

Post by netniV »

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
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
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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

Re: Graphs Only Showin -nan Values

Post by netniV »

If you wish to run the poller as Apache, make sure the /etc/cron.d/cron file says apache not cacti.
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
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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

Re: Graphs Only Showin -nan Values

Post by netniV »

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.
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
Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: Graphs Only Showin -nan Values

Post by Erudes1991 »

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

Who is online

Users browsing this forum: No registered users and 14 guests