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 »

mcutting wrote:Is email broken again in version 1.6.4 ? I have existing rules from previous versions that worked fine before, but don't seem to anymore - I don't get any emails when I run them manually ??
Note the parameter [Count row to test] in settings. Try to set it to [ALL] and force rule.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Set "Rows to test" as "All". Query returns all rows, but no email is ever sent. One email address is specified.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

mcutting wrote:Set "Rows to test" as "All". Query returns all rows, but no email is ever sent. One email address is specified.
I checked the function on 2 different servers - and everything works.
Can you turn camm debug on and check the cacti log for the presence of the correct string sql and [Found count records] > 0 ?

You just have updated all the files to 1.6.4 ?
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

gthe wrote:
mcutting wrote:Set "Rows to test" as "All". Query returns all rows, but no email is ever sent. One email address is specified.
I checked the function on 2 different servers - and everything works.
Can you turn camm debug on and check the cacti log for the presence of the correct string sql and [Found count records] > 0 ?

You just have updated all the files to 1.6.4 ?
Definitely works:

09/10/2009 02:35:48 PM - camm: Poller[0] - SQL where conditions=[message like '%Knowledge Consistency Checker (KCC) has detected problems%' AND `syslog`.`plugin_camm_syslog_incoming`.`status`=1]

However:

09/10/2009 02:35:48 PM - camm: Poller[0] - Process only new records
09/10/2009 02:35:48 PM - camm: Poller[0] = Start process rule id=[129]
09/10/2009 02:35:48 PM - camm: Poller[0] - Found count records==[0]

So I guess that this explains why I don't get any emails ?

However, when running the rule manually, the process count increases, but I don't get any email notification.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

mcutting wrote: However, when running the rule manually, the process count increases, but I don't get any email notification.
Cacti debug log from this - would be good.
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 »

And you can try this version - only added a few debug lines
Last edited by gthe on Tue Sep 15, 2009 4:11 am, edited 1 time in total.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Clone rule problem

Post by pthaynes »

gthe wrote:From first post:
CAMM --- 1.6.4 ---2009-09-03
  • - Added the possibility of cloning rules;
    - Added "host type" field in rule's sql;
    - Added ability to the rapid removal of records through the context menu for syslog and snmp traps Menu Tree;
    - minor fixs;
After updating the files, be sure to press CTRL + F5 to refresh your browser cache!
gthe

Firstly thanks for all your work on this. The ability to select logs based on the host template is exactly what I wanted. Suddenly the size of some of my rules has reduced significantly, and it has removed a possible source of user error for my site. Equally the Clone rule feature is useful to me.

I've tried out the "clone rule" and receive an error (attached) after I have put in the new name. It looks like this error is cosmetic, as if I click on the refresh icon on the rules screen I see my cloned rule. The cloned rule also seems to work when I run it. I am using the new version of the plugin - 1.6.4, and my browser is IE7. I have used Ctrl-F5 to refresh my browser cache a couple of times and that seemed to make no difference.

Regards,
Peter
Attachments
clone rule.JPG
clone rule.JPG (11.9 KiB) Viewed 3597 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Re: Clone rule problem

Post by gthe »

pthaynes wrote: I've tried out the "clone rule" and receive an error (attached) after I have put in the new name.
It seems that this is not camm error, but cacti.

In my /lib/database.php:237

Code: Select all

/* db_fetch_insert_id - get the last insert_id or auto incriment
   @returns - the id of the last auto incriment row that was created */
function db_fetch_insert_id($db_conn = FALSE) {
	global $cnn_id;

	/* check for a connection being passed, if not use legacy behavior */
	if (!$db_conn) {
		$db_conn = $cnn_id;
	}

	return $db_conn->Insert_ID();
}
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Re: Clone rule problem

Post by pthaynes »

gthe wrote:It seems that this is not camm error, but cacti.
Sorry - in my rush I didn't include my Cacti version. I am using version 0.8.7c. That may be why others aren't seeing an issue while I am.
In my /lib/database.php file from line 234 onwards (so you can see the referred to function) I had:

Code: Select all

function db_fetch_insert_id() {
        global $cnn_id;

        /* check for a connection being passed, if not use legacy behavior */
        if (!$db_conn) {
                $db_conn = $cnn_id;
        }

        return $db_conn->Insert_ID();
}
It looks like the function assumes that $db_conn is defined as a variable. I checked the same function in the latest Cacti release in the database.php - It defaults the $db_conn to FALSE as in the code below:

Code: Select all

function db_fetch_insert_id($db_conn = FALSE) {
        global $cnn_id;

        /* check for a connection being passed, if not use legacy behavior */
        if (!$db_conn) {
                $db_conn = $cnn_id;
        }

        return $db_conn->Insert_ID();
}
I modified that function in my database.php file to match and it now works fine.

Sorry to bug you with a Cacti problem that I should have found myself. Hope the above helps anyone else with the same problem. Thanks for your help gthe.

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

Post by gthe »

pthaynes, I want to ask you - if you have a similar problem like mcutting, with email action in rule ?
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

gthe wrote:And you can try this version - only added a few debug lines
Here we go

Code: Select all

09/11/2009 08:48:57 AM - camm: Poller[0] Alert Rule 'KCC has detected problems' - Email Action - has been activated without records
09/11/2009 08:48:57 AM - camm: Poller[0] - Select records to process = [1]
09/11/2009 08:48:57 AM - camm: Poller[0] - Found count records==[0]
09/11/2009 08:48:56 AM - camm: Poller[0] - SQL where conditions=[message like '%Knowledge Consistency Checker (KCC) has detected problems%' AND `syslog`.`plugin_camm_syslog`.`status`=2]
09/11/2009 08:48:56 AM - camm: Poller[0] - Process already processed record (force execute)
09/11/2009 08:48:56 AM - camm: Poller[0] = Start process rule id=[128] 
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
pthaynes
Cacti User
Posts: 56
Joined: Mon Apr 20, 2009 1:29 am
Location: Australia

Email action in rules

Post by pthaynes »

gthe wrote:pthaynes, I want to ask you - if you have a similar problem like mcutting, with email action in rule ?
gthe - My email rules work fine. I have some that send email to two addresses and one that sends email to only one address. Both types of rules work.

Regards,

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

Post by gthe »

Thanks, I have found error and will upload patch very soon.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

gthe wrote:Thanks, I have found error and will upload patch very soon.
Thanks for that - I have even uninstalled the whole plugin, and recreated all rules from scratch - no mail at all !

Everything else works as it should :(
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

The problem in the type of 'alert' column - its maximum value=127, so you rule with id=128 don't work!
Replace this file and reopen camm for autoupgrade.
Last edited by gthe on Tue Sep 15, 2009 4:11 am, edited 2 times in total.
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 0 guests