Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun May 26, 2019 4:22 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 12:45 am 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
Hello everyone, new to the fórums, a bit scared…

I have this problem that based on the extensive search made on Google, isn't that unusual, however, causes to this problem can be a lot, which makes it harder to trouble shoot.

So I have Cacti installed on a VM through CentOS7, and I have another VM which has Windows 10 installed. I already installed everything succesfully and added both localhost and the Windows 10 machine to be monitored. Other than the fact that I had to force the poll manually in order for the rra files to appear on the proper directory, and the graphs to show, everything was normal.

But now this graphs are only showing nan values, on both local host and Windows 10 machine.

SNMP walk and firewall rules are set up correctly, the community name as well.

I checked this post and tried a few things unsuccesfully:

https://forums.cacti.net/viewtopic.php?t=15136

I have to be honest, I'm pretty new to Linux and Cacti, so there are some of those trouble shooting steps that I was not able to complete as I could not understand them.

If you guys need me to post screenshots, or check something specifically please let me know.

Im also willing to be guided on a specific trouble shoot step that you'd want me to conduct.

Thank you so much!

PS: Just added a new Windows 10 Host to Cacti, and this is what I get after creating graphs for said host

Image

After starting the poll manually on the server, the graphs show but with nan values :cry:


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 8:10 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
From the error message, it appears that the poller doesn't have permission to write in that directory. The logged in user does. Look in that folder's security and insure that the poller can write files there. I'm not sure what you installed under (user wise).

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 3:03 pm 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
As stated below the image, I should have upload another one haha. After starting the poll manually I was able to see the graphs:

By the way I have no idea how to grant permission to the poll account over the directory.

Anyway here is the graphs showing only NAN values

Image

Thanks!


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 5:05 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
If you run a poll manually again and then see numbers, then my original statement stands. Permission issue. Google "Windows directory permissions".

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 6:16 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
If you are running 1.2.x, use the Troubleshooting -> Data Sources option to find out if any common issues affect you (like above permission issues).

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Thu Feb 28, 2019 11:09 pm 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
I dont see numbers when I ran the poll manually, I just see NAN values.

Unfortunately I'm using an older version so I don't have that section on my web interface.

I'm using CentOS7 not Windows. Ok, so by permissions you guys mean permissions over that specific directory where those files are located, but to what user exactly? the one from cacti database? that one has no user added on the OS itself, so that confuses me a lot.

On the other hand, I had to restart the main computer and so did the virtual machine, and now I cannot access my Cacti server, it tells me that:

Forbidden

You don't have permission to access /cacti/ on this server.

This is driving me nuts be cause I'm fairly new to Linux and more to Cacti! :o

Please help :oops:

Edit: I managed to roll back the VM state so Cacti is back! not sure why that happens when reboot though...


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 6:01 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
OK, for CentOS 7 both the user used in the cron (usually /etc/cron.d/cacti) and the website user which I think for C7 is apache, need read/write access to various folders. The installer gives you all that information when you step through an upgrade though if you are on an older version of Cacti, that may explain why you don't get decent information. I completely re-wrote the install for 1.2.x to be ajax based (more responsive) and provide far more checks/details on possible problems. For example, most people configure their PHP settings for Apache, but completely forget to set them for the command line (CLI).

Image

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 11:13 am 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
The user I'm using to access Cacti website is called "admin". What are the directories Apache should have write access to?

For example /var/lib/cacti/rra > Apache user has drwxrwxrwx access and also root.

Other entries I have on cron.d are:

*/5 * * * * apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
*/5 * * * * admin /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

During installation I was able to have all directories with write access by setting SELinux as permissive.

So who else should I give access to? Or what other directories you think? Or should I update my Cacti release version?

I double checked that the Linux machine that has Cacti installed is now giving me graph values except for the CPU utilization template, check below:

https://imgur.com/a/UmFT8Mu

https://imgur.com/oSz7Vik

Windows 10 PC has SNMP service configured correctly with community and also Cacti Server which detects the device, but no graphs.

Any additional thoughts?


Last edited by Erudes1991 on Fri Mar 01, 2019 11:53 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 11:48 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
Who is running your poller?

server# cat /etc/cron.d/cacti

Should look something like the below:

*/5 * * * * <CentOS-web-user> php <path to cacti>/poller.php > /dev/null 2>&1

mine is:
*/1 * * * * apache /usr/share/cacti/poller.php > /dev/null 2>&1

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Last edited by camerabob on Fri Mar 01, 2019 11:58 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 11:54 am 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
Hey, thanks for replying, we stepped each other lol:

This is what I have on cron.d

*/5 * * * * apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
*/5 * * * * admin /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Is it right?


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 12:06 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
First of all, you should only need one (the one that works!). I have my install set for unique directories, so when I run:
Code:
ls -l /usr/share/cacti/rra/
I get:
Code:
drwxr-xr-x. 2 apache apache      21 Nov 29 16:01 1
drwxr-xr-x. 2 apache apache      51 Nov 29 15:59 11
drwxr-xr-x. 2 apache apache     171 Jan 25 15:58 12
drwxr-xr-x. 2 apache apache     216 Jan 18 08:18 13
drwxr-xr-x. 2 apache apache      36 Jan 14 10:06 15
drwxr-xr-x. 2 apache apache       6 Jan 29 09:18 16
drwxr-xr-x. 2 apache apache      21 Jan 14 10:06 17
drwxr-xr-x. 2 apache apache      36 Jan 14 10:13 18
drwxr-xr-x. 2 apache apache      21 Jan 14 10:13 19
drwxr-xr-x. 2 apache apache      36 Jan 14 10:13 20
...


Apache is the user running my web server, so all is good. From the command prompt, run "ps -ef | grep httpd" without quotes. The output should resemble:

Code:
# ps -ef | grep httpd
apache     826  4999  0 11:16 ?        00:00:02 /usr/sbin/httpd -DFOREGROUND
apache    2874  4999  0 12:01 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
root      4157  2075  0 12:02 pts/0    00:00:00 grep --color=auto httpd
apache    4715  4999  0 11:21 ?        00:00:02 /usr/sbin/httpd -DFOREGROUND
root      4999     1  0 Jan18 ?        00:10:45 /usr/sbin/httpd -DFOREGROUND
apache    8551  4999  0 11:26 ?        00:00:02 /usr/sbin/httpd -DFOREGROUND
apache   12354  4999  0 11:31 ?        00:00:01 /usr/sbin/httpd -DFOREGROUND
apache   16148  4999  0 11:36 ?        00:00:01 /usr/sbin/httpd -DFOREGROUND
apache   18075  4999  0 10:56 ?        00:00:03 /usr/sbin/httpd -DFOREGROUND
apache   23813  4999  0 11:46 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   27601  4999  0 11:51 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   31478  4999  0 11:56 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND


The line with
Code:
root, 4999, 1,...
tells us that root (process #1) has spawned httpd (process #4999). All lines with 4999 in the third column will have the user in the first column, for me it's Apache. Do the same and compare.

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 1:04 pm 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
This is what I get when doing ls -l /usr/share/cacti/rra

Image

When you say "Apache is the user running my web server" you're not referring to the user credentials you type in when logging the Web UI right? Because this is what confuses me the most.

And this is what I get with "ps -ef | grep httpd"

Image

I really can't tell if the values are ok, they resemble to yours though

What changes should I do to crontab then?

Thanks for following up!


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 1:45 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
Those files in green are under the root user. Apache may not have the ability to write to them (though the permissions are there), so they will never get updated. In
Code:
/use/share/cacti/rrd
run this command:
Code:
# chown apache.apache local_*
This will change the file owners so that Apache can write to them. Let's see if polls start working after that. You should additionally run:
Code:
# chmod 644 local_*
This will change the file permissions so that only Apache can write to those files. Also, you should be able to safely remove from the crontab file:

Code:
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
*/5 * * * * admin /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 2:45 pm 
Offline

Joined: Thu Feb 28, 2019 12:37 am
Posts: 16
Ok, I've done all of that, I don't know if I have to wait or restart services, but as soon as I ran the commands I reloaded Cacti and everything's the same.

Edit: This is what I see on the main graph screen for Linux local host

Image


Last edited by Erudes1991 on Fri Mar 01, 2019 3:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Graphs Only Showin -nan Values
PostPosted: Fri Mar 01, 2019 3:36 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
It will take a couple of cycles before you see data. At least 10 minutes. The date stamps on the files should be updating though.

Added***
I see that the -nan- are related to the graphs that were not green. In the
Code:
/usr/share/cacti/rra
folder, try the below command:
Code:
# chmod +x *
This will allow the files to be executed. I see mine are while yours are not.

_________________
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.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Last edited by camerabob on Fri Mar 01, 2019 3:49 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group