Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.65k stars 406 forks source link

[1.2.0 beta 1 develop] - Remote Poller PHP Errors #2040

Closed anarkia1976 closed 6 years ago

anarkia1976 commented 6 years ago

Hi,

i have these errors:

2018/10/09 12:55:12 - CMDPHP PHP ERROR NOTICE Backtrace: (/remote_agent.php[74]:ping_device(), /remote_agent.php[282]:api_device_ping_device(), /lib/api_device.php[563]:CactiErrorHandler()) 2018/10/09 12:55:12 - ERROR PHP NOTICE: Undefined index: disabled in file: /usr/share/cacti/lib/api_device.php on line: 563 2018/10/09 12:55:12 - CMDPHP PHP ERROR NOTICE Backtrace: (/remote_agent.php[74]:ping_device(), /remote_agent.php[282]:api_device_ping_device(), /lib/api_device.php[462]:CactiErrorHandler()) 2018/10/09 12:55:12 - ERROR PHP NOTICE: Undefined index: disabled in file: /usr/share/cacti/lib/api_device.php on line: 462 2018/10/09 12:55:12 - CMDPHP PHP ERROR NOTICE Backtrace: (/remote_agent.php[74]:ping_device(), /remote_agent.php[282]:api_device_ping_device(), /lib/api_device.php[443]:CactiErrorHandler()) 2018/10/09 12:55:12 - ERROR PHP NOTICE: Undefined index: poller_id in file: /usr/share/cacti/lib/api_device.php on line: 443 2018/10/09 12:55:12 - CMDPHP PHP ERROR NOTICE Backtrace: (/remote_agent.php[74]:ping_device(), /remote_agent.php[282]:api_device_ping_device(), /lib/api_device.php[440]:CactiErrorHandler()) 2018/10/09 12:55:12 - ERROR PHP NOTICE: Undefined index: availability_method in file: /usr/share/cacti/lib/api_device.php on line: 440

Always: image

thanks a lot.

netniV commented 6 years ago

Can you provide the following from both your database's? (eg, main and poller)

show create table `host`\G

Then, try do a full sync to see if the issue resolves itself.

anarkia1976 commented 6 years ago

show create table host\G

MAIN:

MariaDB [cacti]> show create table host\G 1. row Table: host Create Table: CREATE TABLE host ( id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, poller_id int(10) unsigned NOT NULL DEFAULT '1', site_id int(10) unsigned NOT NULL DEFAULT '1', host_template_id mediumint(8) unsigned NOT NULL DEFAULT '0', description varchar(150) NOT NULL DEFAULT '', hostname varchar(100) DEFAULT NULL, location varchar(40) DEFAULT NULL, notes text, external_id varchar(40) DEFAULT NULL, snmp_community varchar(100) DEFAULT NULL, snmp_version tinyint(1) unsigned NOT NULL DEFAULT '1', snmp_username varchar(50) DEFAULT NULL, snmp_password varchar(50) DEFAULT NULL, snmp_auth_protocol char(6) DEFAULT '', snmp_priv_passphrase varchar(200) DEFAULT '', snmp_priv_protocol char(6) DEFAULT '', snmp_context varchar(64) DEFAULT '', snmp_engine_id varchar(64) DEFAULT '', snmp_port mediumint(5) unsigned NOT NULL DEFAULT '161', snmp_timeout mediumint(8) unsigned NOT NULL DEFAULT '500', snmp_sysDescr varchar(300) NOT NULL DEFAULT '', snmp_sysObjectID varchar(128) NOT NULL DEFAULT '', snmp_sysUpTimeInstance int(10) unsigned NOT NULL DEFAULT '0', snmp_sysContact varchar(300) NOT NULL DEFAULT '', snmp_sysName varchar(300) NOT NULL DEFAULT '', snmp_sysLocation varchar(300) NOT NULL DEFAULT '', availability_method smallint(5) unsigned NOT NULL DEFAULT '1', ping_method smallint(5) unsigned DEFAULT '0', ping_port int(12) unsigned DEFAULT '0', ping_timeout int(12) unsigned DEFAULT '500', ping_retries int(12) unsigned DEFAULT '2', max_oids int(12) unsigned DEFAULT '10', device_threads tinyint(2) unsigned NOT NULL DEFAULT '1', disabled char(2) DEFAULT NULL, monitor char(3) NOT NULL DEFAULT 'on', monitor_text varchar(1024) NOT NULL DEFAULT '', monitor_criticality tinyint(3) unsigned NOT NULL DEFAULT '0', monitor_warn double NOT NULL DEFAULT '0', monitor_alert double NOT NULL DEFAULT '0', thold_send_email int(10) NOT NULL DEFAULT '1', thold_host_email int(10) DEFAULT NULL, status tinyint(2) NOT NULL DEFAULT '0', status_event_count mediumint(8) unsigned NOT NULL DEFAULT '0', status_fail_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', status_rec_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', status_last_error varchar(255) DEFAULT '', min_time decimal(10,5) DEFAULT '9.99999', max_time decimal(10,5) DEFAULT '0.00000', cur_time decimal(10,5) DEFAULT '0.00000', avg_time decimal(10,5) DEFAULT '0.00000', polling_time double DEFAULT '0', total_polls int(12) unsigned DEFAULT '0', failed_polls int(12) unsigned DEFAULT '0', availability decimal(8,5) NOT NULL DEFAULT '100.00000', last_updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY poller_id_disabled (poller_id,disabled), KEY site_id (site_id), KEY external_id (external_id), KEY disabled (disabled), KEY status (status), KEY hostname (hostname), KEY poller_id_last_updated (poller_id,last_updated), KEY site_id_location (site_id,location) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 1 row in set (0.00 sec)

POLLER:

MariaDB [cacti]> show create table host\G 1. row Table: host Create Table: CREATE TABLE host ( id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, poller_id int(10) unsigned NOT NULL DEFAULT '1', site_id int(10) unsigned NOT NULL DEFAULT '1', host_template_id mediumint(8) unsigned NOT NULL DEFAULT '0', description varchar(150) NOT NULL DEFAULT '', hostname varchar(100) DEFAULT NULL, location varchar(40) DEFAULT NULL, notes text, external_id varchar(40) DEFAULT NULL, snmp_community varchar(100) DEFAULT NULL, snmp_version tinyint(1) unsigned NOT NULL DEFAULT '1', snmp_username varchar(50) DEFAULT NULL, snmp_password varchar(50) DEFAULT NULL, snmp_auth_protocol char(6) DEFAULT '', snmp_priv_passphrase varchar(200) DEFAULT '', snmp_priv_protocol char(6) DEFAULT '', snmp_context varchar(64) DEFAULT '', snmp_engine_id varchar(64) DEFAULT '', snmp_port mediumint(5) unsigned NOT NULL DEFAULT '161', snmp_timeout mediumint(8) unsigned NOT NULL DEFAULT '500', snmp_sysDescr varchar(300) NOT NULL DEFAULT '', snmp_sysObjectID varchar(128) NOT NULL DEFAULT '', snmp_sysUpTimeInstance int(10) unsigned NOT NULL DEFAULT '0', snmp_sysContact varchar(300) NOT NULL DEFAULT '', snmp_sysName varchar(300) NOT NULL DEFAULT '', snmp_sysLocation varchar(300) NOT NULL DEFAULT '', availability_method smallint(5) unsigned NOT NULL DEFAULT '1', ping_method smallint(5) unsigned DEFAULT '0', ping_port int(12) unsigned DEFAULT '0', ping_timeout int(12) unsigned DEFAULT '500', ping_retries int(12) unsigned DEFAULT '2', max_oids int(12) unsigned DEFAULT '10', device_threads tinyint(2) unsigned NOT NULL DEFAULT '1', disabled char(2) DEFAULT NULL, status tinyint(2) NOT NULL DEFAULT '0', status_event_count mediumint(8) unsigned NOT NULL DEFAULT '0', status_fail_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', status_rec_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', status_last_error varchar(255) DEFAULT '', min_time decimal(10,5) DEFAULT '9.99999', max_time decimal(10,5) DEFAULT '0.00000', cur_time decimal(10,5) DEFAULT '0.00000', avg_time decimal(10,5) DEFAULT '0.00000', polling_time double DEFAULT '0', total_polls int(12) unsigned DEFAULT '0', failed_polls int(12) unsigned DEFAULT '0', availability decimal(8,5) NOT NULL DEFAULT '100.00000', last_updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY poller_id_disabled (poller_id,disabled), KEY site_id (site_id), KEY external_id (external_id), KEY disabled (disabled), KEY status (status), KEY site_id_location (site_id,location), KEY hostname (hostname), KEY poller_id_last_updated (poller_id,last_updated) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec)

anarkia1976 commented 6 years ago

Can you provide the following from both your database's? (eg, main and poller)

show create table `host`\G

Then, try do a full sync to see if the issue resolves itself.

I have made a full sync, but the problem is the same.

cigamit commented 6 years ago

Providing some instrumentation shortly.

cigamit commented 6 years ago

After cloning, goto Settings > Poller and update the Remote Agent timeout.

anarkia1976 commented 6 years ago

No more erros. Thanks a lot.