Graph generation issue

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Graph generation issue

Post by shahsaifi »

Dear friends,

I am running into an issue with cacti (graphs) :cry:

Code: Select all

OS: CentOS release 5.6 x86_64
Cacti: 0.8.7g
RRD: 1.4.4
Apache: httpd-2.2.3-45
Earlier it was unable to generate graphs than I realized poller.php is not running frequently and it was throwing following errors:

Code: Select all

ERROR: opening '/var/www/html/rra/cct6_cpu_587.rrd': No such file or directory
Then I ran poller.php manually and it has started generating graphs. Now graphs are there but it shows only blank graphs, no data in it :o

Please help me in resolving the issue.

Thanks in advance.
-Shahnawaz
Greetings,
Shah
eqq
Posts: 26
Joined: Fri May 27, 2011 4:40 am
Location: HK

Re: Graph generation issue

Post by eqq »

shahsaifi wrote:Dear friends,

I am running into an issue with cacti (graphs) :cry:

Code: Select all

OS: CentOS release 5.6 x86_64
Cacti: 0.8.7g
RRD: 1.4.4
Apache: httpd-2.2.3-45
Earlier it was unable to generate graphs than I realized poller.php is not running frequently and it was throwing following errors:

Code: Select all

ERROR: opening '/var/www/html/rra/cct6_cpu_587.rrd': No such file or directory
Then I ran poller.php manually and it has started generating graphs. Now graphs are there but it shows only blank graphs, no data in it :o

Please help me in resolving the issue.

Thanks in advance.
-Shahnawaz
Do you add the data query on it?

Alex
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

Alex, I didn't get about Data query. I am not sured about it :(
Greetings,
Shah
eqq
Posts: 26
Joined: Fri May 27, 2011 4:40 am
Location: HK

Re: Graph generation issue

Post by eqq »

shahsaifi wrote:Alex, I didn't get about Data query. I am not sured about it :(
Could you turn on the graph debug mode and post it ?
Alex
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

Here is the output of Debug mode :

Code: Select all

RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='CCT4 - CPU Utilization - CPU0' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='percent' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/rra/cct4_cpu_553.rrd":cpu:AVERAGE \
AREA:a#FF0000FF:"CPU Utilization"  \
GPRINT:a:LAST:"Current\:%8.0lf"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf"  \
GPRINT:a:MAX:"Maximum\:%8.0lf\n" 

RRDTool Says:

OK
Greetings,
Shah
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Graph generation issue

Post by phalek »

You should add the poller to crontab:

e.g. create a file "/etc/cron.d/cacti" and add the following:

Code: Select all

*/5 * * * *     cactiuser php /var/www/html/cacti/poller.php &>/dev/null
If you're running your cacti install as another user than cactiuser, you need to change that line.

Next: If you run the poller from the command line manually, it needs to be done using the same user as cacti is running as.
Example: If you run the command as root, all the rrd files are owned by root and nobody else is able to change them. If your Cacti install is now running as e.g. "cactiuser" the poller won't be able to update it and your graphs stay blank.

A

Code: Select all

chown -R cactiuser rra log 
may solve the problem in this case.

So: What user is your Cacti install running as, and what user did you use to manually run the poller comman ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

Phalek,

It was scheduled in cron with cacti as :

Code: Select all

 crontab -l -u cacti
*/5 * * * * php /var/www/html/poller.php > /dev/null 2>&1
But it was throwing an error as i mentioned above so I ran

Code: Select all

php /var/www/html/poller.php
as "root" and graphs were generated at /var/www/html/rra but later i ran same with "cacti" and it executed fine. Than i realized cacti do not have write permission on /var/ww/html/rra so i changed ownership of this directory as cacti using chow. Still not getting data in graphs :(
Attachments
graph.png
graph.png (18.2 KiB) Viewed 2690 times
Greetings,
Shah
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Graph generation issue

Post by phalek »

When (at what time/date) did you change the ownership ? Also check the directory itself, it may be that the rra and log dirs are not owned by the Cacti user, so it's unable to create files within them
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

it was done on last day

Code: Select all

 # ls -ltr | grep -wE "rra|log"
drwxr-xr-x 2 cacti  apache   4096 May 31 07:40 log
drwxr-xr-x 2 cacti  apache  16384 May 31 07:40 rra
Greetings,
Shah
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Graph generation issue

Post by phalek »

Hm,

Try increasing the log details ( e.g. Poller Logging Level -> Debug, Enable Poller Warnings and Errors )

Then wait a few cycles and check the Cacti log ( or post it here, or sent it to me using a PM ).
or
run the poller.php command as your cacti user with:

Code: Select all

php poller.php --force --debug
and check for errors, warnings or other unusual stuff.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

Dear friend,

Here is the output of:

Code: Select all

php poller.php --force --debug
Logs:

Code: Select all

06/01/2011 06:13:48 AM - POLLER: Poller[0] NOTE: Poller Int: '60', Cron Int: '300', Time Since Last: '35', Max Runtime '298', Poller Runs: '5'
06/01/2011 06:13:48 AM - POLLER: Poller[0] WARNING: Poller Output Table not Empty.  Issues Found: 1, Data Sources: hdd_used(DS[731])
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 0 0]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 30 30]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 31 31]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 32 32]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 33 33]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 36 36]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 47 47]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 50 50]
06/01/2011 06:13:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 51 51]
06/01/2011 06:13:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 52 52]
06/01/2011 06:13:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 53 53]
06/01/2011 06:13:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 54 54]
06/01/2011 06:13:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 55 55]
06/01/2011 06:13:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 56 56]
OK u:0.00 s:0.00 r:0.00
OK u:0.00 s:0.00 r:2.01
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:4.02
OK u:0.00 s:0.00 r:5.02
OK u:0.00 s:0.00 r:5.02
OK u:0.00 s:0.00 r:5.02
OK u:0.00 s:0.00 r:5.02
OK u:0.00 s:0.00 r:6.03
OK u:0.00 s:0.00 r:6.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:7.03
OK u:0.00 s:0.00 r:8.04
OK u:0.00 s:0.00 r:8.04
OK u:0.00 s:0.00 r:9.04
OK u:0.00 s:0.00 r:9.04
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:10.05
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:12.06
OK u:0.00 s:0.00 r:13.07
OK u:0.00 s:0.00 r:13.07
OK u:0.00 s:0.00 r:13.07
OK u:0.00 s:0.00 r:13.07
OK u:0.00 s:0.00 r:13.07
OK u:0.00 s:0.00 r:14.07
OK u:0.00 s:0.00 r:15.07
OK u:0.00 s:0.00 r:16.08
OK u:0.00 s:0.00 r:16.08
OK u:0.00 s:0.00 r:16.08
OK u:0.00 s:0.00 r:18.08
OK u:0.00 s:0.00 r:19.09
OK u:0.00 s:0.00 r:22.09
OK u:0.00 s:0.00 r:23.10
OK u:0.00 s:0.00 r:24.10
OK u:0.00 s:0.00 r:27.11
OK u:0.00 s:0.00 r:27.11
OK u:0.00 s:0.00 r:30.11
OK u:0.00 s:0.00 r:31.12
06/01/2011 06:14:20 AM - SYSTEM STATS: Time:32.5756 Method:cmd.php Processes:100 Threads:N/A Hosts:14 HostsPerProcess:1 DataSources:80 RRDsProcessed:63
06/01/2011 06:14:20 AM - WEATHERMAP: Poller[0] Weathermap 0.97a starting - Normal logging mode. Turn on DEBUG in Cacti for more information

06/01/2011 06:14:20 AM - WEATHERMAP: Poller[0] STATS: Weathermap 0.97a run complete - Wed, 01 Jun 11 06:14:20 -0400: 0 maps were run in 0 seconds with 0 warnings.
06/01/2011 06:14:48 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/html/cmd.php" 0 0]
And it's still running.
Greetings,
Shah
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Graph generation issue

Post by phalek »

odd .. it's not even running one rrdtool command.

Is the CPU info the only thing you added to the hosts ? Can you try adding another template as well, e.g. the "Unix - Ping Latency" one ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

yep :(

Adding and will post the output
Greetings,
Shah
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Graph generation issue

Post by shahsaifi »

Unusual thing is that when i ran:

Code: Select all

php poller.php --force --debug
it throws below error as well:

Code: Select all

Could not open input file: /var/www/html/scripts/wmi.php
And this file is not existed.
Greetings,
Shah
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Graph generation issue

Post by phalek »

That error may be due to the wmi/windows templates being there, but the wmi scripts/plugin/addon is missing.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests