Unable to get performance metrics from check_sql

Hey, Refering to the Docs: SQL Database Request Check

The query must return three columns, a number, a text, and optional performance data in the third column. The columns are comma-separated. Performance data must be in the standard format of nagios performance data. If upper and lower levels are given, the number is checked against these levels and the according state is being computed. Otherwise the number ist treated as a Nagios state (0,1,2,3). State, text and the performance data are being returned.

So your query should look something like:
SELECT '0', SUM(highly_vulnerable_count), CONCAT('| highvulncount=',SUM(highly_vulnerable_count)) from public.bopatchreports

The First 0 is for the status output (ok), the second is the “Output of check plugin” and the third is the performance data.

The | was needed in our cases if you have multiple values which should be appear in the performance data.