NewsBlur/config/munin/mongodb_page_faults

30 lines
784 B
Text
Raw Permalink Normal View History

2016-11-11 11:09:13 -08:00
#!/srv/newsblur/venv/newsblur/bin/python
2011-12-02 16:22:38 -08:00
# -*- coding: utf-8 -*-
2016-11-11 11:06:33 -08:00
from vendor.munin.mongodb import MuninMongoDBPlugin
2011-12-02 16:22:38 -08:00
class MongoDBPageFaultsPlugin(MuninMongoDBPlugin):
args = "-l 0 --base 1000"
vlabel = "page faults / sec"
title = "MongoDB page faults"
info = "Page faults"
fields = (
('page_faults', dict(
label = "page faults",
info = "Page faults",
type = "DERIVE",
min = "0",
)),
)
def execute(self):
status = self.connection.admin.command('serverStatus')
try:
value = status['extra_info']['page_faults']
except KeyError:
value = "U"
return dict(page_faults=value)
if __name__ == "__main__":
MongoDBPageFaultsPlugin().run()