Fix 64bit counters in Interface Traffic graphs

Announcements concerning Plugins for Cacti

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
jt555
Cacti User
Posts: 54
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Fix 64bit counters in Interface Traffic graphs

#46 Post by jt555 » Mon May 09, 2011 4:07 pm

I disabled almost every other plugin and tried it again. This is all that's in the log:

[~]$ grep -i FIX64BIT /var/www/html/log/cacti.log
05/09/2011 09:00:00 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/09/2011 09:00:28 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6405, '1000000000')"

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#47 Post by shd » Tue May 10, 2011 12:50 am

jt555 wrote:I disabled almost every other plugin and tried it again. This is all that's in the log:

[~]$ grep -i FIX64BIT /var/www/html/log/cacti.log
05/09/2011 09:00:00 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/09/2011 09:00:28 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6405, '1000000000')"
Looks like fixing doesn't start after poller run. Do you have similar output when grepping poller.php file for poller_bottom?

Code: Select all

$ grep -n -B 3 -A 3 poller_bottom poller.php
450-
451-            /* sleep the appripriate amount of time */
452-            if ($poller_runs_completed < $poller_runs) {
453:                    api_plugin_hook('poller_bottom');
454-                    usleep($sleep_time * 1000000);
455-                    api_plugin_hook('poller_top');
456-            }
--
499-    echo "    --debug|-d     Output debug information.  Similar to cacti's DEBUG logging level.\n\n";
500-}
501-
502:api_plugin_hook('poller_bottom');
503-
504-?>
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

User avatar
jt555
Cacti User
Posts: 54
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Fix 64bit counters in Interface Traffic graphs

#48 Post by jt555 » Tue May 10, 2011 9:06 am

shd wrote:
jt555 wrote:I disabled almost every other plugin and tried it again. This is all that's in the log:

[~]$ grep -i FIX64BIT /var/www/html/log/cacti.log
05/09/2011 09:00:00 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/09/2011 09:00:28 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6405, '1000000000')"
Looks like fixing doesn't start after poller run. Do you have similar output when grepping poller.php file for poller_bottom?

Code: Select all

$ grep -n -B 3 -A 3 poller_bottom poller.php
450-
451-            /* sleep the appripriate amount of time */
452-            if ($poller_runs_completed < $poller_runs) {
453:                    api_plugin_hook('poller_bottom');
454-                    usleep($sleep_time * 1000000);
455-                    api_plugin_hook('poller_top');
456-            }
--
499-    echo "    --debug|-d     Output debug information.  Similar to cacti's DEBUG logging level.\n\n";
500-}
501-
502:api_plugin_hook('poller_bottom');
503-
504-?>

Mine is a bit different:

Code: Select all

$grep -n -B 3 -A 3 poller_bottom poller.php
407-
408-            /* sleep the appripriate amount of time */
409-            if ($poller_runs_completed < $poller_runs) {
410:                    api_plugin_hook('poller_bottom');
411-                    db_close();
412-                    usleep($sleep_time * 1000000);
413-                    db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
--
458-    echo "    --debug|-d     Output debug information.  Similar to cacti's DEBUG logging level.\n\n";
459-}
460-
461:api_plugin_hook('poller_bottom');
462-
463-?>

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#49 Post by shd » Tue May 10, 2011 10:11 am

jt555 wrote:Mine is a bit different:

Code: Select all

$grep -n -B 3 -A 3 poller_bottom poller.php
407-
408-            /* sleep the appripriate amount of time */
409-            if ($poller_runs_completed < $poller_runs) {
410:                    api_plugin_hook('poller_bottom');
411-                    db_close();
412-                    usleep($sleep_time * 1000000);
413-                    db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
--
458-    echo "    --debug|-d     Output debug information.  Similar to cacti's DEBUG logging level.\n\n";
459-}
460-
461:api_plugin_hook('poller_bottom');
462-
463-?>
Show me select count(*) from plugin_fix64bit
Also try leaving debug mode on and wait for two polls to happen after adding graphs to fix. Then grep log for fix64bit.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

User avatar
jt555
Cacti User
Posts: 54
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Fix 64bit counters in Interface Traffic graphs

#50 Post by jt555 » Tue May 10, 2011 11:41 am

Show me select count(*) from plugin_fix64bit
Also try leaving debug mode on and wait for two polls to happen after adding graphs to fix. Then grep log for fix64bit.
mysql> select count(*) from plugin_fix64bit;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)



$ grep -i fix64bit /var/www/html/log/cacti.log
05/10/2011 04:06:41 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000')"
05/10/2011 04:13:22 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/10/2011 04:13:35 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/10/2011 04:13:35 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#51 Post by shd » Tue May 10, 2011 11:40 pm

jt555 wrote:mysql> select count(*) from plugin_fix64bit;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)


$ grep -i fix64bit /var/www/html/log/cacti.log
05/10/2011 04:06:41 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000')"
05/10/2011 04:13:22 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/10/2011 04:13:35 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
05/10/2011 04:13:35 PM - CMDPHP: Poller[0] DEVEL: SQL Row: "SELECT * FROM plugin_config WHERE directory='fix64bit'"
That's very strange. Table plugin_fix64bit is empty after insert? Plugin deletes entries from that table only after succeeding the fix process. Can you insert entries into that table by user cacti? Try executing "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000')" manually and check number of entries in that table shortly afterwards and if that table is populated, look at the cacti.log for fix64bit again.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

User avatar
jt555
Cacti User
Posts: 54
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Fix 64bit counters in Interface Traffic graphs

#52 Post by jt555 » Wed May 11, 2011 9:07 am

That's very strange. Table plugin_fix64bit is empty after insert? Plugin deletes entries from that table only after succeeding the fix process. Can you insert entries into that table by user cacti? Try executing "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000')" manually and check number of entries in that table shortly afterwards and if that table is populated, look at the cacti.log for fix64bit again.
manual insert:
mysql> INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000');
mysql> select * from plugin_fix64bit;
+---------------+-------------+
| local_data_id | rrd_maximum |
+---------------+-------------+
| 6406 | 1000000000 |
+---------------+-------------+
1 row in set (0.00 sec)

After setting through GUI:
mysql> select * from plugin_fix64bit;
+---------------+-------------+
| local_data_id | rrd_maximum |
+---------------+-------------+
| 6406 | 1000000000 |
| 6407 | 1000000000 |
| 6408 | 1000000000 |
+---------------+-------------+
3 rows in set (0.00 sec)


It seems to be working now. The data templates are also changed to 64-bit counters. Strange.

BTW, you probably know this but threshold plugin has to be disabled for Fix 64-bit to work.

User avatar
jt555
Cacti User
Posts: 54
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Fix 64bit counters in Interface Traffic graphs

#53 Post by jt555 » Wed May 11, 2011 9:07 am

That's very strange. Table plugin_fix64bit is empty after insert? Plugin deletes entries from that table only after succeeding the fix process. Can you insert entries into that table by user cacti? Try executing "INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000')" manually and check number of entries in that table shortly afterwards and if that table is populated, look at the cacti.log for fix64bit again.
manual insert:
mysql> INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(6406, '1000000000');
mysql> select * from plugin_fix64bit;
+---------------+-------------+
| local_data_id | rrd_maximum |
+---------------+-------------+
| 6406 | 1000000000 |
+---------------+-------------+
1 row in set (0.00 sec)

After setting through GUI:
mysql> select * from plugin_fix64bit;
+---------------+-------------+
| local_data_id | rrd_maximum |
+---------------+-------------+
| 6406 | 1000000000 |
| 6407 | 1000000000 |
| 6408 | 1000000000 |
+---------------+-------------+
3 rows in set (0.00 sec)


It seems to be working now. The data templates are also changed to 64-bit counters. Strange.

BTW, you probably know this but threshold plugin has to be disabled for Fix 64-bit to work.

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#54 Post by shd » Wed May 11, 2011 10:33 am

jt555 wrote:It seems to be working now. The data templates are also changed to 64-bit counters. Strange.
Strange indeed. But it's good to know that it is working now.
jt555 wrote:BTW, you probably know this but threshold plugin has to be disabled for Fix 64-bit to work.
Yeah, it is a known problem with old versions of thold or old versions of cacti. Or both. :)
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

gamayun
Posts: 3
Joined: Mon Dec 05, 2011 3:53 am

Re: Fix 64bit counters in Interface Traffic graphs

#55 Post by gamayun » Mon Dec 05, 2011 4:00 am

After clicking the icon fix64 in the logs I see the following entry:12/05/2011 02:44:16 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1062', SQL:"INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(40, '1000000000')'

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#56 Post by shd » Mon Dec 05, 2011 4:16 am

gamayun wrote:After clicking the icon fix64 in the logs I see the following entry:12/05/2011 02:44:16 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1062', SQL:"INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(40, '1000000000')'
1. Try to reinstall the plugin.
2. Can you run mysql under cacti user, select cacti database and then run this query? After that, show me output of this query.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

gamayun
Posts: 3
Joined: Mon Dec 05, 2011 3:53 am

Re: Fix 64bit counters in Interface Traffic graphs

#57 Post by gamayun » Mon Dec 05, 2011 4:31 am

mysql> INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(40, '1000000000');
ERROR 1062 (23000): Duplicate entry '40-1000000000' for key 1

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#58 Post by shd » Mon Dec 05, 2011 4:43 am

gamayun wrote:mysql> INSERT INTO plugin_fix64bit(local_data_id, rrd_maximum) VALUES(40, '1000000000');
ERROR 1062 (23000): Duplicate entry '40-1000000000' for key 1
Looks like you're already trying to fix this graph. Can you show me grep FIX64BIT of cacti.log file?
Also, what are the Cacti and PIA versions?
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

gamayun
Posts: 3
Joined: Mon Dec 05, 2011 3:53 am

Re: Fix 64bit counters in Interface Traffic graphs

#59 Post by gamayun » Mon Dec 05, 2011 5:00 am

I created a new graph and pressed a button. This entry appeared in the logs after the second pressing.

shd
Cacti User
Posts: 96
Joined: Mon Apr 09, 2007 1:33 pm
Location: Nizhnevartovsk, Russia

Re: Fix 64bit counters in Interface Traffic graphs

#60 Post by shd » Mon Dec 05, 2011 5:01 am

gamayun wrote:I created a new graph and pressed a button. This entry appeared in the logs after the second pressing.
Yes, but have you waited enough time to get this graph fixed? It's being fixed only after the next poll.
CentOS 64-bit, 20Gb RAM, 8xCPU, some virtual datastore. 600+ hosts, 200k+ datasources, avg polltime 45 sec

Post Reply