SQL-Error after adding "new" device...


31-03-2004 05:36:46

Hello, after installing some 3Com-Devices, which I'd like to monitor via SNMP, I got the following emails 'NetMRG died on its run 230 seconds before. I'll remove the lockfile' and shortly after 'NetMRG exited abnormally'.

In the directory /usr/local/var/log/netmrg I found the following error in lastrun.log.xxxx

NetMRG starting.
[Dev 0003] Starting device thread.
[Dev 0004] Starting device thread.
[Dev 0005] Starting device thread.
[Dev 0002] Starting device thread.
[Dev 0006] Starting device thread.
[Dev 0007] Starting device thread.
[Dev 0008] Starting device thread.
[Dev 0009] Starting device thread.
[Dev 0010] Starting device thread.
[Dev 0013] Starting device thread.
[Dev 0014] Starting device thread.
[Dev 0015] Starting device thread.
[Dev 0007] Ending device thread.
[Dev 0010] Number of cached interfaces (0) doesn't match reported number of interfaces.
[Dev 0010] Performing SNMP Recache.
[Dev 0017] Starting device thread.
[Dev 0018] Starting device thread.
[Dev 0019] Starting device thread.
Thread Ended.
[Dev 0008] Ending device thread.
[Dev 0017] Device has returned from SNMP-death.
[Dev 0018] Device has returned from SNMP-death.
[Dev 0017] Number of interfaces changed from 0 to 47
[Dev 0017] Performing SNMP Recache.
[Dev 0018] Number of interfaces changed from 0 to 47
[Dev 0018] Performing SNMP Recache.
[Dev 0009] Ending device thread.
[Dev 0020] Starting device thread.
Thread Ended.
Thread Ended.
[Dev 0013] [Sub 0283] MySQL Query Failed. (SELECT ifIndex, ifName, ifIP, ifDescr, ifAlias, ifMAC, ifSpeed FROM snmp_interface_cache WHERE dev_id=13 AND ifDescr="RMON "Seg-2" on Unit 2") (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 'Seg-2" on Unit 2"' at line 1)

I suppose the error lies in the ifDescr where are too many quotation-marks.

However, how can I manage to get the system running again, and, how can I deal in the future with such interface descriptions ???

oops => System is running again with the following workaroud I deleted the specific devices and added them again, without monitoring the maleformed interface names.


31-03-2004 11:27:58

Yep, that looks like a bug. It looks like the gatherer isn't properly escaping quotes. The workaround you've specified is okay, but we'd definitely like something better.
I've created bug#183 for this; feel free to login there and monitor our progress.
Brady's out this week, so it might not get fixed til he gets back, so please hang in there.