Cacti 0.8.6 - 'cacti' 'cactiuser' MySQL duplcate issues?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Cacti 0.8.6 - 'cacti' 'cactiuser' MySQL duplcate issues?

Post by monideth »

All,

I recently upgraded to Cacti 0.8.6 fro 0.8.5a.

0.8.5a was compiled from source on a Fedora Core 1 system. When I upraged to 0.8.6 I upgraded to Fedora Core 2 first. forgot to mention 0.8.6 was from FC2 RPM downloaded from Cacti website.

I have been having these issues with duplcate MySQL entries:

09/16/2004 10:00:52 PM - CACTID: Poller[0] ERROR: Problem with MySQL: Duplicate entry '1164-cpu-2004-09-16 22:00:52' for key 1

I have been looking at he messages boards to see if I can fix this problem but can't seem to get any suggestions to work.

I have noticed something regarding the account the cacti poller runs on. Previously on my 0.8.5a system I created a user called 'cactiuser' to run everything with. Upon installing the 0.8.6 RPM I see that a new user 'cacti' has also been created! when looking at the processes while the poller is running shows the following:

cactius 31964 0.0 0.3 3212 904 ? S 22:00 0:00 /bin/bash -c php /var/www/html/cacti/poller.php > /dev/null 2>&1
cacti 31968 0.0 0.3 3572 904 ? S 22:00 0:00 /bin/sh -c php /var/www/html/cacti/poller.php > /dev/null 2>&1
cactius 31969 1.7 3.6 18992 9204 ? S 22:00 0:02 php /var/www/html/cacti/poller.php
cacti 31970 1.5 3.6 18060 9216 ? S 22:00 0:02 php /var/www/html/cacti/poller.php
cactius 31974 0.0 1.7 19252 4532 ? S 22:00 0:00 /usr/bin/cactid 0 111
cactius 31975 0.6 0.2 3448 668 ? S 22:00 0:01 /usr/bin/rrdtool -
cacti 31979 0.0 1.8 19712 4660 ? S 22:00 0:00 /usr/bin/cactid 0 111
cacti 31980 0.0 0.2 3020 620 ? S 22:00 0:00 /usr/bin/rrdtool -
cactius 31981 0.1 3.1 16868 8108 ? S 22:00 0:00 /usr/bin/php /var/www/html/cacti/script_server.php cactid 0
cacti 31984 0.1 3.1 16996 8104 ? S 22:00 0:00 /usr/bin/php /var/www/html/cacti/script_server.php cactid 0
root 472 0.0 0.2 4676 648 pts/0 S 22:02 0:00 grep cacti


As you can see there are entries for both 'cactiuser' and 'cacti'.

Could this be the cause for the duplication???!!!

My crontab entry reads:

*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1

I have also noticed the following issue regarding Data Templates which some postings suggest could be the problem. I have three entries:

Interface - Traffic
Interface - Traffic - In
Interface - Traffic - Out

The 'Interface - Traffic' entry I assume is the correct one to have - this has the two tabs for 'traffic_in' and 'traffic_out'. I also seem to rember this first entry was introduced to replace the other two entries - but I suppose I never got round to removing these legacy entries.

I tried just disabling the other two but it did not resolve the issue. Maybe I should delete the last two entries completely??

Thanks for any response in advance.

Regards,

Mon
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The user the poller runs as has always been 'cacti' for the RPMs that I build. The Dag RPM might use a different user.

About your duplicate poller issues, the RPM for 0.8.6 puts an entry in /etc/cron.d like RPM-based applications are supposed to. Since this is new behavior from the previous version, you will have to remove any references to cmd.php/poller.php in your /etc/crontab file.

-Ian
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

Dear raX,

Yes, I understand that the RPM would have installed a user called 'cacti' now.

Previously my Cacti install was from the 0.8.5a sources - which I created the 'cactiuser' on the first installation and used for subsequent upgrades. However on this last upgrade to 0.8.6 I used the RPM install. Thus now I have two user accounts - 'cactiuser' and 'cacti'

Thus, the question is now do I start using the new 'cacti' user - so ALL files should owned by 'cacti' - before the upgrade it was owned by 'cactiuser'. Since I moved the rra files, they are currently owned by 'cactiiser' - so shall I change this now to be owned by 'cacti'?

In the crontab - do I use 'cacti' or 'cactiuser'? On this subject - does the RPM install the crontab entry in the /etc/crontab file or the crontab file for the 'cacti' user itself?

During my upgrade I commented out the old crontab entry and put in the new one - as per the installation/upgrade documents.

OK - just read you reply again - you mentioned the crontab entry is put in /etc/crontab.d/ directory - this might explain a few things! I'll check it out and let you guys know.

Regards,

Mon
Guest

Post by Guest »

raX,

OK - there is a file /etc/cron.d/cacti with the following entry:

*/5 * * * * cacti php /var/www/html/cacti/poller.php > /dev/null 2>&1

I have removed my entry from /etc/crontab.

I have also made sure all cacti files belong to cacti user (and group) - note /usr/sbin/cactid is owned by root.

I ran across a problem wiht cron not running properly - /var/log/cron showed the following errors:

Sep 17 09:08:19 cacti-unl crond[2301]: (system_u) getfilecon FAILED (/etc/cron.d/cacti)

However, I resolved this by use the method outline by:

http://bugzilla.redhat.com/bugzilla/sho ... ?id=127371

HOWEVER, now I am find that I am getting the following errors in the cacti.log file:

09/17/2004 10:02:56 AM - CMDPHP: Poller[0] Host[34] WARNING: Result from SNMP not valid. Partial Result: No Such Object avail
09/17/2004 10:07:01 AM - CMDPHP: Poller[0] Host[78] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur

My graphs do not update at all.

Turning on DEBUG mode seems to show that the poller is polling the hosts/devices OK!

I am looking at the other posts to check for this error but have not found a resolution.

NOTE - as said previously I followed the Cacti install and upgrade documentation - the install documentation indicates to put an entry in /etc/crontab - I assume this document is meant to be for the source install. I suggest this be updated to match what is done by the RPM install so that it does not cause the problems I had when going from source install to RPM install!!

Regards

Mon
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

All,

Sorry that was my posting above.

I forgot to mention that I do not get the MySQL duplication errors now after making the above changes - so is the fact that there were two cron sessions running that caused these errors?

However, since I am getting these new errors it might be masking the MySQL errors??

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

OK - I think I know what the "SNMP not valid" errors mean.

The "No Such Object avail.." is when a MIB does not support that query - this problem for me is usually to do with a Cisco switch/router not being abled to be polled for CPU utilisation. To resolve this delete the correspnoding data source.

The "No Such Instance cur.." is when an index itself does not existing. For me this is when a re-indexinf has occured on a switch and the poller is trying to poll and index interface that does not exist. To resolve this you need to refresh the SNMP polling in the device configuration (the green circle button) and then 'Save' it - this should update the indexes in the data sources. (However, I dont know why this is so because I usually configure to poll by IfDesc or IfName!)

Note - the above are errors are just warning and should not stop the polling process.

After the above changes I do not get such errors in the cacti.log

HOWEVER, my graphs are still not updating :cry:

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

All,

Please apply the pre-release of 0.8.6a at http://www.cacti.net/downloads and also verify that you do NOT have PHP 4.3.4 installed. We highly recommend PHP 4.3.6+.

Regards,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

Dear TheWitness,

I have downloaded the latest pre-release version - cacti-0.8.6a-pre20040917.tar.gz - and installed it.

It did not make any difference!

I then dowloaded the latest cactid release - cacti-cactid-0.8.6a-pre20040917.tar.gz - installed that - and after making teh appropriate changes - since cactid is installed in a different location - still no luck!! :cry:

Any ideas??

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Are you referring to the following:

09/16/2004 10:00:52 PM - CACTID: Poller[0] ERROR: Problem with MySQL: Duplicate entry '1164-cpu-2004-09-16 22:00:52' for key 1

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

No - I am referring to the problem with the graph being updated.

I fixed the problem with the MySQL errors - see posting history.

It seems the poller process is not completeing correctly - since they still hang around in the process list - from DEBUGs I can see that the SNMP/data is polled correctly - but the rra files are not being updated. This is also indicated by the timestamp of these files - they are not updateing.

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please state your environment:

Versions:

OS, PHP, Apache, RRDTool, etc.

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

Below is my system spec:

Fedora Core 2

httpd-2.0.50-2.1
rrdtool-1.0.49-1.1.fc2.fr
php-4.3.8-2.1
php-mysql-4.3.8-2.1
mysql-server-3.23.58-9

Please let me know if you require any further details.

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

Below is an example of my cacti process:

cacti 1865 0.0 0.3 3804 904 ? S 13:50 0:00 /bin/sh -c php /var/www/html/cacti/poller.php > /dev/null 2>&1
cacti 1866 0.5 18.4 56672 46908 ? S 13:50 0:02 php /var/www/html/cacti/poller.php
cacti 1870 0.0 0.1 2688 452 ? S 13:50 0:00 /usr/bin/rrdtool -
cacti 2372 0.0 0.3 3088 900 ? S 13:55 0:00 /bin/sh -c php /var/www/html/cacti/poller.php > /dev/null 2>&1
cacti 2373 1.4 18.5 56348 47404 ? S 13:55 0:02 php /var/www/html/cacti/poller.php
cacti 2377 0.0 0.1 4080 452 ? S 13:55 0:00 /usr/bin/rrdtool -
root 2881 0.0 0.2 4548 652 pts/0 S 13:58 0:00 grep cacti

As you can see there is a entry for "/usr/bin/rrdtool -" - is this correct? Why is there no parammeters after the command? Is this why it is not updating?

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

monideth,

poller.php is hanging. You need to kill -9 all the cacti stuff, disable your crond, set logging to DEBUG, clear your logfile and run poller.php from a command line. Post both logfile output and the STDOUT from the poller.php. After that, I can address your problems futher.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
monideth
Cacti User
Posts: 95
Joined: Thu Apr 03, 2003 3:29 am
Contact:

Post by monideth »

Hi,

I wont post the complete log file...

However this is what the results of yoru requested test are.

For the command line poller.php doe snot return and hangs at:

Code: Select all

bash-2.05b$ php poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8

09/17/2004 02:09:34 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/cactid/bin/cactid, ARGS:  0 111]
Waiting on 1/1 pollers.
The start of the cacti.log is:

Code: Select all

09/17/2004 02:09:34 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/cactid/bin/cactid, ARGS:  0 111]
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The log_destination variable is 1
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The path_php variable is /usr/bin/php
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The availability_method variable is 2
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The ping_recovery_count variable is 2
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The ping_failure_count variable is 2
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The ping_method variable is 1
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The ping_retries variable is 2
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The ping_timeout variable is 600
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The log_perror variable is 1
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The log_pwarn variable is 0
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The log_pstats variable is 0
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The threads variable is 1
09/17/2004 02:09:34 PM - CACTID: Poller[0] CACTID: Version 0.8.6 starting
09/17/2004 02:09:34 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: PHP Script Server Routine Started
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: PHP Script Server About to FORK Child Process
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: PHP Script Server Child FORK Success
09/17/2004 02:09:34 PM - PHPSVR: Poller[0] DEBUG: SERVER: cactid
09/17/2004 02:09:34 PM - PHPSVR: Poller[0] DEBUG: GETCWD: /var/www/html/cacti
09/17/2004 02:09:34 PM - PHPSVR: Poller[0] DEBUG: DIRNAM: /var/www/html/cacti
09/17/2004 02:09:34 PM - PHPSVR: Poller[0] DEBUG: FILENM: /var/www/html/cacti/script_server.php
09/17/2004 02:09:34 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cactid
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: Confirmed PHP Script Server Running
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: Initial Value of Active Threads is 0
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: Valid Thread to be Created
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 1
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: In Poller, About to Start Polling of Host
09/17/2004 02:09:34 PM - CACTID: Poller[0] MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] SNMP Result: Host responded to SNMP
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: update host set status='3',status_event_count='0', status_fail_date='2004-09-16 06:35:03',status_r
ec_date='2004-09-16 08:25:00',status_last_error='SNMP not performed due to setting or ping result.',min_time='0.116950',max_time='999.999990',cur_time='0.70
8100',avg_time='377.543515',total_polls='1407',failed_polls='28',availability='98.0000' where id='1'

09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] RECACHE: Processing 1 items in the auto reindex cache for '127.0.0.1'
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 10
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] SCRIPT: perl /var/www/html/cacti/scripts/loadavg_multi.pl, output: 1min:0.13 5min:0.21 10min:0.19
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (5,'',NOW(),'1min:0.13 5min:
0.21 10min:0.19')
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 10
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] SCRIPT: perl /var/www/html/cacti/scripts/linux_memory.pl MemFree:, output: 138452
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (3,'mem_buffers',NOW(),'1384
52')
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 10
09/17/2004 02:09:34 PM - CACTID: Poller[0] Host[1] SCRIPT: perl /var/www/html/cacti/scripts/linux_memory.pl SwapFree:, output: 1038912
09/17/2004 02:09:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (4,'mem_swap',NOW(),'1038912
')

The end of the cacti.log is:

Code: Select all

09/17/2004 02:12:34 PM - CACTID: Poller[0] Host[111] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: The Value of Active Threads is 0
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: Thread Cleanup Complete
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: SNMP Cleanup Complete
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: PHP Script Server Shutdown Started
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: PHP Script Server Pipes Closed
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: Allocated Variable Memory Freed
09/17/2004 02:12:34 PM - CACTID: Poller[0] DEBUG: MYSQL Free & Close Completed
09/17/2004 02:12:34 PM - CACTID: Poller[0] Time: 180.5884 s, Threads: 1, Hosts: 88
09/17/2004 02:12:34 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
Please let me know if you require any further help.

If you want the whole log file then please provide an email address I can send it to.

Regards,

Mon
'They'll be sorry. They'll be sorry if I die - except that I can't. Whatever you do it ends up raining. What's it all for? What's the point of it all? And if it hasn't got a point, what's the point of that?'
Monkey (2:2)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests