+ def putnotif(self, message, options={}):
+ """Send a PUTNOTIF command.
+
+ Options must be passed as a Python dictionary. Example:
+ options={'severity': 'failure', 'host': 'example.com'}
+
+ Full documentation:
+ http://collectd.org/wiki/index.php/Plain_text_protocol#PUTNOTIF
+
+ """
+ args = []
+ if options:
+ options_args = map(lambda x: "%s=%s" % (x, options[x]), options)
+ args.extend(options_args)
+ args.append('message="%s"' % message)
+ return self._cmd('PUTNOTIF %s' % ' '.join(args))
+
+ def putval(self, identifier, values, options={}):
+ """Send a PUTVAL command.
+
+ Options must be passed as a Python dictionary. Example:
+ options={'interval': 10}
+
+ Full documentation:
+ http://collectd.org/wiki/index.php/Plain_text_protocol#PUTVAL
+
+ """
+ args = []
+ args.append('"%s"' % identifier)
+ if options:
+ options_args = map(lambda x: "%s=%s" % (x, options[x]), options)
+ args.extend(options_args)
+ values = map(str, values)
+ args.append(':'.join(values))
+ return self._cmd('PUTVAL %s' % ' '.join(args))
+