Closed ahanjrah closed 5 years ago
Since the script works, it's probably something related to how Zabbix is configured. In which case the Zabbix forums might be of more help. If you do end up over there, mentioning the version of Zabbix you're using might be a good idea, the way media scripts are handled changed between 2 and 3. Don't know about 4. That said, in Zabbix UI go to Monitoring -> Problems (Zabbix 3). You can see the latest alerts there. To the right you should have an "Actions" column. It tells you what it tried to do about each problem, like send message to users. And if it worked or not. Clicking on the date should give you more details. Check that it actually tried to send to that user. If it did and failed it should give you an idea why. If it didn't, see below. One common issue is permissions given to the user that has the script attached. Check that the user has Read permissions to the hosts that generated the problem, otherwise it won't receive the alert. Obviously, the script should have proper permissions and should be in the right directory. The user that Zabbix runs as (probably "zabbix") should be able to run the script. If that's not it I'm not sure that I can help. Maybe try asking on the Zabbix forums.
As mentioned in the subject, this is happening lately..I am using the config file provided and I also tried to regenerate the API, all to no avail. How can I check if the output of this script when running through zabbix? Running the script directly like
./pyzlack.py -c pyzlack.conf -t "#alerting" "testing - zabbix"
does send alerts to slack. Please suggest. Thanks.