ableev / Zabbix-in-Telegram

Zabbix Notifications with graphs in Telegram
MIT License
771 stars 235 forks source link

Zabbix Graph period in telegram not showing data more the one hour #169

Closed hitesh240989 closed 5 years ago

hitesh240989 commented 5 years ago

Hi, I am able to send graphs to telegram but graph period is showing from the last one hour. I have changed in the python script as well even added period in while configuring Actions but still, I am seeing last one hour graph only.

As per zbxtg.py "zbxtg_image_period": "86400",

actions in zabbix: Last value: {ITEM.LASTVALUE1} ({TIME}) zbxtg;graphs zbxtg;graphs_period=86400 zbxtg;itemid:{ITEM.ID1} zbxtg;title:{HOST.HOST} - {TRIGGER.NAME}

May be I am doing something wrong. Kindly help to fix this.

ableev commented 5 years ago

@hitesh240989 which version of zabbix server?

hitesh240989 commented 5 years ago

Dear Ableev,

Zabbix Version: 4.0.6

hitesh240989 commented 5 years ago

Hi Ableev, I have referred to one of your old post related to the same issue.

Below change in python script has fixed the issue for me.

    zbx_img_url = self.server + "/chart3.php?**period={1}**&name={2}" \

-----Changed to below-----

   zbx_img_url = self.server + "/chart3.php?**from=now-{1}&to=now**&name={2}" \

Thank you.

ableev commented 5 years ago

@hitesh240989 , what will you do next time? https://github.com/ableev/Zabbix-in-Telegram/blob/master/zbxtg_settings.example.py#L22 Try this.