File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -669,7 +669,7 @@ function boost_get_arch_table_names($latest_table = '') {
669669 * 5) Process the entire result set
670670 *
671671 * @param (int) local_data_id - the local data id to update
672- * @param (resourse ) rrdtool_pipe - a pointer to the rrdtool process
672+ * @param (resource ) rrdtool_pipe - a pointer to the rrdtool process
673673 *
674674 * @return (void)
675675 */
Original file line number Diff line number Diff line change @@ -2972,7 +2972,7 @@ function rrdtool_cacti_compare($data_source_id, &$info) {
29722972 }
29732973
29742974 /**
2975- * Accomodate a Cacti bug where the heartbeat was not
2975+ * Accommodate a Cacti bug where the heartbeat was not
29762976 * propagated.
29772977 */
29782978 if ($ data_source ['minimal_heartbeat ' ] != $ profile_heartbeat ) {
@@ -3072,7 +3072,7 @@ function rrdtool_cacti_compare($data_source_id, &$info) {
30723072 $ file_rra ['pdp_per_row ' ] = 0 ;
30733073 }
30743074
3075- /* corrrect issue with older rrdtools */
3075+ /* correct issue with older rrdtools */
30763076 $ file_rra ['cf ' ] = trim ($ file_rra ['cf ' ], '" ' );
30773077
30783078 if ($ cacti_rra ['cf ' ] == $ file_rra ['cf ' ] && $ cacti_rra_id == $ file_rra_id ) {
Original file line number Diff line number Diff line change 1212 $ cmd .= ' -p ' . cacti_escapeshellarg ($ database_password );
1313}
1414
15- print trim ( $ sql ) ;
15+ $ cmd .= ' status ' ;
1616
17- $ sql = shell_exec ($ cmd );
17+ $ output = shell_exec ($ cmd );
1818
19- // Cacti expects 'U' on error, not empty string or 0.
20- print trim ($ sql ?? '' ) ?: 'U ' ;
19+ if ($ output === null || $ output === '' ) {
20+ print 'U ' ;
21+ } else {
22+ // Extract the 6th field (Queries per second avg), matching original awk '{print $6}'
23+ $ parts = preg_split ('/\s+/ ' , trim ($ output ));
24+ print isset ($ parts [5 ]) ? $ parts [5 ] : 'U ' ;
25+ }
You can’t perform that action at this time.
0 commit comments