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

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
mani101
Posts: 15
Joined: Fri Mar 13, 2009 4:48 am
Location: Pakistan

error in CaMM plugin

Post by mani101 »

I am using CactiEZ v 6
when i try to add CaMM plugin with plugin v 2
it shows that error


Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/camm/setup.php on line 1094

Warning: Invalid argument supplied for foreach() in /var/www/html/plugins/camm/setup.php on line 1184
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

GuessWho, mani101
plz - try last version v1.5.1
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
GuessWho
Posts: 16
Joined: Tue Jan 13, 2009 2:55 pm

Post by GuessWho »

gthe,
Thank you. That worked.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Hi gthe,

This plugin is great. I have a couple if questions:

1. How do you define which colours you want to show for different facilities etc ? Some show in red for "err" etc, but most have no colour (they are white background with black text)

2. I sometimes get a JSON error when processing rules for deletion etc (don't have exact message to hand, as I'm using my Blackberry - sorry)

3. Why can't a custom view be saved ? For example, I removed the fields from the view I don't need, and resize etc. When I go back into the plugin, the defaults are loaded ?

Many thanks
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:Hi gthe,

This plugin is great. I have a couple if questions:

1. How do you define which colours you want to show for different facilities etc ? Some show in red for "err" etc, but most have no colour (they are white background with black text)
Based on priority field in syslog message

Code: Select all

 		      switch (priority) { 
 		         case 'crit' : 
 		            cls = 'crit-row'
 		            break; 
 		         case 'warning' : 
 		            cls = 'warn-row' 
 		            break; 
 		         case 'alert' : 
 		            cls = 'alert-row' 
 		            break;  
 		         case 'debug' : 
 		            cls = 'debug-row' 
 		            break;  					
 		         case 'err' : 
 		            cls = 'err-row' 
 		            break; 					
 		      }//end switch
mcutting wrote: 2. I sometimes get a JSON error when processing rules for deletion etc (don't have exact message to hand, as I'm using my Blackberry - sorry)
Error in process by poller or by manual from plugin ?
I need error discription at least..
May be timeout in AJAX request ?
mcutting wrote: 3. Why can't a custom view be saved ? For example, I removed the fields from the view I don't need, and resize etc. When I go back into the plugin, the defaults are loaded ?

Many thanks
It Should be saved in cookies for 2...7 days.
.....
Should, but does not do. I will post fix in new version ...1.5.2
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 - thanks. Which file do I need to modify for the priority colours ?
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 - js/cacti.plugin.camm-min.js. But it is minified for speed soo don't readable.
What colour shema do You wish to use ?
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 »

Well, in syslog, I could change the config.php file to get the colors to match against priority. Don't have the exact values to hand, as I'm travelling at the moment.

However, if you could tell me which file I need to make changes to, I'll do it, then post the results.

Is this ok ?
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 »

In old syslog plugin:

Code: Select all

//  Background colors, change/add/delete to suit
//  Not all these are necessary, they are according to the messages in your DB
$syslog_colors['Emergency']	= 'E6808C';
$syslog_colors['Critical']	= 'F08896';
$syslog_colors['Notice']		= '';
$syslog_colors['Info']		= '';
$syslog_colors['Debug']		= 'D0D0D0';

$syslog_colors['alert']		= 'F6909C';
$syslog_colors['err']		= 'E6808C';
$syslog_colors['crit']		= 'F08896';
$syslog_colors['warn']		= 'FCF0C0';
$syslog_colors['notice']		= '';
$syslog_colors['info']		= '';
$syslog_colors['debug']		= 'D0D0D0';
There are only 4 colour - D0D0D0, FCF0C0, E6808C and F08896

In camm:
var data = row.data.priority;
switch (data) {
case 'crit' :
cls = 'crit-row'
break;
case 'warning' :
cls = 'warn-row'
break;
case 'alert' :
cls = 'alert-row'
break;
case 'debug' :
cls = 'debug-row'
break;
case 'err' :
cls = 'err-row'
break;
}//end switch
with css like:

Code: Select all

.crit-row{ background-color: #F08896 !important; } 
.warn-row{ background-color: #FCF0C0 !important; } 
.alert-row{ background-color: #F6909C !important; }
.debug-row{ background-color: #D0D0D0 !important; }
.err-row{ background-color: #E6808C !important; }
Soo, or change js/cacti.plugin.camm-min.js (search var data = row.data.priority) and/or css/main.css
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 »

Thanks for this. I have a lot more in my config.php for syslog, so it looks like I'll have to add these in manually.

If I get any issues, I'll post back here.

Thanks again.
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 »

May be easy way - You post config.php colour section ?
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 »

Yes - this would be better. This will be in about an hour. Will you still be around ? (I am UK based)
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 »

Yes, and now and the next 8 hours.
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 »

Great - will post shortly.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Gthe - here's my config.php as requested

Code: Select all

$syslog_colors['Emergency']		= 'FF0000';
$syslog_colors['Emerg']		= 'FF0000';
$syslog_colors['Critical']		= 'FF3333';
$syslog_colors['Notice']		= '4CC417';
$syslog_colors['Info']		= '59E817';
$syslog_colors['Debug']		= 'D0D0D0';
$syslog_colors['Warning'] 		= 'FF9900';

$syslog_colors['alert']		= 'FFCC66';
$syslog_colors['err']		= 'F75D59';
$syslog_colors['error']		= 'F75D59';
$syslog_colors['crit']		= 'FF3333';
$syslog_colors['warn']		= 'FF9900';
$syslog_colors['notice']		= '4CC417';
$syslog_colors['info']		= '59E817';
$syslog_colors['debug']		= 'D0D0D0';
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests