mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
29 lines
784 B
Python
Executable file
29 lines
784 B
Python
Executable file
#!/srv/newsblur/venv/newsblur/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from vendor.munin.mongodb import MuninMongoDBPlugin
|
|
|
|
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()
|