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

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

Post by gthe »

*******************************************************************************

Program ........ CaMM (CActi Message Management) Plugin for Cacti
Purpose ........ View and manage syslog/snmptt messages


*******************************************************************************


----[ Purpose
  • Plugin, which allows you to view/delete/alert/mark/manage SNMPTT (snmp traps and infos) OR/AND SYSLOG messages stored in a database.

----[ Installation
  • IMPORTANT: This plugin ONLY show data from mysql. It does not accept traps/syslog messages itself.
    Requirements:
  • - Cacti 0.8.7b/c/d/g
    - Plugin Architecture v2.x for Cacti v0.8.7
    For syslog component:
    - Syslog-ng (dump data to mysql);
    For snmptt component:
    - NET-SNMP trapd
    - SNMPTT from http://www.snmptt.org/
  • 1. Install just like any other plugin, just throw it in the plugin directory,
    in a folder called camm.
    For PIA 2.0 and higher go to :
    1.1 Console->Plugin Management->Uninstalled tab->camm -> install
    1.2 Console->Plugin Management->Installed tab->camm -> enable
    1.3 Open camm tab to start autoupgrade process;
    1.4 In camm tab open "setting" tab and enable components to use (snmptt, syslog);
  • 2. Configure SNMPTT Component (only if You need this component and enable it):
    Info about installing and configure snmptt programm - http://www.snmptt.org/
    After that change same setting in snmptt.ini:

    Code: Select all

    			mibs_environment = ALL
    			date_time_format = %Y-%m-%d %H:%M:%S
    			unknown_trap_log_enable = 1
    			statistics_interval = 300 # or 3000
    			db_translate_enterprise = 1
    			
    			mysql_dbi_enable = 1
    			mysql_dbi_table = plugin_camm_snmptt
    			mysql_dbi_table_unknown = plugin_camm_snmptt_unk
    			mysql_dbi_table_statistics = plugin_camm_snmptt_stat
    
    			mysql_dbi_host = localhost 			# << CHANGE !
    			mysql_dbi_port = 3306 				# << CHANGE !
    			mysql_dbi_database = cacti			# << CHANGE !
    			mysql_dbi_username = cactiuser		# << CHANGE !
    			mysql_dbi_password = cactipassword	# << CHANGE !
    
    			mysql_ping_on_insert = 1
    			mysql_ping_interval = 300
    			date_time_format_sql = %Y-%m-%d %H:%M:%S
    			stat_time_format_sql = %Y-%m-%d %H:%M:%S
  • 3. Configure SYSLOG Component (only if You need this component and enable it):
    1. Install syslog-ng ([HOWTO] Install Syslog-ng on Linux/Unix Cacti vers - http://forums.cacti.net/viewtopic.php?t=26040)
    Here may be 2 shems of work
    • a)One table - all incoming messages stored in one table (default "plugin_camm_syslog")
      b)Two tables - all incoming messages stored in temp table (default "plugin_camm_syslog_incoming"). On each run poller process all rules and after that copy messages to main table
    You can choose it in settings tab of plugin and import necessary sql file from /camm/sql folder and use this table name in syslog-ng.conf;

    Change the following lines to the /etc/syslog-ng/syslog-ng.conf file to the END of the file:

    Code: Select all

    				source net {
    					udp();
    				};
    				destination d_mysql {
    				    pipe("/tmp/mysql.pipe"
    				    template("INSERT INTO plugin_camm_syslog (host, sourceip, facility, priority, sys_date, message, status) VALUES ( '$HOST',  '$SOURCEIP', '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$MSG', '0' );\n")
    				    template-escape(yes)
    				     );
    				};
    
    				log { source(net); destination(d_mysql); };
    				log { source(s_sys); destination(d_mysql); };


----[ Possible Bugs?

If you find a problem, let me know!!!


----[ Future Changes

?


----[ Changelog

CAMM --- 1.5.3 ---2009-04-06
  • - Fix showing "Console" and "Graph" tab based on user right;
    - Change sorting menu tree to [device_type_name asc, description, eventname];
    - Add option to send one mail per trap/syslog rather than grouping records together and sending one mail with all records;;
CAMM --- 1.6.0 ---2009-07-07
  • - Fix error on install process. Now all tables by default created in <default cacati DB>;
    - Menu tree replaced with TreeGrid with percent field - allows quickly and visually to define the most active equipment;
    - In menu TreeGrid added combobox <period> with all,week,day,hour;
    - New format of email field address ("user@domain.com;" or "user1@domain.com; user2@domain.com; ...")
    - Many other fixes;
CAMM --- 1.6.1 ---2009-07-17 CAMM --- 1.6.2 ---2009-07-23
  • - Added new config in startup settings - [Startup tree menu width];
    - Added possibility of creating of the menu on the basis of markers in rule. For use - check new config option in - Settings tab - [Create tree menu for Markers ?]
CAMM --- 1.6.3 ---2009-08-07
  • - Switch to use ExtJS 2.3.0. before you updated on this with any previous version - you can completely remove directories: camm/images/default, camm/images/slate, camm/images/vista;
    - Added new config settings - [Rule order];
    - Added new config settings - [Action order in each rule];
    - Added new grid [Incorrect devices] in stats tab. Used to quickly determine the possible incorrect device. For example, if the device DEV1 and DEV2 belong to the same type of T1, and the device DEV1 sends a message, and the device DEV2 does not - then perhaps it is (DEV2) configured incorrectly ;
    - Fix IE visual bug in menu;
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;
CAMM --- 1.6.5 ---2009-11-25
  • - Switch to use ExtJS 3.0.3.
    - Added [E-mail format] in rule - standart/html;
    - Added [Include data] in rule - Include cacti device description in email;
    - Use new, "pretty" the format of the text from mcutting (without the use of tags in the field of Alert - these tags can be used directly in the field of rules);
    - Added color selection for Traps (TrapSeverity Normal = Green and TrapSeverity Major = Red) (mpdsville1)

    - Fix bug with export data to excel, if the data contains a string '<br>';
    - Fix : use mysql_affected_rows () instead db_fetch_cell ( "SELECT ROW_COUNT ()") to work correctly with mysql 4 versions (Wannes);
CAMM --- 1.6.6 ---2010-07-02
  • - Switch to use ExtJS 3.2.1.
    - Add parameter in camm settings [Hostname include domain]. Set it to [1] if in cacti You use FQDN in hostnames, but syslog sent only 'host' in messages;
    - The total change in the principles of search/mark messages by rules. Prior to that, if the message fell into 2 or more markering rules, it contained only a marker of the last rule. Now it is corrected by a new mechanism for marking. This should also positively affect the speed of processing. It also removes the restriction on the value of the marker. (previously it was <100). In order to process all records in the new scheme - follow these instructions after updating plugin

    Code: Select all

    "Truncate table plugin_camm_tree2;"
    and

    Code: Select all

    "update <you_syslog_db>.plugin_camm_syslog set `status`='0';"
    . Warning - this may cause a large load during the next cycle of the poller.
    - Update Slate theme;
    - Added new field [add] in the message's table, which can be used for any purpose - for example, for additional information and processing user-defined functions;
    - Added new field in [rule] table - [actual_triggered] - stores information about the current number of messages that fall under this rule;
    - A small change in the appearance of the "Edit rule" window;
    Changes in the left menu:
    - hidden folder icon - just plus / minus - it saves additional space for description;
    - sorting menu made by db, which positively affects the speed of display / update the menu, especially whith large number of hosts (thousands);
    - added automatically calculate, readonly parameter [camm_use_group_by_host] responsible for the additional grouping of records. To avoid unnecessary stress is not desirable to have a base Cacti hosts with the same value hostname. Check it by this sql

    Code: Select all

    "SELECT  hostname, count(*)  FROM host group by hostname having count(*)>1"

    - Fix error in IE;
    - Fix PageSize of store if update by TreeMenu;
    - Fixed bug causing a show of all message when you use the menu for a certain period;
CAMM --- 1.6.7 ---2010-08-26
  • - Add Chart on stats tab. You can view the schedule of income during the selected messages from the selected interval and build the graph of the distribution of messages by hosts. Or you can go to view the specific messages.
    - Change to use rule_id as marker_id and rule_name as marker_name. Will no longer be confusion with the marker_id anr rule_id;

    - Fix old-time bug with autocreate of trees (thanks torstentfk);
    - Fix many minor bugs;
After updating the files, be sure to press CTRL + F5 to refresh your browser cache!
Attachments
cacti_plugin_camm_v1_6_7.zip
(1.2 MiB) Downloaded 4768 times
camm_4_rule_and_filters.jpg
camm_4_rule_and_filters.jpg (84.23 KiB) Viewed 106036 times
camm_3_syslog_component.jpg
camm_3_syslog_component.jpg (171.61 KiB) Viewed 106036 times
camm_2_settings_and_themes.jpg
camm_2_settings_and_themes.jpg (122.95 KiB) Viewed 106036 times
camm_1_autoupdate.jpg
camm_1_autoupdate.jpg (119.09 KiB) Viewed 106036 times
Last edited by gthe on Fri Jan 31, 2014 9:35 am, edited 24 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]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Hi,
Looks very nice.
I`m installing it now on my cacti server.
First i`m gonna use it for syslog messages.

i did the install via pia 2.0
works perfectly.
Enabeld it.

Did the settings:
enabled syslog
did nothing with the db. (Is a bit unclear for me still working on it)
I copied the the syslog-ng part tot the syslog-ng file.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I've been thinking about using ext for weathermap's editor - are there any specific resources you'd recommend?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

I use only extjs forum.
I can send you camm js source (js is not minified so it is readable)
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Hi,

I do have some trouble with gedding the syslog working.

I`f installed this according th manual. Works like a dream.
Than i see the tab camm. when i open the tab (For the first time) It takes a wile an than it gives all OK on the database upgrade.

The reason i think that it is not working could be the database upgrade.
I`m sure that i a`m doing something wrong here.

In the camm settings for syslog i have the following configuration.
syslog db name: syslog
syslog incoming table: plugin_camm_syslog


so i choose for option 1.

Code: Select all

Here may be 2 shems of work

      a)One table - all incoming messages stored in one table (default "plugin_camm_syslog")
      b)Two tables - all incoming messages stored in temp table (default "plugin_camm_syslog_incoming"). On each run poller process all rules and after that copy messages to main table 


You can choose it in settings tab of plugin and import necessary sql file from /camm/sql folder and use this table name in syslog-ng.conf;

Change the following lines to the /etc/syslog-ng/syslog-ng.conf file to the END of the file:
Also i find an error at the background of the camm page:
Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /var/www/html/plugins/camm/camm_view.php on line 71

could you help me by the step

Thx in advanced.
Attachments
This is where i put the sql file
This is where i put the sql file
camm.png (3.72 KiB) Viewed 105885 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Palermo - do you have any data in plugin_camm_syslog ?
If no - need recheck syslog-ng config.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Good morning,
The syslog-ng look like this.

Code: Select all

source net {
					udp();
				};
				destination d_mysql {
				    pipe("/tmp/mysql.pipe"
				    template("INSERT INTO plugin_camm_syslog (host, sourceip, facility, priority, sys_date, message, status) VALUES ( '$HOST',  '$SOURCEIP', '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$MSG', '0' );\n")
				    template-escape(yes)
				     );
				};

				log { source(net); destination(d_mysql); };
				log { source(s_sys); destination(d_mysql); };
Is here something wrong
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Palermo, Do You have any error in logs ?
Check your install with this how-to - http://forums.cacti.net/viewtopic.php?t=26040
Check mysql user/password in syslog-ng conf file and mysql permissions for syslog db.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

gthe,
I did nothing but the syslog messages are rolling in.
Don`t no what happed.
Thx for your help.

I`m gonna check out the features.. thx
looks very cool
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Hi,
I have 2 systems working with the new plug in.
A live system and a test system.
Now i wand the test system to roll back to the old system.
That is just in case when something happed with the live system.
The only thing i could think off is to copy the old syslog-ng file back.
do i left something out>?
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Excuse, but I have not understood you.
You wish to learn as to remove camm and back to old syslog plugin ?
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Yes i want to know what the rollback procedure is in case of an unknown failure.
My fellow collage are still nagging me :-? with the last plug in i implemented with worked fine but later little error came up. :(

is there an rollback procedure?
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

Just disable or even uninstall it from plugin management page and recheck syslog-ng.conf file.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
Palermo
Cacti User
Posts: 87
Joined: Thu Sep 11, 2008 11:48 pm

Post by Palermo »

Yep thx it works.
After disabling the plug in cop yd tho old syslog-ng file back + the command [root@cacti ~]# service syslog-ng restart

it all work t fine.

Made a document of the installing part and the rollback procedure.

I know it is a bit strange to disable the new plug in but it is only for precaution in case of failure. And that can not happen in a life environment. to Manny administrators and managers looking to it.


thx for the quick respond
GuessWho
Posts: 16
Joined: Tue Jan 13, 2009 2:55 pm

Post by GuessWho »

gthe,
I am unable to delete any of the events in the tables. This is happening across two different installations. When I try to delete I receive an error message

"SNMPTT Component Disabled"

Do you know what the problem might be. When looking though logs and have not found the problem.
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest