Get image of graph in librenms

Hi! excuse me, I need help and I hope you can help me. I want to take a screenshot or get the image of graph. But, it keeps stuck on login page. As we know, graphs in Librenms are in jpg like this:

I want to download it automatically by running python script.
this is the script:
import imgkit
import requests
import time
from requests.auth import HTTPBasicAuth
session = requests.session()
requests.get(‘http://192.168.0./login’, auth=HTTPBasicAuth('’, ‘***’)')

But, the output just like this (stuck on login page):

I want the output is the image that showing graph. Thank you.

The format is PNG (default) or SVG depending on your LibreNMS settings.

The example of embedding images in an HTML alert will help you work out how to make this in your python script:

$config['allow_unauth_graphs_cidr'] = array('');
$config['allow_unauth_graphs'] = true;

You need to test or wait until this pull request is merged into the code as currently a bug with unauth graphs

you could possibly look at LibreNMS API as an alternate way for example " get_graph_by_portgroup" , not sure though if you can pull individual int graphs


I’ve added it. But, still can’t be accessed inside python

Can you browse directly to the image when logged out?

It can be browsed directly through browser, but it keeps failed when run python to get image screenshot

Hi @karinkf

Did you change to the real range of device that will try to dowlnload the images ?

I’ve changed it, but it still didn’t work for python