I hereby claim:
- I am niklibrato on github.
- I am niklibrato (https://keybase.io/niklibrato) on keybase.
- I have a public key ASBOdjKAmlNN5YeS4QuRmiPMEAQ6BoyEYSDu1lXHegp0Ywo
To claim this, I am signing this object:
#!/usr/bin/env python | |
import requests | |
import csv | |
# Get your Pingdom Bearer token from https://my.pingdom.com/app/api-tokens or create a new one | |
bearer_token = 'secretpingdombearertoken' | |
url = "https://api.pingdom.com/api/3.1/checks" | |
headers = {'content-type': 'application/json'} |
#!/usr/bin/env python | |
import requests | |
import csv | |
# Get your Pingdom Bearer token from https://my.pingdom.com/app/api-tokens or create a new one | |
bearer_token = 'secretpingdombearertoken' | |
url = "https://api.pingdom.com/api/3.1/checks" | |
headers = {'content-type': 'application/json'} |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
#download a 5MB file from http://www.thinkbroadband.com/download.html | |
while true; do | |
curl --stderr test.txt http://ipv4.download.thinkbroadband.com/5MB.zip > 5MB.zip | |
speed=$(cat test.txt | awk '{gsub(/\r/,"\n")};1' | awk 'END{print $7}') | |
multiplier=$(echo $speed | awk '{print substr($1,length($1),1)}') | |
value=$(echo $speed | awk '{sub(/k/,"")};1') | |
if [[ "$multiplier" == "k" ]] ; then value=$value"000" ; elif [[ "$multiplier" == "M" ]] ; then value=$value"000000" ; fi | |
#delete the file |
[{"id":"cf452056.f2f35","type":"inject","z":"a2e7ef47.d8313","name":"measure_time","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":169.5,"y":119,"wires":[["71751e63.43b1c"]]},{"id":"71751e63.43b1c","type":"function","z":"a2e7ef47.d8313","name":"librato_payload","func":"function getRandomInt(min, max) { \n return Math.floor(Math.random() * (max - min +1)) + min; \n}\n\nvar value = getRandomInt(1, 10);\nvar measure_time = Math.round(msg.payload / 1000);\nmsg.payload = {\n \"gauges\": [\n {\n \"name\": \"random metric\",\n \"souce\": \"red-node-source\",\n \"value\": value,\n \"measure_time\": measure_time\n }\n ]\n};\nreturn msg;","outputs":1,"noerr":0,"x":427.5,"y":119,"wires":[["6d0496dc.fe1438"]]},{"id":"6d0496dc.fe1438","type":"http request","z":"a2e7ef47.d8313","name":"librato_post","method":"POST","ret":"txt","url":"https://metrics-api.librato.com/v1/metrics","x":718.5,"y":118,"wires":[[]]}] |
#Using Librato with Graylog2
Graylog2 is able to send your message counts per stream, host and overall to Librato Metrics. You can also send system instrumentation of graylog2-server, but this is disabled by default.
The following configuration options in graylog2.conf control this output:
With our Javascript SDK you can embed Librato graphs in your own applications.
We've leveraged the power of HTML 5 data attributes to make the embedding completely unobtrusive. To get started you'll need to include the SDK and specify your authentication credentials (account name/token) with a <script>
tag as follows:
<script type="text/javascript"
src="https://sdk.librato.com/librato-sdk-v0.5.1-min.js"
data-librato_email="foo@bar.com"
data-librato_token="16eb7a5fa3...">
#Extract all content from UserVoice - that produces a csv | |
#extracted two columns from the csv - the section and the article | |
#run this script on the file with those two columns | |
# uses https://github.com/alphabetum/pandoc-ruby | |
require 'pandoc-ruby' | |
require 'csv' | |
docs = CSV.read("kb.csv") |
<WriteHttp> | |
<Nodes> | |
<Node Name="collectdwin" Url="https://collectd.librato.com/v1/measurements" Timeout="10000" BatchSize="25" MaxIdleTime="600000" UserName="my@email.com" Password="09ee602bc0secret_tokenb5d5e3d15988f1" SafeCharsRegex="^[a-zA-Z0-9_-]*$" ReplaceWith="_"> | |
<Proxy Enable="false" Url="" /> | |
</Node> | |
</Nodes> | |
</WriteHttp> |
<CollectdWinConfig> | |
<GeneralSettings Interval="60" Timeout="120" StoreRates="false" /> | |
<Plugins> | |
<Plugin Name="Statsd" Class="BloombergFLP.CollectdWin.StatsdPlugin" Enable="false" /> | |
<Plugin Name="WindowsPerformanceCounter" Class="BloombergFLP.CollectdWin.WindowsPerformanceCounterPlugin" | |
Enable="true" /> | |
<Plugin Name="Amqp" Class="BloombergFLP.CollectdWin.AmqpPlugin" Enable="false" /> | |
<Plugin Name="WriteHttp" Class="BloombergFLP.CollectdWin.WriteHttpPlugin" Enable="true" /> |