Welcome, Guest. Please login or register.

Author Topic: Error in nedi libdb.pm line 1231  (Read 1531 times)

misch

  • Guest
Error in nedi libdb.pm line 1231
« on: January 14, 2014, 04:38:33 PM »
Hi,

when I use a MAC Address (ifPhysicalAddress) as serial number I get the error:

DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '9#Y' and state != 100' at line 1 at /opt/nedi/inc/libdb.pm line 1231.

Is seems that the statement ... where serial = '$main::dev{$dv}{sn}' ... cannot deal with nedi's DB representation of MAC addresses.

Greetings,

Michael Schwartzkopff.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2786
    • View Profile
    • NeDi
Re: Error in nedi libdb.pm line 1231
« Reply #1 on: January 14, 2014, 06:49:06 PM »
MAC should only be a string (as any SN). Did you get a binary result from SNMP? I assume you clicked on the SN in Devices-Status?
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

misch

  • Guest
Re: Error in nedi libdb.pm line 1231
« Reply #2 on: January 16, 2014, 11:41:13 AM »
I wanted to use the MAC address of the fist interface as the serial number of devices that od not have serial numbers displayen in other parts of the MIB. So I used:

ifPhysAddress.2 (.1.3.6.1.2.1.2.2.1.6.2) which in turn results in:

IF-MIB::ifPhysAddress.2 = STRING: 0:15:6d:73:ee:2c

It is in face a STRING, but contains ":". It seems that NeDi does not like that.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2786
    • View Profile
    • NeDi
Re: Error in nedi libdb.pm line 1231
« Reply #3 on: January 16, 2014, 08:29:26 PM »
I tested, but it seems to work with : in the SN. However when I use a MAC it results in 0x586d8f...

Good idea to use 1st MAC, btw
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo