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
// autovacuumHandler returns count of autovacuum workers if all is OK or nil otherwise.
29
29
func autovacuumHandler(ctx context.Context, conn PostgresClient,
30
30
_ string, _ map[string]string, _ ...string) (interface{}, error) {
31
31
var countAutovacuumWorkers int64
32
32
33
33
query := `SELECT count(*)
34
34
FROM pg_catalog.pg_stat_activity
35
35
WHERE query like '%%autovacuum%%'