billrothjr's Posts

Actually, its pretty simple. Check out how durren​ did it in the code, here: GitHub - BillRothVMware/wavefront-weather-py thanks
Can you post your alert query and a screen shot of it? Also, make sure you don't have bad data or a query error. Watch for misplaced *s.
Here’s a quick post about the latest integrations with Wavefront. In the past, we’ve done Tesla and Nest integrations, but Durren Shen recently posted a blog about integrating Wavefront with an A... See more...
Here’s a quick post about the latest integrations with Wavefront. In the past, we’ve done Tesla and Nest integrations, but Durren Shen recently posted a blog about integrating Wavefront with an Ambient Weather weather station and WUnderground, the crowd sourced weather site. (The API info is here.) Durren’s post is here. (Follow him here.) He also talked about code as well. I have cleaned it up and posted it to the GitHub repo here. To be clear, Durren (AKA durren ) wrote the code, I just cleaned it up. The code is essentially this: # Pulling data from WUnderground and sending to Wavefront by Python # # Core original code written by Durren Shen @durrenshen # in a blog at https://www.wavefront.com/weather-metrics/ # # Cleaned up by Bill Roth @BillRothVMware # import urllib2 import json import logging import socket import sys import time import re import syslog sock = socket.socket() # # Below assumes the proxy is running on the same system. YMMV # sock.connect(('127.0.0.1', 2878)) # # Set the source to yours. # sourceName = 'BrothPWS' # # Add your key here. You can get an API key here: https://www.wunderground.com/weather/api/ # Also change KCASANJO821.json to your station. Or you can use this one. # f = urllib2.urlopen('http://api.wunderground.com/api/Y/conditions/q/pws:KCASANJO821.json') json_string = f.read() parsed_json = json.loads(json_string) temp_f = parsed_json['current_observation']['temp_f'] sock.sendall('weather.temp_f ' + str(temp_f) + ' source=' + sourceName + ' \n') humidity = parsed_json['current_observation']['relative_humidity'] sock.sendall('weather.humidity ' + re.sub("[^0-9]", "", str((humidity))) + ' source=' + sourceName + ' \n') wind_degrees = parsed_json['current_observation']['wind_degrees'] sock.sendall('weather.wind_degrees ' + str(wind_degrees) + ' source=' + sourceName + ' \n') wind_mph = parsed_json['current_observation']['wind_mph'] sock.sendall('weather.wind_mph ' + str(wind_mph) + ' source=' + sourceName + ' \n') wind_gust_mph = parsed_json['current_observation']['wind_gust_mph'] sock.sendall('weather.wind_gust_mph ' + str(wind_gust_mph) + ' source=' + sourceName + ' \n') pressure_in = parsed_json['current_observation']['pressure_in'] sock.sendall('weather.pressure_in ' + str(pressure_in) + ' source=' + sourceName + ' \n') pressure_trend = parsed_json['current_observation']['pressure_trend'] sock.sendall('weather.pressure_trend ' + str(pressure_trend) + ' source=' + sourceName + ' \n') dewpoint_f = parsed_json['current_observation']['dewpoint_f'] sock.sendall('weather.dewpoint_f ' + str(dewpoint_f) + ' source=' + sourceName + ' \n') feelslike_f = parsed_json['current_observation']['feelslike_f'] sock.sendall('weather.feelslike_f ' + str(feelslike_f) + ' source=' + sourceName + ' \n') visibility_mi = parsed_json['current_observation']['visibility_mi'] sock.sendall('weather.visibility_mi ' + str(visibility_mi) + ' source=' + sourceName + ' \n') solarradiation = parsed_json['current_observation']['solarradiation'] sock.sendall('weather.solarradiation ' + str(solarradiation) + ' source=' + sourceName + ' \n') UV = parsed_json['current_observation']['UV'] sock.sendall('weather.UV ' + str(UV) + ' source=' + sourceName + ' \n') precip_1hr_in = parsed_json['current_observation']['precip_1hr_in'] sock.sendall('weather.precip_1hr_in ' + str(precip_1hr_in) + ' source=' + sourceName + ' \n') precip_today_in = parsed_json['current_observation']['precip_today_in'] sock.sendall('weather.precip_today_in ' + str(precip_today_in) + ' source=' + sourceName + ' \n') observation_epoch = parsed_json['current_observation']['observation_epoch'] syslog.syslog('Weather logged at ' + str(observation_epoch)); f.close() sock.close() It can produce a dashboard like this: To try out Wavefront, Check out Wavefront.com.
I am posting a short article here since I do not time for a long one. In short, as part of my job, I need to watch our web site. I want to get all our marketing data into Wavefront so we can s... See more...
I am posting a short article here since I do not time for a long one. In short, as part of my job, I need to watch our web site. I want to get all our marketing data into Wavefront so we can see it. So 2 questions come up: How do I pull data from Google Analytics How do I send that data to Wavefront in PHP(which I assume would be easy, and was). I took the code for this from:  https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php The GITHub repo is here: GitHub - BillRothVMware/wavefront-web-analytics-php Setup The code is not pretty. You are warned. To this this up, you'll need the PHP file and: 1. You'll need to get the composer stuff mentioned above: composer require google/apiclient:^2.0 2. You'll need to get the service credential file. See google web page above for instructions Deployment Deployment is a little funky. You have to do the following: 1. Make sure you get app the composer files 2. Move the service*.json to the directory for the php file 3. Move the "vendor" directory to the directory where the php file exists Sending Data The basic sending of data is pretty simple. See below. function sendWavefront($metric, $value, $ts, $tags, $source) {         global $logging;         $address = <MACHINE WITH PROXY>;     $service_port = 2878; // WF proxy port.         /* Create a TCP/IP socket. */     $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);     if ($socket === false) {         echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";         return;     } else {         //     }     $result = socket_connect($socket, $address, $service_port);     if ($result === false) {         echo "socket_connect() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n";         return;     } else {         //     }     $str = $metric . " " . $value . " " . $ts . " " . $tags . " source=" . $source . "\n";         if($logging)         syslog(LOG_INFO,$str);     socket_write($socket, $str, strlen($str));     socket_close($socket);     } KTbradley​ and EricNielsen​ FYI. My code still rocks.
Do you want the mean, or the median?    You could do a moving median with a sufficiently large windows. See the docs: mmedian(timeWindow, expression) Wavefront Query Language Quick Referenc... See more...
Do you want the mean, or the median?    You could do a moving median with a sufficiently large windows. See the docs: mmedian(timeWindow, expression) Wavefront Query Language Quick Reference | Wavefront
You mat want to flesh out your idea by clicking on "create an idea" to the right, and giving more detail about the context.
Did this get scheduled? Seems like an interesting idea. Needs to be fleshed out, tho'.
Oh yea, also remember to do all this as Admin. Windows is finicky like this.
I get this as well some times. Check your Program Files\Telegraf\telegraf.conf file. It likely happens when you forget to put strings in quotes, like for tags or the host name.
What cluster are you on? I believe we do throttle at some point on some clusters. Also include the name of your proxy, so we can watch it.
There has been a bunch of work going on in the area of measuring Java. Dropwizard Metrics in Java using Gauges and Counters In the interest of learning how to do in-line instrumentation wit... See more...
There has been a bunch of work going on in the area of measuring Java. Dropwizard Metrics in Java using Gauges and Counters In the interest of learning how to do in-line instrumentation with Java, I started the following project on GitHub. I'll continue to refine it over time. It uses Dropwizard Metrics, which, while a good set of libraries overall, is a bit complicated. Nebertheless, the full code is here. A More Sophisticated Example Doing bytecode instrumentation in Java with annotations and Dropwizard Note this is a work in progress. Will be completed shortly.
I started a new java code sample at: https://github.com/wgroth2/WFJavaAppExample. Let me know if you want to help.