PostgreSQL loadable plugin
Source
14
14
** See the License for the specific language governing permissions and
15
15
** limitations under the License.
16
16
**/
17
17
18
18
package plugin
19
19
20
20
import (
21
21
"context"
22
22
"errors"
23
23
24
-
"git.zabbix.com/ap/plugin-support/zbxerr"
25
24
"github.com/jackc/pgx/v4"
25
+
"golang.zabbix.com/sdk/zbxerr"
26
26
)
27
27
28
28
// bgwriterHandler executes select with statistics from pg_stat_bgwriter
29
29
// and returns JSON if all is OK or nil otherwise.
30
30
func bgwriterHandler(ctx context.Context, conn PostgresClient,
31
31
_ string, _ map[string]string, _ ...string) (interface{}, error) {
32
32
var bgwriterJSON string
33
33
34
34
query := `
35
35
SELECT row_to_json (T)