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 »

uhtred wrote:hi,

where can i find the color selection for TRAPS? perhaps, i need new glasses.. :o
There are no configs. These options are listed deep in the code. Otherwise it will cause a very slow process plugin.
guitou wrote:hi,

it is possible to make "OR" function in the sql command ? message like '%DOT11-6-ASSOC%' OR message like '%LINEPROTO-CLUSTER_MEMBER%'

Thanks
Unfortunately at the moment - no. Because it requires the addition of priorities (brackets). Possible options - creation of two rules or manual correction of rule's sql in database (be careful)

sini wrote:
gthe wrote:
I see 2 options - either create a rule (set "execute user function") and use your own php function - to be called with the main Poller or create a stored procedure in mysql - it will be executed every time new message added in DB.
I try to "execute user function" but all I can see in the drop down menu list is fixed test functions. (see attached pic)
How can I use this? I can`t find scripts with this name in plugin camm dir or in cacti resource dir.
Is it possible to add my own scripts` path?

thx
/plugins/camm/lib/camm_user_func.php
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
uhtred
Cacti User
Posts: 121
Joined: Fri Oct 09, 2009 8:59 am
Location: Germany

Post by uhtred »

gthe wrote:
uhtred wrote:hi,

where can i find the color selection for TRAPS? perhaps, i need new glasses.. :o
There are no configs. These options are listed deep in the code. Otherwise it will cause a very slow process plugin.
Is it possible to set Trap Warnings to orange for a next release?
I think, White is no good choise for warnings and it would be same-color with cacti.log
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

uhtred wrote: Is it possible to set Trap Warnings to orange for a next release?
I think, White is no good choise for warnings and it would be same-color with cacti.log
Ok, it will be #FF9900
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 »

Hi Gthe any news about the db exec failed error that I find in my system?
The problem is still there and as I told you before I solved the problem about the poller timeout.
Any idea or any other thing to do to solve that issue???

Regards
Alessio

01/18/2010 09:01:32 AM - SYSTEM camm General STATS: AllTime:55.8248 PurgeTime:0.0062 RuleTime:0.1703 TreeTime:55.6484
01/18/2010 09:01:32 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364', SQL:"INSERT INTO `plugin_camm_tree2` (`device_id`,`description`, `hostname`,`gr_f`,`gr_v`,`agentip`,`agentip_source` ,`type` ,`period`,`_is_type`,`_is_device`,`_parent` ,`count` ,`dev_count` ,`online` ,`_is_leaf`,`_lvl`) SELECT `t0`.`device_id`,`t0`.`description`,`t0`.`hostname`,`t0`.`gr_f`,`t0`.`gr_v`,`t0`.`agentip`,`t0`.`agentip_source`,'syslog',`t0`.`period` ,'0' ,'0' ,t1.id ,t0.`count` ,`t0`.`dev_count`,'1' ,'1' ,'5' FROM plugin_camm_temp as t0 join plugin_camm_tree2 as t1 on (t0.type=t1.type and t0.hostname=t1.hostname and t0.period=t1.period and t0.gr_f=t1.gr_f) WHERE `t0`.`type`='syslog' and `t1`.`online`='1' and `_is_marker`='0' group by hostname,period,`t0`.gr_f,gr_v ON DUPLICATE KEY UPDATE `plugin_camm_tree2`.`dev_count` = values(`dev_count`), `plugin_camm_tree2`.`_parent` = values(`_parent`), `plugin_camm_tree2`.`count` = values(`count`), `plugin_camm_tree2`.`online` = '1' ;'
01/18/2010 09:01:32 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364', SQL:"INSERT INTO `plugin_camm_tree2` (`device_id`,`description`, `hostname`,`gr_f`,`gr_v`,`agentip`,`agentip_source` ,`type` ,`period`,`_is_type`,`_is_device`,`_parent` ,`count` ,`dev_count` ,`online` ,`_is_leaf`,`_lvl`) SELECT `t0`.`device_id`,`t0`.`description`,`t0`.`hostname`,`t0`.`gr_f`,`t0`.`gr_v`,`t0`.`agentip`,`t0`.`agentip_source`,'syslog',`t0`.`period` ,'0' ,'0' ,t1.id ,t0.`count` ,`t0`.`dev_count`,'1' ,'0' ,'4' FROM plugin_camm_temp as t0 join plugin_camm_tree2 as t1 on (t0.type=t1.type and t0.hostname=t1.hostname and t0.period=t1.period) WHERE `t0`.`type`='syslog' and `t1`.`online`='1' and `_is_marker`='0' group by hostname,period,gr_f ON DUPLICATE KEY UPDATE `plugin_camm_tree2`.`dev_count` = values(`dev_count`), `plugin_camm_tree2`.`_parent` = values(`_parent`), `plugin_camm_tree2`.`count` = values(`count`), `plugin_camm_tree2`.`online` = '1' ;
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 »

This error is not critical, but informative. Ie it does not affect the plugin.
But anyway thanks for letting me.

This patch:

Code: Select all

ALTER TABLE `plugin_camm_tree2` MODIFY COLUMN `typ_count` INT(10) UNSIGNED NOT NULL DEFAULT 0;
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:This error is not critical, but informative. Ie it does not affect the plugin.
But anyway thanks for letting me.

This patch:

Code: Select all

ALTER TABLE `plugin_camm_tree2` MODIFY COLUMN `typ_count` INT(10) UNSIGNED NOT NULL DEFAULT 0;
Tnx for your reply I tried your solution and sometimes now I get:
01/18/2010 02:24:44 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO manage_alerts ( idh , datetime , ids , message, ida, oid, note ) VALUES ('155', '2010/1/18, 14:24:44', '80', 'down', '', '', '')'

However if this is not critical is not a problem :)

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
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

smlick wrote:
Tnx for your reply I tried your solution and sometimes now I get:
01/18/2010 02:24:44 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1366', SQL:"INSERT INTO manage_alerts ( idh , datetime , ids , message, ida, oid, note ) VALUES ('155', '2010/1/18, 14:24:44', '80', 'down', '', '', '')'

However if this is not critical is not a problem :)

Regards
Alessio
Error 1366 = 'Incorrect string value'. If you try run sql command:

Code: Select all

INSERT INTO manage_alerts ( idh , datetime , ids , message, ida, oid, note) VALUES ('155', '2010/1/18, 14:24:44', '80', 'down', '', '', '')
you will see full error description:

Code: Select all

mysql> INSERT INTO manage_alerts ( idh , datetime , ids , message, ida, oid, not
e ) VALUES ('155', '2010/1/18, 14:24:44', '80', 'down', '', '', '');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> SHOW WARNINGS;
+---------+------+-------------------------------------------------------+
| Level   | Code | Message                                               |
+---------+------+-------------------------------------------------------+
| Warning | 1366 | Incorrect integer value: '' for column 'ida' at row 1 |
+---------+------+-------------------------------------------------------+
1 row in set (0.02 sec)
Soo, it is manage plugin 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 »

Ok :oops: Tnx
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

I think I have found a bug...

I have the latest version of the settings plugin, which is now at v6 (PIA 2x compatible). Despite this, the mail function no longer works, and complains the settings plugin is missing.

In setup,.php, look at the lines

Code: Select all

 function camm_check_dependencies() {
 	global $plugins, $config;
 	$rezult = false;
 	if (in_array('settings', $plugins)) {
 		$v = settings_version();
 		if ($v['version'] >= 0.2) {
 			$rezult = true;
 		}
Temporarily, I've bodged this to make it work, as I have lost email functionality, by changing

Code: Select all

if (in_array('settings', $plugins)) {
to

Code: Select all

if (!in_array('settings', $plugins)) {
Not very elegant at all, and only a super-quick fix to get things running again. Perhaps gthe could factor in the new release of the PIA2.x compliant settings plugin into the code ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
sini
Cacti User
Posts: 91
Joined: Mon Nov 24, 2003 10:22 am
Location: Hungary

Post by sini »

I can confirm mcutting mail problem report!
My solution was to add the settings plugin name in <cacti>/include/global.php

$plugins[] = 'settings';
Sini
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Agreed this will work, but ut's not recommended to have an entry in global.php, and use the plugin management as well for the same plugin.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

Post by smlick »

Yes I also confirm e-mail notification error and also doesn't apply change to rule.
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 »

sini wrote:I can confirm mcutting mail problem report!
My solution was to add the settings plugin name in <cacti>/include/global.php

$plugins[] = 'settings';
For me doesn't work!!!

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
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

the new version will be checking this, but will be made only 1 time for the each poller run

Code: Select all

 function camm_check_dependencies() {
 	global $plugins, $config;
 	$rezult = false;
 	if (in_array('settings', $plugins)) {
 		$v = settings_version();
 		if ($v['version'] >= 0.2) {
 			$rezult = true;
 		}
 		
 	}else{
		$v = db_fetch_cell("SELECT `version`  FROM `plugin_config` where `directory`='settings';");
		if (isset($v) and $v >= 0.2 ){
			$rezult = true;
		}
	
	}
	db_execute("UPDATE  `settings` SET `value`=" . $rezult . " where `name`='camm_dependencies'");
//force update camm_dependencies in cache	
$temp = read_config_option("camm_dependencies", 	true);
 	return $rezult;
	
 } 
I can not give all the plug-in - because it has a lot of changes and it is not ready
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 »

mcutting wrote:I think I have found a bug...

I have the latest version of the settings plugin, which is now at v6 (PIA 2x compatible). Despite this, the mail function no longer works, and complains the settings plugin is missing.

In setup,.php, look at the lines

Code: Select all

 function camm_check_dependencies() {
 	global $plugins, $config;
 	$rezult = false;
 	if (in_array('settings', $plugins)) {
 		$v = settings_version();
 		if ($v['version'] >= 0.2) {
 			$rezult = true;
 		}
Temporarily, I've bodged this to make it work, as I have lost email functionality, by changing

Code: Select all

if (in_array('settings', $plugins)) {
to

Code: Select all

if (!in_array('settings', $plugins)) {
Not very elegant at all, and only a super-quick fix to get things running again. Perhaps gthe could factor in the new release of the PIA2.x compliant settings plugin into the code ?

Thanks
Also with this trick nothing :(
Doesn't appare anymore the snmp error but no message sent.
Also I'm not able to create new rule or edit the existing one, in detail I create or edit a rule but when I press save the system go as before.

Any idea...a rollback to previous version?

Regards
Alessio
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests