Skip to content

Plugin Write MongoDB

Florian Forster edited this page Nov 26, 2023 · 1 revision
Name: Write MongoDB plugin
Type: write
Callbacks: config, write
Status: supported
FirstVersion: 5.1
Copyright: 2010 Akkarit Sangpetch, 2010 Florian Forster, 2012 Chris Lundquist
License: MIT License
Manpage: collectd.conf(5)
See also: List of Plugins

The Write MongoDB plugin writes data collected by collectd to an instance of MongoDB, a schema-less "NoSQL" database.

Synopsis

 <Plugin "write_mongodb">
   <Node "default">
     Host "localhost"
     Port     "27017"
     Timeout    2000
     StoreRates true
   </Node>
 </Plugin>

This will register a writer with the following name:

write_mongodb/localhost

Example data

Data is added to the collectd.${plugin} "collection". They currently have the following format:

 /* Collection "collectd.${plugin}" = */
 {
   "time": 1330940612.932, /* BSON date (UTC milliseconds) */
   "host": "localhost",    /* string */
   "plugin_instance": "",  /* string */
   "type": "load",         /* string */
   "type_instance": "",    /* string */
   "values": [             /* array of numbers */
     0.42, 0.37, 0.11
   ],
   "dstypes": [            /* array of strings */
     "gauge", "gauge", "gauge"
   ],
   "dsnames": [            /* array of strings */
     "shortterm", "midterm", "longterm"
   ]
 }

Dependencies

See also

Clone this wiki locally