Aha, I see what it’s doing. You missed out the actual query, which makes it more obvious what’s happening
/graph.php?type=customer_bits&id=herp,derp&debug=1
Generates:
SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = 'herp','derp' AND D.device_id = I.device_id
We have a bit of code in the URL parser that expands any argument with a comma into an array of arguments, it’s used when you put in a list of port_ids for example. It’s expanding this here, and we’re passing an array of values to the SQL query builder.
I’m not sure how much would need to be changed to suppress this behaviour in this instance, so I’d recommend just not putting commas in port descriptions!
Thanks,
Adam.
From: Chris Macneill <cmacneill@zelan.co.nz>
Sent: 26 February 2020 17:22
To: observium <observium@observium.org>
Cc: adama <adama@observium.org>
Subject: Re: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
Hi Adam,
Looks like data is being split on commas and causing an SQL syntax error. Debug for:-
Cust: GDC Westland Recreation Centre, 83 High St, Greymouth [100Mbit] {Chorus CVID.113}
returns:-
Error in query: (You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' 83 High St',' Greymouth' AND D.device_id = I.device_id' at line 1) 1064
I can obviously fix this short-term by removing commas from the Port Descriptions, but would be good to be able to support use of commas and other punctuation in the longer term or at least update the Help page to list characters to avoid.
I had a quick look earlier at the Regex that was parsing the description data, but wasn't immediately obvious commas were an issue. At least I know where the problem lies and I'll take another look later. I guess semi-colons might work if commas don't.
Regards
Chris Macneill
Zelan Ltd
From: "observium" <observium@observium.org>
To: "observium" <observium@observium.org>
Cc: "adama" <adama@observium.org>
Sent: Thursday, 27 February, 2020 04:50:22
Subject: Re: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
Do you get anything useful from showing rrd command on the graph browser page? (click on the graph)
Do you get anything useful from adding &debug=1 on the end of the graph image url?
Can you arrange ssh/http access to the install if those two things don’t show us what the problem is?
Adam.
From: observium <observium-bounces@observium.org> On Behalf Of Chris Macneill via observium
Sent: 26 February 2020 05:22
To: observium <observium@observium.org>
Cc: Chris Macneill <cmacneill@cmit.nz>
Subject: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
Hi,
We're currently using Observium v20.1.10233 and have a problem with "Error Drawing Graph" for all ports with a "Cust" prefix. Ports with "Core", "Peer" or "Transit" prefix correctly show graphs.
The ports we're monitoring are VLANs, the Peer/Transit are simple 802.1q VLANs, the Core/Customer VLANs are QinQ, i.e. two layers of 802.1q headers.
All port types are correctly detected by SNMP and listed against the Router. Given that "Core" displays graphs correctly, this doesn't seem to be related to QinQ, but specifically to the "Cust" prefix.
Examples that correctly show graphs, 1st is 802.1q, 2nd is QinQ:-
Peering: Datacom CHC<->Chorus [10Gbit] {Chorus SVID.100}
Core: Zelan Workshop, 50 Palmerston St, Westport [1Gbit] {Chorus CVID.100}
Example (QinQ) that gives "Error Drawing Graph":-
Cust: GDC Westland Recreation Centre, 83 High St, Greymouth [100Mbit] {Chorus CVID.113}
All our routers are MikroTik, so can't determine if this is a router OS/hardware specific issue.
Regards
Chris Macneill
Zelan Ltd.
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium