Telegram error

Hi everyone!

I try to setup some transports, and the slack is OK. But Telegram do not working. Try to config in Alerts/Alerts transports.

I tried the old transport way, and it’s OK. In console, try curl of the URL that is in LibreNMS/Alert/Transport/Telegram.php and it’s work. This is the result:
{"ok":true,"result":{"message_id":22,"from":{"id":681511308,"is_bot":true,"first_name":"proteknet_alert_bot","username":"Proteknet_bot"},"chat":{"id":644227663,"first_name":"Luciano","last_name":"Santos","username":"lucianosds","type":"private"},"date":1533223021,"text":"\"Curl Test\""}}. So the Tolken and ID are alright.

There’s a way or log to debug this, in web interface or in console mode?

run ./scripts/test-alert.php in the console (with -d switch)

Thanks @murrant.

I receive a message that file_put_contents.php has a file write permission restriction.

Warning: file_put_contents(/opt/librenms/storage/framework/views/260e8b19a1d8cd5ca4e022d4a08f8277): failed to open stream: Permission denied in /opt/librenms/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php on line 122

Warning: file_put_contents(/opt/librenms/storage/framework/views/6ccd3d0151c7a8fe2e1d584cef539860): failed to open stream: Permission denied in /opt/librenms/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php on line 122

The first warning has the object changed by target host.

Run ./validate.php it will tell you how to fix the issue.

Basically, you have a permissions issue. (Likely chown -R librenms:librenms /opt/librenms/storage/ or/and chmod -R g+w /opt/librenms/storage is the fix). But you could also need to add your webserver user to your LibreNMS group.

Thanks for the support!

The validade.php script show that everything ok. But after updateing librenms today, the telegram test starts to look ok.

I don’t think validate recursively checks permissions in those folders.