Santa Barbar Air Quality DS
If anyone's interested, I threw together a simple DS to pull air quality indices from ourair.org. The data's all around Santa Barbara, which is where our headquarters are. I did it more for an example and for our internal folks who live in that area.
PRMARN - SB_AirQuality
Either add ourair.org into your LM portal with display name of "Air Pollution Control District of Santa Barbara" or change the AppliesTo to apply to an existing device (a collector or some other device). The device it appliesto is irrelevant as the URL is hard coded into the script.
LM User
Posted 6 years ago·Last reply 6 years ago
8 comments
mnagel
·6 years agoweather is in there, which would be fine. My recollection was that OWM was free for basic access with a query limit, and the query limit could be kept to with the new caching feature so I will definitely revisit it now. Found it:
60 calls/minute
1,000,000 calls/month
It sounds like a lot, but without caching.... yeah :).
LM User
OP6 years agoYeah, precipitation was something I couldn't get for free.
FWIW, this is the json that my weather ds fetches:
mnagel
·6 years agoAwesome -- thanks!!!!
mnagel
·6 years agoExactly, I just stopped since I did not want to sign up for a much larger account than needed. I think there are other attributes I wanted to track, like precipitation, but pretty much that was put off since I could not restrict calls to once per zip code for each hour or so. We used to get that information (using caching) with Nagios from the Wunderground API and insert detail into alerts via our notification templating system. My philosophy has always been to include as much relevant information in alerts as possible to support Lazy Admin mode. A bit harder to do here without conditional templating, but I rebuilt that system into our ticketing system via an inbound transform. The main thing we lose is the ability to run callbacks to get stuff like top 5 process details, etc. Still, we only use that in some cases and most clients get alerts from LM, so still wishing for real templating one day :).
LM User
OP6 years agoThat could be handy for some of the zoom DSs (ZoomOverallDailyStats, which is unpublished). Hm......will have to look into this. @Stefan W
LM User
OP6 years agoYou mean like this: https://github.com/sweenig/lmcommunity/tree/master/OpenWeatherMap
Michael Rodrigues
·6 years ago@mnagel there's no SQLite JAR in there, unfortunately, but EA collectors do have a new script cache feature: https://www.logicmonitor.com/support/collectors/collector-configurations/collector-script-caching
The cache is scoped to a device, and entries will survive collection intervals.
mnagel
·6 years agoNice! I was trying to build out a DS for weather API checks some time back, but I run into the same issue I do with Cisco PSIRT API checks -- no way to cache results short of local files to avoid excessive usage due to duplicate calls. I guess I will just have to see what I can do with local files. Not sure if a SQLite binding is included with the provided Groovy libraries. If not, that could help.