Re: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
![](https://secure.gravatar.com/avatar/1ac78077679dc442f8138bc8374d85dd.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/3bbbd945c333b8013d0dfa23058f65b9.jpg?s=120&d=mm&r=g)
Hi Chris,
try with latest revision (r10304, trunk).
Issue should be fixed.
Chris Macneill via observium wrote on 26.02.2020 20:25:
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
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/1ac78077679dc442f8138bc8374d85dd.jpg?s=120&d=mm&r=g)
Hi Mike,
Sorry, 20.2.10304 doesn't fix it. Fields still split on commas for port_descr_type = 'cust' and debug results exactly the same as previous:-
SELECT * FROM `ports` AS I , `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = 'GDC Westland Recreation Centre' , ' 83 High St' , ' Greymouth' AND D . device_id = I . device_id
Also, a new bug added, software version number at bottom of screen is now out of step with "svn update". Update said successfully updated to 10304, but webpage says 20.2.10302
I've had a hack at the code in html/includes/graphs/customer/bits.inc.php and put the following workaround in place:-
Line 16 (Original v20.2.10304 Code) foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($vars['id'])) as $port)
Replaced with:-
// Copy id array directly for case where port_descr_descr was NOT previosuly split/exploded on commas. $pddstr = $vars['id']; if ( count($vars['id']) > 1 ) { // Impode id array addng commas where array size > 1, i.e. original id contained commas and WAS split/exploded. $pddstr = implode(",", $vars['id']); } foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($pddstr)) as $port)
$vars['id'] is the result of splitting or exploding port_descr_descr string value somewhere earlier, but I can't locate that in the code and as Adam mentioned, changing this elsewhere might have undesirable consequences.
The problem only happens for port_descr_type = "cust", for other port types, e.g. core, peering, transit, port_descr_descr isn't split or exploded despite containing commas, but I can't find the locaiton in the code where this conditional behaviour occurs.
Regards
Chris Macneill Zelan Ltd
From: "Mike Stupalov" mike@observium.org To: "observium" observium@observium.org, "observium" observium@observium.org Cc: "Chris Macneill" cmacneill@cmit.nz Sent: Thursday, 27 February, 2020 12:59:52 Subject: Re: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
Hi Chris,
try with latest revision (r10304, trunk).
Issue should be fixed.
Chris Macneill via observium wrote on 26.02.2020 20:25:
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" [ mailto:observium@observium.org | observium@observium.org ] To: "observium" [ mailto:observium@observium.org | observium@observium.org ] Cc: "adama" [ mailto:adama@observium.org | 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 [ mailto:observium-bounces@observium.org | observium-bounces@observium.org ] On Behalf Of Chris Macneill via observium Sent: 26 February 2020 05:22 To: observium [ mailto:observium@observium.org | observium@observium.org ] Cc: Chris Macneill [ mailto:cmacneill@cmit.nz | 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 [ mailto:observium@observium.org | observium@observium.org ] [ http://postman.memetic.org/cgi-bin/mailman/listinfo/observium | http://postman.memetic.org/cgi-bin/mailman/listinfo/observium ]
_______________________________________________ observium mailing list [ mailto:observium@observium.org | observium@observium.org ] [ http://postman.memetic.org/cgi-bin/mailman/listinfo/observium | http://postman.memetic.org/cgi-bin/mailman/listinfo/observium ]
![](https://secure.gravatar.com/avatar/0fa97865a0e1ab36152b6b2299eedb49.jpg?s=120&d=mm&r=g)
Is this, perchance, stable, and not rolling?
Adam.
Sent from BlueMail
On 27 Feb 2020, 01:45, at 01:45, Chris Macneill via observium observium@observium.org wrote:
Hi Mike,
Sorry, 20.2.10304 doesn't fix it. Fields still split on commas for port_descr_type = 'cust' and debug results exactly the same as previous:-
SELECT * FROM `ports` AS I , `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = 'GDC Westland Recreation Centre' , ' 83 High St' , ' Greymouth' AND D . device_id = I . device_id
Also, a new bug added, software version number at bottom of screen is now out of step with "svn update". Update said successfully updated to 10304, but webpage says 20.2.10302
I've had a hack at the code in html/includes/graphs/customer/bits.inc.php and put the following workaround in place:-
Line 16 (Original v20.2.10304 Code) foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($vars['id'])) as $port)
Replaced with:-
// Copy id array directly for case where port_descr_descr was NOT previosuly split/exploded on commas. $pddstr = $vars['id']; if ( count($vars['id']) > 1 ) { // Impode id array addng commas where array size > 1, i.e. original id contained commas and WAS split/exploded. $pddstr = implode(",", $vars['id']); } foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($pddstr)) as $port)
$vars['id'] is the result of splitting or exploding port_descr_descr string value somewhere earlier, but I can't locate that in the code and as Adam mentioned, changing this elsewhere might have undesirable consequences.
The problem only happens for port_descr_type = "cust", for other port types, e.g. core, peering, transit, port_descr_descr isn't split or exploded despite containing commas, but I can't find the locaiton in the code where this conditional behaviour occurs.
Regards
Chris Macneill Zelan Ltd
From: "Mike Stupalov" mike@observium.org To: "observium" observium@observium.org, "observium" observium@observium.org Cc: "Chris Macneill" cmacneill@cmit.nz Sent: Thursday, 27 February, 2020 12:59:52 Subject: Re: [Observium] Port Description Parsing - Cust Graphs "Error Drawing Graph"
Hi Chris,
try with latest revision (r10304, trunk).
Issue should be fixed.
Chris Macneill via observium wrote on 26.02.2020 20:25:
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" [ mailto:observium@observium.org | observium@observium.org ] To: "observium" [ mailto:observium@observium.org | observium@observium.org ] Cc: "adama" [ mailto:adama@observium.org | 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 [ mailto:observium-bounces@observium.org | observium-bounces@observium.org ] On Behalf Of Chris Macneill via observium Sent: 26 February 2020 05:22 To: observium [ mailto:observium@observium.org | observium@observium.org ] Cc: Chris Macneill [ mailto:cmacneill@cmit.nz | 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 [ mailto:observium@observium.org | observium@observium.org ] [ http://postman.memetic.org/cgi-bin/mailman/listinfo/observium | http://postman.memetic.org/cgi-bin/mailman/listinfo/observium ]
observium mailing list [ mailto:observium@observium.org | observium@observium.org ] [ http://postman.memetic.org/cgi-bin/mailman/listinfo/observium | http://postman.memetic.org/cgi-bin/mailman/listinfo/observium ]
-- Mike Stupalov Observium Limited, [ http://observium.org/ | http://observium.org ]
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (3)
-
Adam Armstrong
-
Chris Macneill
-
Mike Stupalov