2020-12-03 14:05:32 -05:00
|
|
|
#!/srv/newsblur/venv/newsblur3/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 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()
|