CaMM (Cacti Message Management) plugin v1.6.7 2010-08-26

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Still trying to debug this famous "No row data for this ID"

I've modified the error message to show the SQL request done. Here it is below:

Code: Select all

SELECT CONVERT(GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '') USING UTF8) as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
Then, executing this request in mysql "by hand", here is the error message I Obtain:

Code: Select all

mysql> SELECT CONVERT(GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '') USING UTF8) as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
mysql> 
It seems clear to me that CAMM is formatting this SQL request in a way which is not correct for MySQL (we have version 5.0.45 of MySQL). Apparently there should be a group by clause in the SQL request.

Potentially, the problem in CAMM 1.6.62 is in the file camm_db.php at lines 826 and 969.

Is somebody able to tell me if the mistake is from my side, or if it is not the case, is somebody able to provide a fix?

Thanks for your support.

KR.
[/code]
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

hahnn,
Sorry for delay. Can you run this sql:

Code: Select all

SELECT count(*) FROM `cacti`.`plugin_camm_syslog` where `id`='60159';
and this:

Code: Select all

SELECT t2.`rule_id` as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM
(SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
and this:

Code: Select all

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Code: Select all

SELECT count(*) FROM `cacti`.`plugin_camm_syslog` where `id`='60159';
gives:
mysql> SELECT count(*) FROM `cacti`.`plugin_camm_syslog` where `id`='60159';
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)

Code: Select all

SELECT t2.`rule_id` as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM
(SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
gives:

Code: Select all

mysql> SELECT t2.`rule_id` as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM
    -> (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
| rules_name | id    | host    | sourceip  | facility | priority | sys_date            | message                                                                                                             | status | alert | add  | description | host_template_id | device_id |
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
|       NULL | 60159 | infra01 | 127.0.0.1 | local0   | warning  | 2010-07-21 12:38:52 | snmptt-sys[30813]:  Total traps received=218,Total traps translated=107,Total traps ignored=0,Total unknown traps=0 |      2 |     0 |      | NULL        |             NULL |      NULL | 
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
1 row in set (0.00 sec)
And
SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;
gives:
mysql> SELECT @@GLOBAL.sql_mode;
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
| |
+-------------------+
1 row in set (0.00 sec)

mysql> SELECT @@SESSION.sql_mode;
+--------------------+
| @@SESSION.sql_mode |
+--------------------+
| |
+--------------------+
1 row in set (0.00 sec)
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

I think this is mysql version specific error - I will check it.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

hahnn,
test this:

Code: Select all

SELECT GROUP_CONCAT(t3.name SEPARATOR '')  as rules_name,
t1.*,host.description, host.host_template_id, host.id as device_id FROM
(SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;

Code: Select all

SELECT GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '')  as rules_name,
t1.*,host.description, host.host_template_id, host.id as device_id FROM
(SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` )
left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id)
group by id;
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Your first SQL request gives:

Code: Select all

mysql> SELECT GROUP_CONCAT(t3.name SEPARATOR '')  as rules_name,
    -> t1.*,host.description, host.host_template_id, host.id as device_id FROM
    -> (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
And the second one gives:

Code: Select all

mysql> SELECT GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '')  as rules_name,
    -> t1.*,host.description, host.host_template_id, host.id as device_id FROM
    -> (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` )
    -> left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id)
    -> group by id;
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
| rules_name | id    | host    | sourceip  | facility | priority | sys_date            | message                                                                                                             | status | alert | add  | description | host_template_id | device_id |
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
| NULL       | 60159 | infra01 | 127.0.0.1 | local0   | warning  | 2010-07-21 12:38:52 | snmptt-sys[30813]:  Total traps received=218,Total traps translated=107,Total traps ignored=0,Total unknown traps=0 |      2 |     0 |      | NULL        |             NULL |      NULL | 
+------------+-------+---------+-----------+----------+----------+---------------------+---------------------------------------------------------------------------------------------------------------------+--------+-------+------+-------------+------------------+-----------+
1 row in set (0.01 sec)
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Try this one:

Code: Select all

select CONVERT(GROUP_CONCAT(concat('test=',6+8,';\r\n') SEPARATOR '-')USING UTF8);
It is a pure sql code, without reference to tables, so it should work.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Result is:

Code: Select all

mysql> select CONVERT(GROUP_CONCAT(concat('test=',6+8,';\r\n') SEPARATOR '-')USING UTF8);
+----------------------------------------------------------------------------+
| CONVERT(GROUP_CONCAT(concat('test=',6+8,';\r\n') SEPARATOR '-')USING UTF8) |
+----------------------------------------------------------------------------+
| test=14;
                                                                 | 
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Try this file to replace the original:
Attachments
camm_db.rar
(8.81 KiB) Downloaded 148 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

hahnn wrote:I'm continuing my tests about the impossibility to have the "view full trap" window showing anything.

I've installed syslog-ng v 3.0.2, and it is configured to send all in the plugin_camm_syslog table of the database used by camm. Then I've enabled syslog in camm (set to true in the settings).

So, a new "Syslogs" tab appeared and I can see all my syslog entries in camm.

But no luck, double-clicking as for SNMP traps on a log entry, the "View full syslog message" window has the same problem. Same error again: No row data for this ID.

So I don't think that what I wrote just in my previous post is of any interest...

An idea somebody ?

Thanks for your support ;-)

KR.
Look at this - http://forums.cacti.net/viewtopic.php?t=38597
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

hahnn wrote:Still trying to debug this famous "No row data for this ID"

I've modified the error message to show the SQL request done. Here it is below:

Code: Select all

SELECT CONVERT(GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '') USING UTF8) as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
Then, executing this request in mysql "by hand", here is the error message I Obtain:

Code: Select all

mysql> SELECT CONVERT(GROUP_CONCAT(concat(t2.`rule_id`, ' [',t3.name, ']'),';\r\n' SEPARATOR '') USING UTF8) as rules_name,t1.*,host.description, host.host_template_id, host.id as device_id FROM (SELECT * FROM `cacti`.`plugin_camm_syslog` where `id`='60159' ) as t1 Left join host on (t1.`host`=`host`.`hostname` ) left join plugin_camm_keys as t2 on (t2.`krid`=t1.`id`) left join plugin_camm_rule as t3 on (t2.rule_id=t3.id) ;
ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
mysql> 
It seems clear to me that CAMM is formatting this SQL request in a way which is not correct for MySQL (we have version 5.0.45 of MySQL). Apparently there should be a group by clause in the SQL request.

Potentially, the problem in CAMM 1.6.62 is in the file camm_db.php at lines 826 and 969.

Is somebody able to tell me if the mistake is from my side, or if it is not the case, is somebody able to provide a fix?

Thanks for your support.

KR.
[/code]
I have also this kind of problem and also I have an old mySQL version.
Now I'm not in office :) but when I go back from holiday I will check if is your same version.

Regards
Alessio
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
JOEGOR
Posts: 13
Joined: Tue Oct 13, 2009 11:59 pm

Post by JOEGOR »

Hi gthe,

I have some problem when I use camm.

1. CAMM can't show the unknow trap, but I login mysql, the unknow trap already in the databases. the file attached.

2. I want to set email alert but fail. I already enable the rules.
I already complete the email setting at console-setting-mail, and successfully send out a test mail.

Please help!!!!
Thanks~~~
Attachments
unknwon_trap.txt
(12.12 KiB) Downloaded 143 times
email_alert.jpg
email_alert.jpg (87.55 KiB) Viewed 3336 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

JOEGOR wrote:Hi gthe,

I have some problem when I use camm.

1. CAMM can't show the unknow trap, but I login mysql, the unknow trap already in the databases. the file attached.
Try this file.
JOEGOR wrote: 2. I want to set email alert but fail. I already enable the rules.
I already complete the email setting at console-setting-mail, and successfully send out a test mail.

Please help!!!!
Thanks~~~
Enable debug mode in camm, wait for poller run (or force execute rule) and PM cacti.log for me.
Attachments
camm_db.zip
(9.56 KiB) Downloaded 120 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

Hello,

examined the apache2-log:
File does not exist: /var/www/cacti/plugins/camm/css/images, referer: https://1x.xx.x/cacti/plugins/camm/css/main.css
in the original distribution pack there is no directoy ./css/images.

Torsten
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Fix:
Attachments
main.zip
(2.15 KiB) Downloaded 145 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests