New GuzzleHttp does not honor proxy settings

Observed behaviour:
The new GuzzleHTTP Client code in LibreNMS/Alert/Transport/Api.php, introduced with PR #10070 does not honor proxy settings.
Thus breaking Api notifications in environments requiring a proxy.

Expected behaviour:
The new GuzzleHTTP Client code in LibreNMS/Alert/Transport/Api.php honors proxy setting from environment or config.php.

Validate output:
Note: Api.php has manually been modified with a workaround for said problem

====================================

Component Version
LibreNMS 1.56
DB Schema 2019_09_05_153524_create_notifications_attribs_index (141)
PHP 7.2.19
MySQL 5.5.60-MariaDB
RRDTool 1.6.0
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 1.9.0
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
LibreNMS/Alert/Transport/Api.php
[FAIL] Some folders have incorrect file permissions, this may cause issues.
[FIX]:
sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Files:
/opt/librenms/storage/framework/views/02ea8d160e2d0303d6da3babaec7627a

Hi @kleinem86

Could you submit a PR with the fix for this ? We’ll be happy to review it and merge it for others using a proxy.

Thanx

Hi,

sorry i’m afraid providing a proper/clean fix myself is beyond my skills.

My workaround basically just hardcodes the proxy i’m using into the existing api.php file, into the argument array format guzzlehttp expects.
This can be found here:
http://docs.guzzlephp.org/en/stable/request-options.html#proxy

I guess one would have to wrap a simple “if” clause around it to check if a proxy is globally set.

Regards