2020-12-03 14:05:32 -05:00
|
|
|
#!/srv/newsblur/venv/newsblur3/bin/python
|
2011-12-02 16:22:38 -08:00
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import urllib
|
2016-11-11 11:06:33 -08:00
|
|
|
from vendor.munin.nginx import MuninNginxPlugin
|
2011-12-02 16:22:38 -08:00
|
|
|
|
|
|
|
class MuninNginxConnectionsPlugin(MuninNginxPlugin):
|
|
|
|
title = "Nginx Connections"
|
|
|
|
args = "--base 1000"
|
|
|
|
vlabel = "Connections"
|
|
|
|
fields = (
|
|
|
|
('total', dict(
|
|
|
|
label = "Active connections",
|
|
|
|
type = "GAUGE",
|
|
|
|
draw = "LINE2",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
('reading', dict(
|
|
|
|
label = "Reading",
|
|
|
|
type = "GAUGE",
|
|
|
|
draw = "LINE2",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
('writing', dict(
|
|
|
|
label = "Writing",
|
|
|
|
type = "GAUGE",
|
|
|
|
draw = "LINE2",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
('waiting', dict(
|
|
|
|
label = "Waiting",
|
|
|
|
type = "GAUGE",
|
|
|
|
draw = "LINE2",
|
|
|
|
min = "0",
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
status = self.get_status()
|
|
|
|
return dict(
|
|
|
|
total = status['active'],
|
|
|
|
reading = status['reading'],
|
|
|
|
writing = status['writing'],
|
|
|
|
waiting = status['waiting'],
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
MuninNginxConnectionsPlugin().run()
|