bash script not populating rrd

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
chk9
Posts: 4
Joined: Mon Sep 15, 2014 7:12 pm

bash script not populating rrd

Post by chk9 »

Newbie question.
Running Version 0.8.8b on Ubuntu 14.04

I've created a new data input method using the following poller.
My poller provides the following data:

Code: Select all

~$ b/vera-cacti-poll.sh eth0.2
rec:81262822953 snd:7102042602
~$ 
The poller cach shows:

Code: Select all

Vera WAN  Script: /bin/bash /home/chris/b/vera-cacti-poll.sh eth0.2
	       RRD: /var/lib/cacti/rra/rec_8.rrd 
However the cacti log shows:

Code: Select all

09/16/2014 01:05:01 AM - CMDPHP: Poller[0] Host[0] DS[8] CMD: /bin/bash /home/chris/b/vera-cacti-poll.sh eth0.2, output: U
09/16/2014 01:05:01 AM - CMDPHP: Poller[0] Host[0] DS[8] WARNING: Result from CMD not valid. Partial Result: U 
What am I doing wrong?

:roll: chk9
Thank you,

Cacti 0.8.8b on Ubuntu 14.04
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: bash script not populating rrd

Post by cigamit »

Could be multiple different things. First check these.

1. Permissions, make sure the poller user has permissions to execute that script
2. Selinux, its a pox
3. Check the commands inside the script, the poller user needs permission to run any commands in there too.
chk9
Posts: 4
Joined: Mon Sep 15, 2014 7:12 pm

Re: bash script not populating rrd

Post by chk9 »

Hmm does not looks like it's a permission issue:

Code: Select all

~$ sudo su www-data
[sudo] password for chris: 
$ /bin/bash /home/chris/b/vera-cacti-poll.sh eth0.2
rec:81332368296 snd:7127901568
Not sure where to check selinux issues :cry:
Thank you,

Cacti 0.8.8b on Ubuntu 14.04
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: bash script not populating rrd

Post by cigamit »

Code: Select all

setenforce 0
chk9
Posts: 4
Joined: Mon Sep 15, 2014 7:12 pm

Re: bash script not populating rrd

Post by chk9 »

Ok found out selinux is not active:

Code: Select all

~$ getsebool selinuxuser_ping
getsebool:  SELinux is disabled
And running from the command prompt it works!

Code: Select all

~$ sudo su www-data
$ php /usr/share/cacti/site/poller.php --force --debug
09/18/2014 08:30:15 AM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '14', Max Runtime '298', Poller Runs: '1'
09/18/2014 08:30:15 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q --define suhosin.memory_limit=512M "/usr/share/cacti/site/cmd.php" 0 1]
Waiting on 1 of 1 pollers.
09/18/2014 08:30:15 AM - POLLER: Poller[0] Parsed MULTI output field 'rec:81796546621' [map rec->rec]
09/18/2014 08:30:15 AM - POLLER: Poller[0] Parsed MULTI output field 'snd:7300759405' [map snd->snd]
Waiting on 1 of 1 pollers.
It shows in the cacti log now:

Code: Select all

09/18/2014 08:30:15 AM - POLLER: Poller[0] Parsed MULTI output field 'snd:7300759405' [map snd->snd]
09/18/2014 08:30:15 AM - POLLER: Poller[0] Parsed MULTI output field 'rec:81796546621' [map rec->rec] 
And on the graph :-)

But why does it fail from within cacti?

Code: Select all

09/18/2014 08:35:01 AM - CMDPHP: Poller[0] Host[0] DS[8] WARNING: Result from CMD not valid. Partial Result: U 
Thank you,

Cacti 0.8.8b on Ubuntu 14.04
chk9
Posts: 4
Joined: Mon Sep 15, 2014 7:12 pm

Re: bash script not populating rrd

Post by chk9 »

Anyone with another suggestion how to solve this issue?
Any debug tips to try?
I'm not getting the difference between the scheduler from within cacti and cron?!

I got a work around for now, by adding the poller to a cron job, but it's not as it should be setup:

Code: Select all

# m h  dom mon dow   command
*/5 *  *   *   *     sleep 5 && php /usr/share/cacti/site/poller.php --force --debug
Cacti log:

Code: Select all

09/19/2014 09:40:06 PM - POLLER: Poller[0] Parsed MULTI output field 'snd:7398328876' [map snd->snd]
09/19/2014 09:40:06 PM - POLLER: Poller[0] Parsed MULTI output field 'rec:82070721753' [map rec->rec]
09/19/2014 09:40:06 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q --define suhosin.memory_limit=512M "/usr/share/cacti/site/cmd.php" 0 1]
09/19/2014 09:40:06 PM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '5', Max Runtime '298', Poller Runs: '1'
09/19/2014 09:40:01 PM - SYSTEM STATS: Time:0.2485 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:6 RRDsProcessed:6
09/19/2014 09:40:01 PM - CMDPHP: Poller[0] Host[0] DS[8] WARNING: Result from CMD not valid. Partial Result: U 
Thank you,

Cacti 0.8.8b on Ubuntu 14.04
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests