#
# This Cacti Addon is for getting:
# - Temperature Data
# - Humidity
# - Wind Speed
# - Air Pressure
# from the Locations you'd want Monitor (maybe Server Locations)
# via Openweather graphed in Cacti
#
#######################################################################
1)
You need to have Python Modul 'simplejson' installed.
If you are not familiar with Python you have to do this
(based on a Debian System):
Code: Select all
apt-get install python-pip
after this you have to do this:
Code: Select all
pip install simplejson
now copy openweathermap_data.py to the scripts-Directory
(On Debian Systems it's in "/usr/share/cacti/site/scripts/" )
4)
import the Templates in Cacti with "Import Templates"
5)
The last point is an optical Feature, with CDEF-Functions for Temperature Graph
You have to create 2 easy CDEF Functions,
(maybe there will be an export Function for CDEF in future versions of Cacti too):
go to "Graph Management" -> CDEFs
click on "Add"
give the name "Greater 0" and click on Create
now click on Add
now do this:
Type: Special Data Source
Value: CURRENT_DATA_SOURCE
(Create)
Type: Custom String
Value: 0
(Create)
Type: Function
Value: MAX
now click on Save
NOW
click on "Graph Management" -> CDEFs again
(yes again, its for creating the second one)
click on "Add"
give the name "Lower 0" and click on Create
now click on Add
now do this:
Type: Special Data Source
Value: CURRENT_DATA_SOURCE
(Create)
Type: Custom String
Value: 0
(Create)
Type: Function
Value: MIN
now click on Save
DONE
USAGE:
Now when you select in Devices an Host click on "Create Graphs for this Host",
select in the Section "Graph Templates" (formally the first one) from the Selection Box "open Weather Map - <the Datatype you want to monitor>"
and click CREATE on the bottom of this Page,
you will be asked for City and Country to get the Temperatures.
(Maybe London uk, or Berlin de, or Paris fr ?)
Tip:
In the first minutes the Title in Graph Template seems to be incomplete.
I found out, if you've got some values in the Graph,
select the Open Weather Map - Graph Template in Graph Templates,
click on save,
now there should be the City and Country listed in the Graph like expected.
Have fun with this Cacti Addon