CLI Scripts unusable

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

CLI Scripts unusable

Post by Alice »

Well... let's try this:
root@stats3:/home/cacti/cli# php add_graphs.php --list-input-fields --graph-template-id=47

The scripts gets to this query:
SELECT DISTINCT
data_input_fields.data_name AS `name`,
data_input_fields.name AS `description`,
data_input_data.value AS `default`,
data_template_data.data_template_id,
data_input_fields.id AS `data_input_field_id`
FROM data_input_data
INNER JOIN (((data_template_rrd
INNER JOIN (graph_templates
INNER JOIN graph_templates_item
ON graph_templates.id = graph_templates_item.graph_template_id)
ON data_template_rrd.id = graph_templates_item.task_item_id)
INNER JOIN data_template_data
ON data_template_rrd.data_template_id=data_template_data.data_template_id)
INNER JOIN data_input_fields
ON data_template_data.data_input_id=data_input_fields.data_input_id)
ON (data_input_data.data_template_data_id = data_template_data.id)
AND (data_input_data.data_input_field_id = data_input_fields.id)
WHERE (((graph_templates.id)=47)
AND ((data_input_data.t_value)='on')
AND ((data_input_fields.input_output)='in'))

which brings down MySQL.

mysql> select count(*) from data_input_fields;
+----------+
| count(*) |
+----------+
| 95 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from data_template_data;
+----------+
| count(*) |
+----------+
| 4773 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from graph_templates;
+----------+
| count(*) |
+----------+
| 47 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from data_template_rrd;
+----------+
| count(*) |
+----------+
| 9720 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from graph_templates_item;
+----------+
| count(*) |
+----------+
| 40078 |
+----------+
1 row in set (0.00 sec)

MySQL it's on a sepparate server, with a P4 3.0 HT / 1GB RAM, with a CPU usage average of 9%
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version? It runs just fine on my system. You might also want to remove the brackets around the where clause below:

Code: Select all

WHERE (((graph_templates.id)=47) 
AND ((data_input_data.t_value)='on') 
AND ((data_input_fields.input_output)='in')) 
You might also want to repair the tables in question. Wierd.

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

Solved.
ALTER TABLE `data_input_data` ADD INDEX ( `t_value` )
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Ahh, oh shit, you have a big installation...

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
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Can you open a bug report so that we don't loose that tidbit?

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

What version what?
Cacti is 0.8.7a
MySQL is 5.0.37
Tables are OK, checked.
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Alice, submit a bug report to http://bugs.cacti.net

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

Done, http://bugs.cacti.net/view.php?id=1093 .I've posted the versions while you were posting.
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Can you post your "/etc/my.cnf"...

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
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Also,

du -k /var/lib/mysq/cacti

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

root@mysql:/var/lib/mysql# du -k cacti3/
23332 cacti3/

submited to mantis too.
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
Tybio
Cacti User
Posts: 80
Joined: Thu Feb 16, 2006 8:14 am

Post by Tybio »

I'm seeing something similar when I try to use the script. I'll try that fix and let you know if it works for me.
Tybio
Cacti User
Posts: 80
Joined: Thu Feb 16, 2006 8:14 am

Post by Tybio »

FYI, this fixed the add_graphs.php problem I was having with my script.
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Anyone post a "/etc/my.cnf" file?

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

root@mysql:~# free
total used free shared buffers cached
Mem: 1033036 624384 408652 0 197008 240520
-/+ buffers/cache: 186856 846180
Swap: 1004020 0 1004020


root@mysql:~# cat /etc/my.cnf |grep -v "#"

[client]
port = 3306
socket = /tmp/mysql.sock

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 32M
table_cache = 64k
sort_buffer_size = 64M
read_buffer_size = 64M
read_rnd_buffer_size = 64M
myisam_sort_buffer_size = 64M
thread_cache_size = 256
query_cache_size=64M
set-variable=key_buffer=64M
set-variable=max_connections=250
thread_concurrency = 2
net_buffer_length = 128K
max_heap_table_size = 128M
tmp_table_size = 256M
server-id = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M

[mysqlhotcopy]
interactive-timeout
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests