mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
50 lines
1.3 KiB
Python
Executable file
50 lines
1.3 KiB
Python
Executable file
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from vendor.munin.pgbouncer import MuninPgBouncerPlugin
|
|
|
|
class MuninPgBouncerPoolsServerPlugin(MuninPgBouncerPlugin):
|
|
command = "SHOW POOLS"
|
|
vlabel = "Connections"
|
|
info = "Shows number of connections to postgresql"
|
|
|
|
fields = (
|
|
('sv_active', dict(
|
|
label = "active",
|
|
info = "Active connections to Postgresql",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
('sv_idle', dict(
|
|
label = "idle",
|
|
info = "Idle connections to Postgresql",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
('sv_used', dict(
|
|
label = "used",
|
|
info = "Used connections to Postgresql",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
('sv_tested', dict(
|
|
label = "tested",
|
|
info = "Tested connections to Postgresql",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
('sv_login', dict(
|
|
label = "login",
|
|
info = "Connections logged in to Postgresql",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
)
|
|
|
|
@property
|
|
def title(self):
|
|
return "PgBouncer server connections on %s" % self.dbwatched
|
|
|
|
if __name__ == "__main__":
|
|
MuninPgBouncerPoolsServerPlugin().run()
|
|
|