Skip to content

When adding devices via command line, bad SNMP versions are not reported #3111

@AlbertYangXY

Description

@AlbertYangXY

I do it by executing
php add_device.php --description=w02v.game.1311.com --ip=10.117.109.84 --template=9 --avail='ping' --proxy

It returns
Success - new device-id: (0)

The cacti.log is as follows:
2019/11/28 22:19:29 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'net' in 'field list'
2019/11/28 22:19:29 - CMDPHP SQL Backtrace: (/cli/add_device.php[444]:api_device_save(), /lib/api_device.php[719]:sql_save(), /lib/database.php[1394]:_db_replace(), /lib/database.php[1324]:db_execute(), /lib/database.php[191]:db_execute_prepared())
2019/11/28 22:19:29 - DBCALL ERROR: SQL Save Failed for Table 'host'. SQL:'INSERT INTO host (id, host_template_id, poller_id, site_id, external_id, description, hostname, notes, location, snmp_version, snmp_community, snmp_username, snmp_password, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context, snmp_engine_id, snmp_port, snmp_timeout, disabled, availability_method, ping_method, ping_port, ping_timeout, ping_retries, max_oids, device_threads, monitor, monitor_text, monitor_criticality, monitor_warn, monitor_alert, alertsms, sms_phone) VALUES (0, 9, 1, 1, '', 'w02v.game.1311.com', '10.117.109.84', '', '', net-snmp, 'cacti', '', '', '', '', '', '', '', 161, 1000, '', 3, 3, 8360, 1000, 3, 100, 1, '', '', 0, 0, 0, '', '') ON DUPLICATE KEY UPDATE host_template_id=VALUES(host_template_id), poller_id=VALUES(poller_id), site_id=VALUES(site_id), external_id=VALUES(external_id), description=VALUES(description), hostname=VALUES(hostname), notes=VALUES(notes), location=VALUES(location), snmp_version=VALUES(snmp_version), snmp_community=VALUES(snmp_community), snmp_username=VALUES(snmp_username), snmp_password=VALUES(snmp_password), snmp_auth_protocol=VALUES(snmp_auth_protocol), snmp_priv_passphrase=VALUES(snmp_priv_passphrase), snmp_priv_protocol=VALUES(snmp_priv_protocol), snmp_context=VALUES(snmp_context), snmp_engine_id=VALUES(snmp_engine_id), snmp_port=VALUES(snmp_port), snmp_timeout=VALUES(snmp_timeout), disabled=VALUES(disabled), availability_method=VALUES(availability_method), ping_method=VALUES(ping_method), ping_port=VALUES(ping_port), ping_timeout=VALUES(ping_timeout), ping_retries=VALUES(ping_retries), max_oids=VALUES(max_oids), device_threads=VALUES(device_threads), monitor=VALUES(monitor), monitor_text=VALUES(monitor_text), monitor_criticality=VALUES(monitor_criticality), monitor_warn=VALUES(monitor_warn), monitor_alert=VALUES(monitor_alert), alertsms=VALUES(alertsms), sms_phone=VALUES(sms_phone)'

My newly deployed machine did not report an error. The machine that reported the error was upgraded from cacti0.8.8a to cacti1.2.7. The database was upgraded from mysql5.1 to mysql5.7, but I copied the mysql table structure of the new machine to the old machine. Still reporting errors

Need your help very much

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions