mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
29 lines
740 B
Python
Executable file
29 lines
740 B
Python
Executable file
#!/srv/newsblur/venv/newsblur3/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from vendor.munin.mongodb import MuninMongoDBPlugin
|
|
|
|
class MongoDBObjectsPlugin(MuninMongoDBPlugin):
|
|
args = "--base 1000"
|
|
vlabel = "objects"
|
|
info = "Number of objects stored"
|
|
dbname_in_args = True
|
|
fields = (
|
|
('objects', dict(
|
|
label = "objects",
|
|
info = "Number of objects stored",
|
|
type = "GAUGE",
|
|
min = "0",
|
|
)),
|
|
)
|
|
|
|
@property
|
|
def title(self):
|
|
return "MongoDB objects in database %s" % self.dbname
|
|
|
|
def execute(self):
|
|
stats = self.db.command("dbstats")
|
|
return dict(objects=stats['objects'])
|
|
|
|
if __name__ == "__main__":
|
|
MongoDBObjectsPlugin().run()
|