Closed HoracioDos closed 3 years ago
Thank you for the report,
I currently quite overbooked, but if you could try to replace the line 90 from: sender_stdout = p.communicate(input=s)[0] to sender_stdout = p.communicate(input=s.encode())[0]
Hello.
I changed lines 89 and 91. It seems to work with: universal_newlines=True
and text = True
p = Popen(c, universal_newlines=True ,stdout=PIPE, stdin=PIPE, stderr=STDOUT)
...
loginf(self.zabbix_sender + " result: " +sender_stdout)
I get this out output but it seems to be other problem. I test zabbix-sender manually
Dec 15 11:59:56 pi2weewx /weewxd[26457]: zabbix: /usr/bin/zabbix_sender result: Response from "XXX.XXX.XXX.XXX:10051": "processed: 0; failed: 32; total: 32; seconds spent: 0.000570"
sent: 32; skipped: 0; total: 32
If I remember correctly, processed 0 is because the item does not exists in zabbix.
You just masked the line I was asking you to change? I don't even know what you tested...
Hello:
I tested what I answered before. I inserted universal_newlines=True
in popen() in line 89, It also works with text= True
and I removed decode() in line 91. I will test your change later.
p = Popen(c, universal_newlines=True ,stdout=PIPE, stdin=PIPE, stderr=STDOUT)
...
loginf(self.zabbix_sender + " result: " +sender_stdout)
Zabbix items were already created. I'll build a template if I have the time. I know why zabbix_sender is not working. I use PSK to cypher agent to server communication. I will add the config file that it is needed
-c /etc/zabbix/zabbix_agentd.conf
Thank you for the report,
I currently quite overbooked, but if you could try to replace the line 90 from: sender_stdout = p.communicate(input=s)[0] to sender_stdout = p.communicate(input=s.encode())[0]
Your solution works fine. I added the config file parameter. It's working now with PSK. I'm trying to figure out why zabbix_sender runs 3 times each time. What's the units for send_internal? Thanks!
Fixed for python3 in 7ca4c9f6dbf11daf6617a94e8df3c67cc1e972a5.
I think, but you should verify, the units are the same as the internal zabbix units (see http://weewx.com/docs/customizing.htm#Changing_the_unit_system).
Hello! I think Send_interval parameter is in seconds. As far as I understand, time difference result in your code (line 77) is in seconds. Is that correct? Thanks!
Send_Interval = 290 seconds works fine if I want to send values just once in the packet loop. This way matches with the archive interval.
Dec 17 14:56:02 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 14:55:00 -03 (1608227700) to database 'weewx.sdb'
Dec 17 14:56:02 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 14:55:00 -03 (1608227700) to daily summary in 'weewx.sdb'
Dec 17 15:01:04 pi2weewx python3[24347]: weewx[24347] INFO user.zabbix: Response from "xxx.xxx.xxx.xxx:10051": "processed: 32; failed: 0; total: 32; seconds spent: 0.001104" sent: 32; skipped: 0; total: 32
Dec 17 15:01:04 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 15:00:00 -03 (1608228000) to database 'weewx.sdb'
Dec 17 15:01:04 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 15:00:00 -03 (1608228000) to daily summary in 'weewx.sdb'
Dec 17 15:06:06 pi2weewx python3[24347]: weewx[24347] INFO user.zabbix: Response from "xxx.xxx.xxx.xxx:10051": "processed: 32; failed: 0; total: 32; seconds spent: 0.001014" sent: 32; skipped: 0; total: 32
Dec 17 15:06:06 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 15:05:00 -03 (1608228300) to database 'weewx.sdb'
Dec 17 15:06:06 pi2weewx python3[24347]: weewx[24347] INFO weewx.manager: Added record 2020-12-17 15:05:00 -03 (1608228300) to daily summary in 'weewx.sdb'
Dec 17 15:11:14 pi2weewx python3[24347]: weewx[24347] INFO user.zabbix: Response from "xxx.xxx.xxxx.xxx:10051": "processed: 32; failed: 0; total: 32; seconds spent: 0.000860" sent: 32; skipped: 0; total: 32
Hello. Zabbix extension fails to run.
Thanks