Need assistance with CAMM plugin installation please

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Need assistance with CAMM plugin installation please

Post by kbartoletta »

I recently found the CAMM plugin... and am trying to get it working for trap collection.
I have snmptt installed and configured to forward traps to mysql database.
When I do a cold restarted of an agent configured to forward traps to my cacti server... i am successfully able to see the traps in the mysql database.

My problem is that i am a little confused by the installation notes...I started with an earlier version of CAMM 1.54 i believe... which had some .sql files in the sql directory of the plugin folder...

These two sql files created two tables... snmptt_traps and snmptt_unknown... which are in fact the tables that I configued snmptt to forward the traps to... and the same tables that when i query the database manually... i am able to see my traps in....

Code: Select all

[root@cacti sql]# cat plugin_camm_traps.sql
CREATE TABLE snmptt_traps (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
eventname VARCHAR(50),
eventid VARCHAR(50),
trapoid VARCHAR(100),
enterprise VARCHAR(100),
community VARCHAR(20),
hostname VARCHAR(100),
agentip  VARCHAR(16),
category VARCHAR(20),
severity VARCHAR(20),
uptime  VARCHAR(20),
traptime DATETIME,
formatline VARCHAR(255));

[root@cacti sql]# cat plugin_camm_traps_unknown.sql
CREATE TABLE snmptt_unknown (
trapoid VARCHAR(100),
enterprise VARCHAR(100),
community VARCHAR(20),
hostname VARCHAR(100),
agentip  VARCHAR(16),
uptime  VARCHAR(20),
traptime DATETIME,
formatline VARCHAR(255));

the problem however is that when i look in the cacti UI... on the CAMM tab... I do not show any traps there... it is as if the plugin is looking at different tables in the database.

when i go to the console -> configuration -> settings -> camm tab... the only relative settings that i see are the "What tables process" drop down under the "CaMM SNMPTT Settings" heading....

This drop down currently has the following selections...

1. plugin_camm_traps
2. plugin_camm_unknown
3. both

It is currently set to both... but considering that i do not have either of these tables created...I suspect that this is where it is broken...

Has anyone else encountered this problem?
lasylve
Posts: 22
Joined: Fri Oct 02, 2009 1:34 am

Re: Need assistance with CAMM plugin installation please

Post by lasylve »

You should try to install last CaMM version.
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

Well, i am at version 1.6.7 currently... i would love to update to a newer version but i am not sure what version that is or where to find it...all i could find initially was a 1.5.x version then i stumbled across the 1.6.7...
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

i guess what i am not understanding is where the tie is between what database and tables you are telling snmptt to forward the traps to... and where you tell the camm plugin where to go read them from...

I see a "Syslog incoming table" for "syslog" but the only thing i see for snmptt is "What tables process" which is currently set to both... but has "plugin_camm_traps", "plugin_camm_unknown_traps", or "both" available...

Code: Select all


01/21/2011 08:48:06 PM - camm: Poller[0] S3. Checking to determine if it's time to run AutoCreate Tree Menu.
01/21/2011 08:48:06 PM - camm: Poller[0]  php [poller_camm.php] The last time the snmptt Tree was recreated at '2011-01-21 20:43:07'. 
01/21/2011 08:48:06 PM - camm: Poller[0] S3.1 The next snmptt Tree to DB run time has been determined to be at '2011-01-21 20:48:07'. Last run time was '2011-01-21 20:43:07'. Tree update int. in sec=300. current_time=[1295660886], time_till_next_treedb_run=[1].  
01/21/2011 08:48:06 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE  `plugin_camm_keys`  FROM `plugin_camm_keys` LEFT JOIN `syslog`.`plugin_camm_syslog` ON (`krid`=`syslog`.`plugin_camm_syslog`.`id`) where `ktype`=1 and `id` is null'
01/21/2011 08:48:06 PM - camm: Poller[0] S4. We have next count of dubled hosts = [1]
01/21/2011 08:48:06 PM - SYSTEM camm General STATS: AllTime:0.1142 PurgeTime:0.0066 RuleTime:0.0800 TreeTime:0.0275 
01/21/2011 08:53:05 PM - camm: Poller[0] S0. Found enabled DEBUG mode. Output will be verbose
01/21/2011 08:53:05 PM - camm: Poller[0] S0. About to enter camm poller processing
01/21/2011 08:53:05 PM - camm: Poller[0] S1. Found 1 camm rule to process
01/21/2011 08:53:05 PM - camm: Poller[0] S1.1 Use SNMPTT component
01/21/2011 08:53:05 PM - camm: Poller[0] S1.2 Found 0 new traps to process
01/21/2011 08:53:05 PM - camm: Poller[0] S1.2 Found 0 new syslog messages to process
01/21/2011 08:53:05 PM - camm: Poller[0] S1.2 No new records to process rules
01/21/2011 08:53:05 PM - camm: Poller[0] S2. Checking to determine if it's time to run AutoPurge process.
01/21/2011 08:53:05 PM - camm: Poller[0] S2.1 The next AutoPurge process run time has been determined to be at '2011-01-21 21:23:13'. Last run time was '2011-01-21 19:23:13'
01/21/2011 08:53:05 PM - camm: Poller[0] S3. Checking to determine if it's time to run AutoCreate Tree Menu.
01/21/2011 08:53:05 PM - camm: Poller[0]  php [poller_camm.php] The last time the snmptt Tree was recreated at '2011-01-21 20:43:07'. 
01/21/2011 08:53:05 PM - camm: Poller[0] S3.1 The next snmptt Tree to DB run time has been determined to be NOW
01/21/2011 08:53:05 PM - camm: Poller[0]  php [camm_poller_recreate_tree] The last time the snmptt Tree was recreated at '2011-01-21 20:43:07'. 
01/21/2011 08:53:05 PM - camm: Poller[0]  S. CAMM [snmptt] Tree was recreated for [0.0776] sec with rezult=[1]
01/21/2011 08:53:05 PM - camm: Poller[0]  php [camm_poller_recreate_tree] The last time the snmptt Tree was manually recreated at '2011-01-21 20:53:05'. 
01/21/2011 08:53:05 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE  `plugin_camm_keys`  FROM `plugin_camm_keys` LEFT JOIN `syslog`.`plugin_camm_syslog` ON (`krid`=`syslog`.`plugin_camm_syslog`.`id`) where `ktype`=1 and `id` is null'
01/21/2011 08:53:05 PM - camm: Poller[0] S4. We have next count of dubled hosts = [1]
01/21/2011 08:53:05 PM - SYSTEM camm General STATS: AllTime:0.2087 PurgeTime:0.0098 RuleTime:0.0605 TreeTime:0.1384

lasylve
Posts: 22
Joined: Fri Oct 02, 2009 1:34 am

Re: Need assistance with CAMM plugin installation please

Post by lasylve »

OK, if you are using 1.6.7, tables for traps and unknown traps are : "plugin_camm_snmptt" and "plugin_camm_snmptt_unk" in cacti database.

Check your snmptt.ini config file :
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
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

So are you saying that the tables to use are hardcoded?
I know for a fact that i am not sending the traps to those tables... but i can change that.

Are there any .sql files that need to be imported into the cacti database in order to create the necessary tables?
lasylve
Posts: 22
Joined: Fri Oct 02, 2009 1:34 am

Re: Need assistance with CAMM plugin installation please

Post by lasylve »

Yes, tables are hard coded in camm, that 's why you have to make you snmptt.ini match the fields I pasted before.

To be sure, open your setup.php in camm folder, and look at the line 705 (in the camm_setup_table function):
api_plugin_db_table_create ('camm', 'plugin_camm_snmptt', $data);
and line 736 :
api_plugin_db_table_create ('camm', 'plugin_camm_snmptt_unk', $data);
The best way is to install camm properly, and change the table names in snmptt.ini to plugin_camm_snmptt and plugin_camm_snmptt_unk

Regards,
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

Really appreciate the help... I made the changes to the snmptt.ini and restarted the process....when i send a trap to the box now i am seeing a failure to insert into the newly defined table....

Wed Jan 26 00:18:19 2011 MySQL error 1146: Unable to perform INSERT INTO (EXECUTE): Table 'syslog.plugin_camm_snmptt_unk' doesn't exist

Here is where i am getting confused... I dont see any .sql file in import into the syslog database...so i am not sure how to create the table... and even if i did create the table manually... isn't that going to cause problems when the camm plugin tries to create the same table? (the creates in the setup.php) ?
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

I take that back... there are 2 .sql files for traps in one of the old releases..they are not included with this latest version...
I used these to create the tables... and now i can see that snmptt is passing the traps into mysql....

Code: Select all


[root@cacti sql]# cat plugin_camm_snmptt.sql
CREATE TABLE plugin_camm_snmptt (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
eventname VARCHAR(50),
eventid VARCHAR(50),
trapoid VARCHAR(100),
enterprise VARCHAR(100),
community VARCHAR(20),
hostname VARCHAR(100),
agentip  VARCHAR(16),
category VARCHAR(20),
severity VARCHAR(20),
uptime  VARCHAR(20),
traptime DATETIME,
formatline VARCHAR(255));


[root@cacti sql]# cat plugin_camm_snmptt_unk.sql
CREATE TABLE plugin_camm_snmptt_unk (
trapoid VARCHAR(100),
enterprise VARCHAR(100),
community VARCHAR(20),
hostname VARCHAR(100),
agentip  VARCHAR(16),
uptime  VARCHAR(20),
traptime DATETIME,
formatline VARCHAR(255));
Now i am seeing the following in the cacti log with regards to camm....for some reason the plugin isn't seeing the traps in the

Code: Select all

01/26/2011 12:38:01 AM - camm: Poller[0] S0. Found enabled DEBUG mode. Output will be verbose
01/26/2011 12:38:01 AM - camm: Poller[0] S0. About to enter camm poller processing
01/26/2011 12:38:01 AM - camm: Poller[0] S1. Found 1 camm rule to process
01/26/2011 12:38:01 AM - camm: Poller[0] S1.1 Use SNMPTT component
01/26/2011 12:38:01 AM - camm: Poller[0] S1.2 Found 0 new traps to process
01/26/2011 12:38:01 AM - camm: Poller[0] S1.2 Found 0 new syslog messages to process
01/26/2011 12:38:01 AM - camm: Poller[0] S1.2 No new records to process rules
01/26/2011 12:38:01 AM - camm: Poller[0] S2. Checking to determine if it's time to run AutoPurge process.
01/26/2011 12:38:01 AM - camm: Poller[0] S2.1 The next AutoPurge process run time has been determined to be at '2011-01-26 1:33:02'. Last run time was '2011-01-25 23:33:02'
01/26/2011 12:38:01 AM - camm: Poller[0] S3. Checking to determine if it's time to run AutoCreate Tree Menu.
01/26/2011 12:38:01 AM - camm: Poller[0]  php [poller_camm.php] The last time the snmptt Tree was recreated at '2011-01-26 0:28:15'. 
01/26/2011 12:38:01 AM - camm: Poller[0] S3.1 The next snmptt Tree to DB run time has been determined to be NOW
01/26/2011 12:38:01 AM - camm: Poller[0]  php [camm_poller_recreate_tree] The last time the snmptt Tree was recreated at '2011-01-26 0:28:15'. 
01/26/2011 12:38:01 AM - camm: Poller[0]  S. CAMM [snmptt] Tree was recreated for [0.0679] sec with rezult=[1]
01/26/2011 12:38:01 AM - camm: Poller[0]  php [camm_poller_recreate_tree] The last time the snmptt Tree was manually recreated at '2011-01-26 0:38:01'. 

------------------------------------------
WHAT IS THIS....

01/26/2011 12:38:01 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE  `plugin_camm_keys`  FROM `plugin_camm_keys` LEFT JOIN `syslog`.`plugin_camm_syslog` ON (`krid`=`syslog`.`plugin_camm_syslog`.`id`) where `ktype`=1 and `id` is null'

------------------------------------------
01/26/2011 12:38:01 AM - camm: Poller[0] S4. We have next count of dubled hosts = [1]
01/26/2011 12:38:01 AM - SYSTEM camm General STATS: AllTime:0.1852 PurgeTime:0.0123 RuleTime:0.0679 TreeTime:0.1050


 
01/26/2011 12:42:57 AM - camm: Poller[0] S0. Found enabled DEBUG mode. Output will be verbose
01/26/2011 12:42:57 AM - camm: Poller[0] S0. About to enter camm poller processing
01/26/2011 12:42:57 AM - camm: Poller[0] S1. Found 1 camm rule to process
01/26/2011 12:42:57 AM - camm: Poller[0] S1.1 Use SNMPTT component
01/26/2011 12:42:57 AM - camm: Poller[0] S1.2 Found 0 new traps to process
01/26/2011 12:42:57 AM - camm: Poller[0] S1.2 Found 0 new syslog messages to process
01/26/2011 12:42:57 AM - camm: Poller[0] S1.2 No new records to process rules
01/26/2011 12:42:57 AM - camm: Poller[0] S2. Checking to determine if it's time to run AutoPurge process.
01/26/2011 12:42:57 AM - camm: Poller[0] S2.1 The next AutoPurge process run time has been determined to be at '2011-01-26 1:33:02'. Last run time was '2011-01-25 23:33:02'
01/26/2011 12:42:57 AM - camm: Poller[0] S3. Checking to determine if it's time to run AutoCreate Tree Menu.
01/26/2011 12:42:57 AM - camm: Poller[0]  php [poller_camm.php] The last time the snmptt Tree was recreated at '2011-01-26 0:38:01'. 
01/26/2011 12:42:57 AM - camm: Poller[0] S3.1 The next snmptt Tree to DB run time has been determined to be at '2011-01-26 0:43:01'. Last run time was '2011-01-26 0:38:01'. Tree update int. in sec=300. current_time=[1296020577], time_till_next_treedb_run=[4].  
01/26/2011 12:42:57 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE  `plugin_camm_keys`  FROM `plugin_camm_keys` LEFT JOIN `syslog`.`plugin_camm_syslog` ON (`krid`=`syslog`.`plugin_camm_syslog`.`id`) where `ktype`=1 and `id` is null'
01/26/2011 12:42:57 AM - camm: Poller[0] S4. We have next count of dubled hosts = [1]
01/26/2011 12:42:57 AM - SYSTEM camm General STATS: AllTime:0.0497 PurgeTime:0.0045 RuleTime:0.0397 TreeTime:0.0055 

lasylve
Posts: 22
Joined: Fri Oct 02, 2009 1:34 am

Re: Need assistance with CAMM plugin installation please

Post by lasylve »

Trust me, when you install camm plugin, tables do are created. Not in a .sql file but in the setup.php, by a php function :

$data = array();
$data['columns'][] = array('name' => 'id', 'type' => 'int(11)', 'unsigned' => true, 'NULL' => false, 'auto_increment' => true);
$data['columns'][] = array('name' => 'eventname', 'type' => 'varchar(50)', 'NULL' => true);
$data['columns'][] = array('name' => 'eventid', 'type' => 'varchar(50)', 'NULL' => true);
$data['columns'][] = array('name' => 'trapoid', 'type' => 'varchar(100)', 'NULL' => true);
$data['columns'][] = array('name' => 'enterprise', 'type' => 'varchar(100)', 'NULL' => true);
$data['columns'][] = array('name' => 'community', 'type' => 'varchar(20)', 'NULL' => true);
$data['columns'][] = array('name' => 'hostname', 'type' => 'varchar(250)', 'NULL' => true);
$data['columns'][] = array('name' => 'agentip', 'type' => 'varchar(16)', 'NULL' => true);
$data['columns'][] = array('name' => 'category', 'type' => 'varchar(20)', 'NULL' => true);
$data['columns'][] = array('name' => 'severity', 'type' => 'varchar(20)', 'NULL' => true);
$data['columns'][] = array('name' => 'uptime', 'type' => 'varchar(20)', 'NULL' => true);
$data['columns'][] = array('name' => 'traptime', 'type' => 'datetime', 'NULL' => true);
$data['columns'][] = array('name' => 'formatline', 'type' => 'text', 'NULL' => true);
$data['columns'][] = array('name' => 'add', 'type' => 'varchar(50)', 'NULL' => true);
$data['primary'] = 'id';
$data['keys'][] = array('name' => 'hostname', 'columns' => 'hostname');
$data['type'] = 'MyISAM';
$data['comment'] = 'camm data';

api_plugin_db_table_create ('camm', 'plugin_camm_snmptt', $data);
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

Ok, so what am i missing about the setup.php....is it something that is run automatically or manually? Cause if i dont create the tables manually in the database...then my snmptt deamon complains about not being able to insert into the tables....
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Re: Need assistance with CAMM plugin installation please

Post by kbartoletta »

Ok, i found the problem... I guess the trap HAVE TO go to the cacti database.... the below "<< CHANGE" was leading me to believe that you could specify a different database (other than the cacti database)...i realize now that is not the case.

Once i reinstalled the plugin...and went to the camm tab, i could see the sql executions against the cacti database
Appreciate the help.. this looks like a great plugin... i am anxious to see how well it works....
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
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests