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

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

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

Post by gthe »

Enable debug in camm and check cacti.log
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 »

This is what I get:

01/29/2010 10:21:13 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_function`='0', `is_mark`='0', `name`='dfshsrth', `order`='1', `rule_type`='syslog', `rule_enable`='0', `sup_mode`='', `marker`='', `notes`='', `date`='2010-01-29T10:21:09', `user_id`='1' '
01/29/2010 10:20:24 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_function`='0', `is_mark`='0', `name`='ryfjghkidk', `order`='1', `rule_type`='syslog', `rule_enable`='0', `sup_mode`='', `marker`='', `notes`='', `date`='2010-01-29T10:20:21', `user_id`='1' '


Regards
Alessio
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

Also an edit of the rule is not permitted.
01/29/2010 10:31:13 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"UPDATE `plugin_camm_rule` SET `order`='1', `sup_mode`='', `date`='2010-01-29T10:31:10', `user_id`='1' WHERE (`id`=102)'

Any idea?
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

smlick wrote:Also an edit of the rule is not permitted.
01/29/2010 10:31:13 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"UPDATE `plugin_camm_rule` SET `order`='1', `sup_mode`='', `date`='2010-01-29T10:31:10', `user_id`='1' WHERE (`id`=102)'

Any idea?
open mysql console and run

Code: Select all

UPDATE `plugin_camm_rule` SET `order`='1', `sup_mode`='', `date`='2010-01-29T10:31:10', `user_id`='1' WHERE (`id`=102)'
and you can see a full description of the error.
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 »

If I make a select with table, id=102 and date the system dysplay the correct entry, so date is ok but when I try SET `order`='1' or `sup_mode`='' I get syntax error. :roll:

Bye
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

I tried also to uninstall and reinstall the plugin (same version 1.6.51) and then I replace only the table with rule but with no success.
I do also a check consistency of the db and all seems to be ok.
No idea about to do :cry:

Bye
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

smlick wrote:I tried also to uninstall and reinstall the plugin (same version 1.6.51) and then I replace only the table with rule but with no success.
I do also a check consistency of the db and all seems to be ok.
No idea about to do :cry:

Bye
First of all - 1366 - is not a bug but a warning, and it will only be shown if you have to connect to mysql using an root account, and not specially created separate mysql user (not good)

Secondly - you can temporarily fix this problem so modified table

Code: Select all

ALTER TABLE `plugin_camm_rule` MODIFY COLUMN `sup_mode` VARCHAR(2) DEFAULT 1;
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 »

gthe wrote:
smlick wrote:I tried also to uninstall and reinstall the plugin (same version 1.6.51) and then I replace only the table with rule but with no success.
I do also a check consistency of the db and all seems to be ok.
No idea about to do :cry:

Bye
First of all - 1366 - is not a bug but a warning, and it will only be shown if you have to connect to mysql using an root account, and not specially created separate mysql user (not good)

Secondly - you can temporarily fix this problem so modified table

Code: Select all

ALTER TABLE `plugin_camm_rule` MODIFY COLUMN `sup_mode` VARCHAR(2) DEFAULT 1;
I don't know why but with this fix I'm able for example to modify the rule order but it's not yet possible for me to create a new rule:

01/29/2010 03:59:16 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_function`='0', `is_mark`='0', `name`='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', `order`='1', `rule_type`='syslog', `rule_enable`='1', `email`='', `sup_mode`='', `email_message`='', `marker`='', `notes`='', `date`='2010-01-29T15:59:13', `user_id`='1' '

I create the rule and the row I see the row but when I press save the row it disappear.
I don't want to waste your time so if you are busy developing the new version I'll wait or I try a rollback to a previous version.

Regards
Alessio

Now I'm able to modify old rules and create new one
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
someone17
Posts: 8
Joined: Sun Jan 31, 2010 6:21 pm

Post by someone17 »

gthe wrote: If I understand you correctly, it is already implemented (perhaps just not fully). For example, I want to have quick access to all the events on the successful login to the switches. This necessary:
1. Create a rule that would explicitly select the required messages and this rule should add a mark to these reports - see camm_marker_0.png.
2. In settings tabs of camm set parameter [2. camm General settings] - [Create tree menu for markers] = true.
3. Or forced to start of this rule, or wait for the poller start.
4. In syslog menu press Recreate button.
After that you can see like camm_marker_1.png.
Hi,

In Camm general settings I switched Create tree menu for markers to true. When I click recreate button I still not see Markers tree.

Tnx for help!
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

I tried also to uninstall the plugin (disable, uninstall, delete file from folder plugin) and then reinstall the version 1.6.4b but nothing has changed so I think is such problem with db.
I'm not able to create new rule but I'm able to delete old one or edit.
How it could be possible?
Also I get "ERROR: SMTP Host rejected to address: 501 5.5.4 Invalid Address" from the rule with e-mail alert (they works like a charm before).

Regards
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
sini
Cacti User
Posts: 91
Joined: Mon Nov 24, 2003 10:22 am
Location: Hungary

Post by sini »

smlick wrote:I tried also to uninstall the plugin (disable, uninstall, delete file from folder plugin) and then reinstall the version 1.6.4b but nothing has changed so I think is such problem with db.
I'm not able to create new rule but I'm able to delete old one or edit.
How it could be possible?
Also I get "ERROR: SMTP Host rejected to address: 501 5.5.4 Invalid Address" from the rule with e-mail alert (they works like a charm before).

Regards
quote="smlick"]I tried also to uninstall the plugin (disable, uninstall, delete file from folder plugin) and then reinstall the version 1.6.4b but nothing has changed so I think is such problem with db.
I'm not able to create new rule but I'm able to delete old one or edit.
How it could be possible?
Also I get "ERROR: SMTP Host rejected to address: 501 5.5.4 Invalid Address" from the rule with e-mail alert (they works like a charm before).

Regards[/quote]

Seems to me like a permission problem with camm sql tables. Might cactiuser unable to modify necessary tables.
After a system update i had also a weird sql problem under linux so I re-added all the privileges to camm syslog table.

SMTP 501 is syntax error in arguments so check the mail settings, mail log. Does the test mail work?
Sini
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

sini tnx for your reply.

I found the problem but I didn't find a solution.

I tried an insert from CAMM gui with debug enable and I get:

02/01/2010 03:34:48 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_function`='0', `is_mark`='0', `name`='prova', `order`='1', `rule_type`='syslog', `rule_enable`='0', `email`='', `sup_mode`='', `email_message`='', `marker`='', `notes`='safafsdg', `date`='2010-02-01T15:34:45', `user_id`='1' '

So I tried in mySQL CLI the same command to see the error:

mysql> INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_f
unction`='0', `is_mark`='0', `name`='prova', `order`='1', `rule_type`='syslog
', `rule_enable`='0', `email`='', `sup_mode`='', `email_message`='', `marker`=''
, `notes`='safafsdg', `date`='2010-02-01T15:34:45', `user_id`='1';
ERROR 1366 (HY000): Incorrect integer value: '' for column 'marker' at row 1

So I tried the same command with "0" in field marker and I get:

mysql> INSERT INTO `plugin_camm_rule` SET `is_delete`='0', `is_email`='0', `is_f
unction`='0', `is_mark`='0', `name`='prova', `order`='1', `rule_type`='syslog
', `rule_enable`='0', `email`='', `sup_mode`='', `email_message`='', `marker`='0', `notes`='safafsdg', `date`='2010-02-01T15:34:45', `user_id`='1';
Query OK, 1 row affected (0.00 sec)

So why CAMM sent an insert without value in field marker?

Also for the SMTP problem I find a solution but I didn't understand the problem.
I get SMTP error only in field with multiple account (like pippo@123.it,pluto@123.it), I tried also , or ; like separator but nothing as changed (they work well before).

When I delete multiple address in the email field worked.

Any new ideas :-?
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
someone17
Posts: 8
Joined: Sun Jan 31, 2010 6:21 pm

Post by someone17 »

someone17 wrote:
gthe wrote: If I understand you correctly, it is already implemented (perhaps just not fully). For example, I want to have quick access to all the events on the successful login to the switches. This necessary:
1. Create a rule that would explicitly select the required messages and this rule should add a mark to these reports - see camm_marker_0.png.
2. In settings tabs of camm set parameter [2. camm General settings] - [Create tree menu for markers] = true.
3. Or forced to start of this rule, or wait for the poller start.
4. In syslog menu press Recreate button.
After that you can see like camm_marker_1.png.
Hi,

In Camm general settings I switched Create tree menu for markers to true. When I click recreate button I still not see Markers tree.

Tnx for help!
I really need help.

I use syslog-ng, in general camm plugin works fine, but Rules and Markers don't work.

(camm and cacti are latest version)
someone17
Posts: 8
Joined: Sun Jan 31, 2010 6:21 pm

Post by someone17 »

Maybe this will help:

Code: Select all

02/02/2010 07:27:23 PM - camm: Poller[0] -4 Mark records [1]
02/02/2010 07:27:23 PM - camm: Poller[0] - Select records to process = [0]
02/02/2010 07:27:23 PM - camm: Poller[0] - Found count records==[0]
02/02/2010 07:27:23 PM - camm: Poller[0] - SQL where conditions=[facility='cron' AND `cacti`.`plugin_camm_syslog`.`status`=2]
02/02/2010 07:27:23 PM - camm: Poller[0] - Process already processed record (force execute)
02/02/2010 07:27:23 PM - camm: Poller[0] = Start process rule id=[110] 
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

smlick wrote:....

So why CAMM sent an insert without value in field marker?

....
because:
`is_mark`='0'
This means that markering is not in principle. We need to look at what is transmitted from browser to server.
in camm_db_admin.php after

Code: Select all

 function camm_save_rule(){
    
 if ( isset($_POST['data'])){
 	
    $ids = $_POST['data']; // Get our array back and translate it :

add this line:

Code: Select all

camm_debug("php camm_save_rule  ids=[" . $ids . "]");

after - save add/save rule again and check cacti.log
smlick wrote: Also for the SMTP problem I find a solution but I didn't understand the problem.
I get SMTP error only in field with multiple account (like pippo@123.it,pluto@123.it), I tried also , or ; like separator but nothing as changed (they work well before).

When I delete multiple address in the email field worked.

Any new ideas :-?
You can use the separator "," and ";". Everything depends on configuration/version of your SMTP server

someone17 wrote:Maybe this will help:

Code: Select all

02/02/2010 07:27:23 PM - camm: Poller[0] -4 Mark records [1]
02/02/2010 07:27:23 PM - camm: Poller[0] - Select records to process = [0]
02/02/2010 07:27:23 PM - camm: Poller[0] - Found count records==[0]
02/02/2010 07:27:23 PM - camm: Poller[0] - SQL where conditions=[facility='cron' AND `cacti`.`plugin_camm_syslog`.`status`=2]
02/02/2010 07:27:23 PM - camm: Poller[0] - Process already processed record (force execute)
02/02/2010 07:27:23 PM - camm: Poller[0] = Start process rule id=[110] 
run this

Code: Select all

	
select count(*) from `cacti`.`plugin_camm_syslog` where facility='cron' AND `cacti`.`plugin_camm_syslog`.`status`=2;

and show result
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 2 guests