Created
June 5, 2013 10:35
-
-
Save badcrc/5713022 to your computer and use it in GitHub Desktop.
Revisions
-
badcrc created this gist
Jun 5, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import Gmetric def send_gmetric_data(metric_name,metric_value,metric_group): parser = optparse.OptionParser() #gmond configuration options = {} options['host'] = "your_server" options['protocol'] = "udp" options['port'] = 8649 options['name'] = metric_name options['value'] = metric_value options['units'] = "" options['slope'] = "both" options['type'] = "int16" options['tmax'] = "60" options['dmax'] = "0" options['group'] = metric_group options['spoof'] = metric_group #mandamos los datos g = Gmetric(options['host'], options['port'], options['protocol']) g.send(options['name'], options['value'], options['type'], options['units'], options['slope'], options['tmax'], options['dmax'], options['group'], options['spoof'])