Ad Widget

Collapse

Weather forecast data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • antonie vonk
    Junior Member
    • Jul 2009
    • 9

    #1

    Weather forecast data

    Hi,

    We are using zabbix to monitor datacenters and Fibre to the Home POP locations.
    We are monitoring multiple items and important items for us are temperature and humidity.
    For some locations there is a direct relation between outside and inside temperature and humidity.

    We are also using a weather forecast website (API) to see the weather will be like in the next couple of days.

    With a HTTP agent it is possible the GET the data from de weather forecast API but............
    What we like to have in zabbix is the possibility to put this weather forecast data into a temperature and humidity (dependent) item with a timestamp into the future so a graph can be made.

    Example of weather forecast data:
    (List is an array of 40 items)
    (dt = time (epoch) in future)

    Code:
    [FONT=Lucida Sans Unicode]{
    "body": {[/FONT][INDENT][FONT=Lucida Sans Unicode]"cod": "200",[/FONT]
    [FONT=Lucida Sans Unicode]"message": 0,[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]"cnt": 40,
    "list": [{[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]"dt": 1615377600,
    "main": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"temp": 7.6,
    "feels_like": 0.9,
    "temp_min": 7.6,
    "temp_max": 8.61,
    "pressure": 1007,
    "sea_level": 1007,
    "grnd_level": 1014,
    "humidity": 72,
    "temp_kf": -1.01[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "weather": [{[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"id": 804,
    "main": "Clouds",
    "description": "overcast clouds",
    "icon": "04d"[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]}],
    "clouds": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"all": 100[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "wind": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"speed": 7.4,
    "deg": 206[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]"visibility": 10000,
    "pop": 0,
    "sys": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"pod": "d"[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]"dt_txt": "2021-03-10 12:00:00"[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]},[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]{[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]"dt": 1615388400,
    "main": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"temp": 8.18,
    "feels_like": 2.04,
    "temp_min": 8.18,
    "temp_max": 8.61,
    "pressure": 1010,
    "sea_level": 1010,
    "grnd_level": 1012,
    "humidity": 70,
    "temp_kf": -0.43[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "weather": [{[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"id": 804,
    "main": "Clouds",
    "description": "overcast clouds",
    "icon": "04d"[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]}],
    "clouds": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"all": 100[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "wind": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"speed": 6.64,
    "deg": 206[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "visibility": 10000,
    "pop": 0.14,
    "sys": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"pod": "d"[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "dt_txt": "2021-03-10 15:00:00"[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]},[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]{
    [I][FONT=Verdana]................... total of 40 items ..............[/FONT][/I]
    }],
    "city": {[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]"id": 2757783,
    "name": "De Bilt",
    "coord": {[/FONT][/INDENT][INDENT=3][FONT=Lucida Sans Unicode]"lat": 52.1016,
    "lon": 5.178[/FONT][/INDENT][INDENT=2][FONT=Lucida Sans Unicode]},
    "country": "NL",
    "population": 42111,
    "timezone": 3600,
    "sunrise": 1615356299,
    "sunset": 1615397659
    }[/FONT][/INDENT][INDENT][FONT=Lucida Sans Unicode]}[/FONT][/INDENT]
     
    [FONT=Lucida Sans Unicode]}[/FONT]
    Last edited by antonie vonk; 10-03-2021, 16:56.
  • roberto667
    Junior Member
    • May 2021
    • 1

    #2
    This may help. https://techexpert.tips/zabbix/zabbi...nitor-weather/
    I have done this for myself and it works. Zabbix will take care of GETting the the data and storing timestamps, and you can simply graph the data

    Comment

    Working...