Failed to add this device - sql error:Unknown column monitor

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
doiggl
Cacti User
Posts: 222
Joined: Wed Dec 16, 2009 6:32 am

Failed to add this device - sql error:Unknown column monitor

Post by doiggl »

Hello,
I get this error when adding a device to cacti. see [1]

[1]
# php add_device.php --description="localhost" --ip=127.0.0.1 --version=2
Adding localhost (127.0.0.1) as "None" using SNMP v2 with community "public"
ERROR: Failed to add this device

I see this line in the cacti log.
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] ERROR: SQL Save Command Failed for Table 'host'. Error was 'Unknown column 'monitor' in 'field list''

Question:
How can i add the column 'monitor' to the table 'host' with a sql command ?
Thanks for your help - Glenn

-Some more info:
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[0], matching hosts: a:0:{}
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT host.id AS host_id, host.hostname, host.description, host.disabled, host.status, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( host_template.name LIKE '%Linux%') AND host.id=0"
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter returns: host_template.name LIKE '%Linux%'
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter returns: host_template.name LIKE '%Linux%'
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] build_rule_item_filter called: a:1:{i:0;a:8:{s:2:"id";s:1:"3";s:7:"rule_id";s:1:"1";s:9:"rule_type";s:1:"3";s:8:"sequence";s:1:"1";s:9:"operation";s:1:"0";s:5:"field";s:18:"host_template.name";s:8:"operator";s:1:"1";s:7:"pattern";s:5:"Linux";}}, prefix:
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT * FROM plugin_autom8_match_rule_items WHERE rule_id=1 AND rule_type=3 ORDER BY sequence"
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter called rule id: 1
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] get_matching_hosts called: a:7:{s:2:"id";s:1:"1";s:4:"name";s:10:"New Device";s:7:"tree_id";s:1:"1";s:12:"tree_item_id";s:1:"0";s:9:"leaf_type";s:1:"3";s:18:"host_grouping_type";s:1:"1";s:6:"rra_id";s:1:"0";} type: 3
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[0], active rule: 1 name: New Device type: 3
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[0], matching rule sql: SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=3 matches: 1
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=3"
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[0] called
01/10/2012 02:55:52 PM - AUTOM8 TRACE: Poller[0] autom8_hook_device_create_tree called: a:21:{s:2:"id";i:0;s:16:"host_template_id";i:0;s:11:"description";s:9:"localhost";s:8:"hostname";s:9:"127.0.0.1";s:5:"notes";s:0:"";s:12:"snmp_version";s:1:"2";s:14:"snmp_community";s:6:"public";s:13:"snmp_username";s:0:"";s:13:"snmp_password";s:0:"";s:9:"snmp_port";s:3:"161";s:12:"snmp_timeout";s:3:"500";s:8:"disabled";s:0:"";s:19:"availability_method";i:1;s:11:"ping_method";i:2;s:9:"ping_port";s:2:"23";s:12:"ping_timeout";s:3:"400";s:12:"ping_retries";s:1:"1";s:8:"max_oids";s:2:"10";s:14:"device_threads";i:1;s:7:"monitor";s:0:"";s:12:"monitor_text";s:0:"";}
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] DEVEL: SQL Assoc: "SELECT 1 AS id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'api_device_new' AND ph.name IN ('settings', 'boost', 'dsstats') UNION SELECT pc.id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'api_device_new' AND ph.name NOT IN ('settings', 'boost', 'dsstats') ORDER BY id ASC"
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] ERROR: SQL Save Command Failed for Table 'host'. Error was 'Unknown column 'monitor' in 'field list''
01/10/2012 02:55:52 PM - CMDPHP: Poller[0] DEVEL: SQL Save on table 'host': "a:21:{s:2:"id";i:0;s:16:"host_template_id";i:0;s:11:"description";s:9:"localhost";s:8:"hostname";s:9:"127.0.0.1";s:5:"notes";s:0:"";s:12:"snmp_version";s:1:"2";s:14:"snmp_community";s:6:"public";s:13:"snmp_username";s:0:"";s:13:"snmp_password";s:0:"";s:9:"snmp_port";s:3:"161";s:12:"snmp_timeout";s:3:"500";s:8:"disabled";s:0:"";s:19:"availability_method";i:1;s:11:"ping_method";i:2;s:9:"ping_port";s:2:"23";s:12:"ping_timeout";s:3:"400";s:12:"ping_retries";s:1:"1";s:8:"max_oids";s:2:"10";s:14:"device_threads";i:1;s:7:"monitor";s:0:"";s:12:"monitor_text";s:0:"";}"

# other information. sorry about the formatting.
mysql> describe host;
+----------------------+-----------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-----------------------+------+-----+---------------------+----------------+
| id | mediumint(8) unsigned | NO | PRI | NULL | auto_increment |
| host_template_id | mediumint(8) unsigned | NO | | 0 | |
| description | varchar(150) | NO | | | |
| hostname | varchar(250) | YES | | NULL | |
| notes | text | YES | | NULL | |
| snmp_community | varchar(100) | YES | | NULL | |
| snmp_version | tinyint(1) unsigned | NO | | 1 | |
| snmp_username | varchar(50) | YES | | NULL | |
| snmp_password | varchar(50) | YES | | NULL | |
| snmp_auth_protocol | char(5) | YES | | | |
| snmp_priv_passphrase | varchar(200) | YES | | | |
| snmp_priv_protocol | char(6) | YES | | | |
| snmp_context | varchar(64) | YES | | | |
| snmp_port | mediumint(5) unsigned | NO | | 161 | |
| snmp_timeout | mediumint(8) unsigned | NO | | 500 | |
| availability_method | smallint(5) unsigned | NO | | 1 | |
| ping_method | smallint(5) unsigned | YES | | 0 | |
| ping_port | int(12) unsigned | YES | | 0 | |
| ping_timeout | int(12) unsigned | YES | | 500 | |
| ping_retries | int(12) unsigned | YES | | 2 | |
| max_oids | int(12) unsigned | YES | | 10 | |
| device_threads | tinyint(2) unsigned | NO | | 1 | |
| disabled | char(2) | YES | MUL | NULL | |
| status | tinyint(2) | NO | | 0 | |
| status_event_count | mediumint(8) unsigned | NO | | 0 | |
| status_fail_date | datetime | NO | | 0000-00-00 00:00:00 | |
| status_rec_date | datetime | NO | | 0000-00-00 00:00:00 | |
| status_last_error | varchar(255) | YES | | | |
| min_time | decimal(10,5) | YES | | 9.99999 | |
| max_time | decimal(10,5) | YES | | 0.00000 | |
| cur_time | decimal(10,5) | YES | | 0.00000 | |
| avg_time | decimal(10,5) | YES | | 0.00000 | |
| total_polls | int(12) unsigned | YES | | 0 | |
| failed_polls | int(12) unsigned | YES | | 0 | |
| availability | decimal(8,5) | NO | | 100.00000 | |
+----------------------+-----------------------+------+-----+---------------------+----------------+
35 rows in set (0.00 sec)

Plugins installed
##############
Autom8 0.35 Automate Cacti Tasks General Active Reinhard Scheck
Monitor 0.8.2 Device Monitoring Old PIA Active Jimmy Conner
Settings 0.5 Global Plugin Settings System Active Jimmy Conner
Hostinfo 0.2 Host Info Old PIA Active Jimmy Conner
Update 0.4 Update Checker Old PIA Active Jimmy Conner
cigamit
Developer
Posts: 3372
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Failed to add this device - sql error:Unknown column mon

Post by cigamit »

You should upgrade to the latest version of Monitor (1.3), as that is where the error is originating.

http://docs.cacti.net/plugin:monitor
doiggl
Cacti User
Posts: 222
Joined: Wed Dec 16, 2009 6:32 am

Re: Failed to add this device - sql error:Unknown column mon

Post by doiggl »

Hello,
Looks like it worked after the update to Plugins installed
##############
Autom8 0.35 Automate Cacti Tasks General Active Reinhard Scheck
Monitor 0.8.2 Device Monitoring Old PIA Active Jimmy Conner
Settings 0.5 Global Plugin Settings System Active Jimmy Conner
Hostinfo 0.2 Host Info Old PIA Active Jimmy Conner
Update 0.4 Update Checker Old PIA Active Jimmy Conner

From the cacti log:
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[2], matching hosts: a:0:{}
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter returns: host_template.name LIKE '%Linux%'
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] build_rule_item_filter returns: host_template.name LIKE '%Linux%'
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] build_rule_item_filter called: a:1:{i:0;a:8:{s:2:"id";s:1:"3";s:7:"rule_id";s:1:"1";s:9:"rule_type";s:1:"3";s:8:"sequence";s:1:"1";s:9:"operation";s:1:"0";s:5:"field";s:18:"host_template.name";s:8:"operator";s:1:"1";s:7:"pattern";s:5:"Linux";}}, prefix:
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] build_matching_objects_filter called rule id: 1
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] get_matching_hosts called: a:7:{s:2:"id";s:1:"1";s:4:"name";s:10:"New Device";s:7:"tree_id";s:1:"1";s:12:"tree_item_id";s:1:"0";s:9:"leaf_type";s:1:"3";s:18:"host_grouping_type";s:1:"1";s:6:"rra_id";s:1:"0";} type: 3
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[2], active rule: 1 name: New Device type: 3
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[2], matching rule sql: SELECT plugin_autom8_tree_rules.id, plugin_autom8_tree_rules.name, plugin_autom8_tree_rules.tree_id, plugin_autom8_tree_rules.tree_item_id, plugin_autom8_tree_rules.leaf_type, plugin_autom8_tree_rules.host_grouping_type, plugin_autom8_tree_rules.rra_id FROM plugin_autom8_tree_rules WHERE enabled='on' AND leaf_type=3 matches: 1
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] execute_device_create_tree Host[2] called
01/11/2012 06:46:35 AM - AUTOM8 TRACE: Poller[0] autom8_hook_device_create_tree called: a:21:{s:2:"id";i:2;s:16:"host_template_id";i:0;s:11:"description";s:9:"localhost";s:8:"hostname";s:9:"127.0.0.1";s:5:"notes";s:0:"";s:12:"snmp_version";s:1:"2";s:14:"snmp_community";s:6:"public";s:13:"snmp_username";s:0:"";s:13:"snmp_password";s:0:"";s:9:"snmp_port";s:3:"161";s:12:"snmp_timeout";s:3:"500";s:8:"disabled";s:0:"";s:19:"availability_method";i:1;s:11:"ping_method";i:2;s:9:"ping_port";s:2:"23";s:12:"ping_timeout";s:3:"400";s:12:"ping_retries";s:1:"1";s:8:"max_oids";s:2:"10";s:14:"device_threads";i:1;s:7:"monitor";s:0:"";s:12:"monitor_text";s:0:"";}
01/11/2012 06:45:02 AM - POLLER: Poller[0] Plugin Update Check is now processing
Attachments
table-host-after.txt
table host after monitor uppate
(4.09 KiB) Downloaded 106 times
doiggl
Cacti User
Posts: 222
Joined: Wed Dec 16, 2009 6:32 am

Re: Failed to add this device - sql error:Unknown column mon

Post by doiggl »

Hello,
Plugins installed
------------------------
Autom8 0.35 Automate Cacti Tasks General Active Reinhard Scheck
Monitor 1.3 Device Monitoring General Active Jimmy Conner
Settings 0.5 Global Plugin Settings System Active Jimmy Conner
Hostinfo 0.2 Host Info Old PIA Active Jimmy Conner
Update 0.4 Update Checker Old PIA Active Jimmy Conner
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests